summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_core/shader/shader_ir.cpp8
-rw-r--r--src/video_core/shader/shader_ir.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/src/video_core/shader/shader_ir.cpp b/src/video_core/shader/shader_ir.cpp
index 0c814fc80..62a139e56 100644
--- a/src/video_core/shader/shader_ir.cpp
+++ b/src/video_core/shader/shader_ir.cpp
@@ -109,6 +109,14 @@ Node ShaderIR::GetOutputAttribute(Attribute::Index index, u64 element, Node buff
109 return StoreNode(AbufNode(index, static_cast<u32>(element), buffer)); 109 return StoreNode(AbufNode(index, static_cast<u32>(element), buffer));
110} 110}
111 111
112Node ShaderIR::GetInternalFlag(InternalFlag flag, bool negated) {
113 const Node node = StoreNode(InternalFlagNode(flag));
114 if (negated) {
115 return Operation(OperationCode::LogicalNegate, node);
116 }
117 return node;
118}
119
112/*static*/ OperationCode ShaderIR::SignedToUnsignedCode(OperationCode operation_code, 120/*static*/ OperationCode ShaderIR::SignedToUnsignedCode(OperationCode operation_code,
113 bool is_signed) { 121 bool is_signed) {
114 if (is_signed) { 122 if (is_signed) {
diff --git a/src/video_core/shader/shader_ir.h b/src/video_core/shader/shader_ir.h
index fde1594aa..d839d1f1b 100644
--- a/src/video_core/shader/shader_ir.h
+++ b/src/video_core/shader/shader_ir.h
@@ -629,6 +629,8 @@ private:
629 const Tegra::Shader::IpaMode& input_mode, Node buffer = {}); 629 const Tegra::Shader::IpaMode& input_mode, Node buffer = {});
630 /// Generates a node representing an output atttribute. Keeps track of used attributes. 630 /// Generates a node representing an output atttribute. Keeps track of used attributes.
631 Node GetOutputAttribute(Tegra::Shader::Attribute::Index index, u64 element, Node buffer); 631 Node GetOutputAttribute(Tegra::Shader::Attribute::Index index, u64 element, Node buffer);
632 /// Generates a node representing an internal flag
633 Node GetInternalFlag(InternalFlag flag, bool negated = false);
632 634
633 template <typename... T> 635 template <typename... T>
634 inline Node Operation(OperationCode code, const T*... operands) { 636 inline Node Operation(OperationCode code, const T*... operands) {