diff options
| author | 2018-12-20 22:49:59 -0300 | |
|---|---|---|
| committer | 2019-01-15 17:54:49 -0300 | |
| commit | 2f87fd060d6bed70fb90d97f8c847a0bd03d4c43 (patch) | |
| tree | 7aad8cb65562a6b304ed692c23d7f6e16ad2d850 /src | |
| parent | shader_ir: Add attribute getters (diff) | |
| download | yuzu-2f87fd060d6bed70fb90d97f8c847a0bd03d4c43.tar.gz yuzu-2f87fd060d6bed70fb90d97f8c847a0bd03d4c43.tar.xz yuzu-2f87fd060d6bed70fb90d97f8c847a0bd03d4c43.zip | |
shader_ir: Add internal flag getters
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/shader/shader_ir.cpp | 8 | ||||
| -rw-r--r-- | src/video_core/shader/shader_ir.h | 2 |
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 | ||
| 112 | Node 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) { |