Browse Source

shader_ir: Add internal flag getters

nce_cpp
ReinUsesLisp 7 years ago
parent
commit
311d1af657
  1. 8
      src/video_core/shader/shader_ir.cpp
  2. 2
      src/video_core/shader/shader_ir.h

8
src/video_core/shader/shader_ir.cpp

@ -109,6 +109,14 @@ Node ShaderIR::GetOutputAttribute(Attribute::Index index, u64 element, Node buff
return StoreNode(AbufNode(index, static_cast<u32>(element), buffer));
}
Node ShaderIR::GetInternalFlag(InternalFlag flag, bool negated) {
const Node node = StoreNode(InternalFlagNode(flag));
if (negated) {
return Operation(OperationCode::LogicalNegate, node);
}
return node;
}
/*static*/ OperationCode ShaderIR::SignedToUnsignedCode(OperationCode operation_code,
bool is_signed) {
if (is_signed) {

2
src/video_core/shader/shader_ir.h

@ -629,6 +629,8 @@ private:
const Tegra::Shader::IpaMode& input_mode, Node buffer = {});
/// Generates a node representing an output atttribute. Keeps track of used attributes.
Node GetOutputAttribute(Tegra::Shader::Attribute::Index index, u64 element, Node buffer);
/// Generates a node representing an internal flag
Node GetInternalFlag(InternalFlag flag, bool negated = false);
template <typename... T>
inline Node Operation(OperationCode code, const T*... operands) {

Loading…
Cancel
Save