diff options
| author | 2018-12-20 22:53:43 -0300 | |
|---|---|---|
| committer | 2019-01-15 17:54:49 -0300 | |
| commit | 6b9eea3fe55f882d624211415c7777e1eec7f1bd (patch) | |
| tree | 05c44dd73eacbad492a2994c2c49ea140ea9be1f /src | |
| parent | shader_ir: Add local memory getters (diff) | |
| download | yuzu-6b9eea3fe55f882d624211415c7777e1eec7f1bd.tar.gz yuzu-6b9eea3fe55f882d624211415c7777e1eec7f1bd.tar.xz yuzu-6b9eea3fe55f882d624211415c7777e1eec7f1bd.zip | |
shader_ir: Add setters
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/shader/shader_ir.cpp | 16 | ||||
| -rw-r--r-- | src/video_core/shader/shader_ir.h | 8 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/video_core/shader/shader_ir.cpp b/src/video_core/shader/shader_ir.cpp index 42695149f..48046d967 100644 --- a/src/video_core/shader/shader_ir.cpp +++ b/src/video_core/shader/shader_ir.cpp | |||
| @@ -121,6 +121,22 @@ Node ShaderIR::GetLocalMemory(Node address) { | |||
| 121 | return StoreNode(LmemNode(address)); | 121 | return StoreNode(LmemNode(address)); |
| 122 | } | 122 | } |
| 123 | 123 | ||
| 124 | void ShaderIR::SetRegister(BasicBlock& bb, Register dest, Node src) { | ||
| 125 | bb.push_back(Operation(OperationCode::Assign, GetRegister(dest), src)); | ||
| 126 | } | ||
| 127 | |||
| 128 | void ShaderIR::SetPredicate(BasicBlock& bb, u64 dest, Node src) { | ||
| 129 | bb.push_back(Operation(OperationCode::LogicalAssign, GetPredicate(dest), src)); | ||
| 130 | } | ||
| 131 | |||
| 132 | void ShaderIR::SetInternalFlag(BasicBlock& bb, InternalFlag flag, Node value) { | ||
| 133 | bb.push_back(Operation(OperationCode::LogicalAssign, GetInternalFlag(flag), value)); | ||
| 134 | } | ||
| 135 | |||
| 136 | void ShaderIR::SetLocalMemory(BasicBlock& bb, Node address, Node value) { | ||
| 137 | bb.push_back(Operation(OperationCode::Assign, GetLocalMemory(address), value)); | ||
| 138 | } | ||
| 139 | |||
| 124 | /*static*/ OperationCode ShaderIR::SignedToUnsignedCode(OperationCode operation_code, | 140 | /*static*/ OperationCode ShaderIR::SignedToUnsignedCode(OperationCode operation_code, |
| 125 | bool is_signed) { | 141 | bool is_signed) { |
| 126 | if (is_signed) { | 142 | if (is_signed) { |
diff --git a/src/video_core/shader/shader_ir.h b/src/video_core/shader/shader_ir.h index 64c30bb6a..192b18ac7 100644 --- a/src/video_core/shader/shader_ir.h +++ b/src/video_core/shader/shader_ir.h | |||
| @@ -634,6 +634,14 @@ private: | |||
| 634 | /// Generates a node representing a local memory address | 634 | /// Generates a node representing a local memory address |
| 635 | Node GetLocalMemory(Node address); | 635 | Node GetLocalMemory(Node address); |
| 636 | 636 | ||
| 637 | /// Sets a register. src value must be a number-evaluated node. | ||
| 638 | void SetRegister(BasicBlock& bb, Tegra::Shader::Register dest, Node src); | ||
| 639 | /// Sets a predicate. src value must be a bool-evaluated node | ||
| 640 | void SetPredicate(BasicBlock& bb, u64 dest, Node src); | ||
| 641 | /// Sets an internal flag. src value must be a bool-evaluated node | ||
| 642 | void SetInternalFlag(BasicBlock& bb, InternalFlag flag, Node value); | ||
| 643 | /// Sets a local memory address. address and value must be a number-evaluated node | ||
| 644 | void SetLocalMemory(BasicBlock& bb, Node address, Node value); | ||
| 637 | 645 | ||
| 638 | template <typename... T> | 646 | template <typename... T> |
| 639 | inline Node Operation(OperationCode code, const T*... operands) { | 647 | inline Node Operation(OperationCode code, const T*... operands) { |