diff options
| author | 2018-12-21 02:08:52 -0300 | |
|---|---|---|
| committer | 2019-01-15 17:54:51 -0300 | |
| commit | acdbbb88854b4c1dc75353018fcf2e5480cea858 (patch) | |
| tree | 32e30e411f766382c967a67da9d329f8abe71dfc /src | |
| parent | shader_decode: Implement SHL (diff) | |
| download | yuzu-acdbbb88854b4c1dc75353018fcf2e5480cea858.tar.gz yuzu-acdbbb88854b4c1dc75353018fcf2e5480cea858.tar.xz yuzu-acdbbb88854b4c1dc75353018fcf2e5480cea858.zip | |
shader_decode: Implement LD_C
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/shader/decode/memory.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/video_core/shader/decode/memory.cpp b/src/video_core/shader/decode/memory.cpp index d8265d3fd..6219f8ee6 100644 --- a/src/video_core/shader/decode/memory.cpp +++ b/src/video_core/shader/decode/memory.cpp | |||
| @@ -73,6 +73,37 @@ u32 ShaderIR::DecodeMemory(BasicBlock& bb, u32 pc) { | |||
| 73 | } | 73 | } |
| 74 | break; | 74 | break; |
| 75 | } | 75 | } |
| 76 | case OpCode::Id::LD_C: { | ||
| 77 | UNIMPLEMENTED_IF(instr.ld_c.unknown != 0); | ||
| 78 | |||
| 79 | Node index = GetRegister(instr.gpr8); | ||
| 80 | |||
| 81 | const Node op_a = | ||
| 82 | GetConstBufferIndirect(instr.cbuf36.index, instr.cbuf36.offset + 0, index); | ||
| 83 | |||
| 84 | switch (instr.ld_c.type.Value()) { | ||
| 85 | case Tegra::Shader::UniformType::Single: | ||
| 86 | SetRegister(bb, instr.gpr0, op_a); | ||
| 87 | break; | ||
| 88 | |||
| 89 | case Tegra::Shader::UniformType::Double: { | ||
| 90 | const Node op_b = | ||
| 91 | GetConstBufferIndirect(instr.cbuf36.index, instr.cbuf36.offset + 4, index); | ||
| 92 | |||
| 93 | const Node composite = | ||
| 94 | Operation(OperationCode::Composite, op_a, op_b, GetRegister(RZ), GetRegister(RZ)); | ||
| 95 | |||
| 96 | MetaComponents meta{{0, 1, 2, 3}}; | ||
| 97 | bb.push_back(Operation(OperationCode::AssignComposite, meta, composite, | ||
| 98 | GetRegister(instr.gpr0), GetRegister(instr.gpr0.Value() + 1), | ||
| 99 | GetRegister(RZ), GetRegister(RZ))); | ||
| 100 | break; | ||
| 101 | } | ||
| 102 | default: | ||
| 103 | UNIMPLEMENTED_MSG("Unhandled type: {}", static_cast<unsigned>(instr.ld_c.type.Value())); | ||
| 104 | } | ||
| 105 | break; | ||
| 106 | } | ||
| 76 | case OpCode::Id::ST_A: { | 107 | case OpCode::Id::ST_A: { |
| 77 | UNIMPLEMENTED_IF_MSG(instr.gpr8.Value() != Register::ZeroIndex, | 108 | UNIMPLEMENTED_IF_MSG(instr.gpr8.Value() != Register::ZeroIndex, |
| 78 | "Indirect attribute loads are not supported"); | 109 | "Indirect attribute loads are not supported"); |