diff options
| author | 2018-12-21 00:07:32 -0300 | |
|---|---|---|
| committer | 2019-01-15 17:54:50 -0300 | |
| commit | cacb934f21d5b2abcbae168f8916bf3e3a21d64b (patch) | |
| tree | 475d5c74d8765db80d5add9cc38f8f40b079bd7b /src | |
| parent | shader_decode: Implement ST_A (diff) | |
| download | yuzu-cacb934f21d5b2abcbae168f8916bf3e3a21d64b.tar.gz yuzu-cacb934f21d5b2abcbae168f8916bf3e3a21d64b.tar.xz yuzu-cacb934f21d5b2abcbae168f8916bf3e3a21d64b.zip | |
shader_decode: Implement EXIT
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/shader/decode/other.cpp | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/src/video_core/shader/decode/other.cpp b/src/video_core/shader/decode/other.cpp index d84702a4f..2a5b70b8b 100644 --- a/src/video_core/shader/decode/other.cpp +++ b/src/video_core/shader/decode/other.cpp | |||
| @@ -16,7 +16,38 @@ u32 ShaderIR::DecodeOther(BasicBlock& bb, u32 pc) { | |||
| 16 | const Instruction instr = {program_code[pc]}; | 16 | const Instruction instr = {program_code[pc]}; |
| 17 | const auto opcode = OpCode::Decode(instr); | 17 | const auto opcode = OpCode::Decode(instr); |
| 18 | 18 | ||
| 19 | UNIMPLEMENTED(); | 19 | switch (opcode->get().GetId()) { |
| 20 | case OpCode::Id::EXIT: { | ||
| 21 | const Tegra::Shader::ConditionCode cc = instr.flow_condition_code; | ||
| 22 | UNIMPLEMENTED_IF_MSG(cc != Tegra::Shader::ConditionCode::T, "EXIT condition code used: {}", | ||
| 23 | static_cast<u32>(cc)); | ||
| 24 | |||
| 25 | switch (instr.flow.cond) { | ||
| 26 | case Tegra::Shader::FlowCondition::Always: | ||
| 27 | bb.push_back(Operation(OperationCode::Exit)); | ||
| 28 | if (instr.pred.pred_index == static_cast<u64>(Tegra::Shader::Pred::UnusedIndex)) { | ||
| 29 | // If this is an unconditional exit then just end processing here, | ||
| 30 | // otherwise we have to account for the possibility of the condition | ||
| 31 | // not being met, so continue processing the next instruction. | ||
| 32 | pc = MAX_PROGRAM_LENGTH - 1; | ||
| 33 | } | ||
| 34 | break; | ||
| 35 | |||
| 36 | case Tegra::Shader::FlowCondition::Fcsm_Tr: | ||
| 37 | // TODO(bunnei): What is this used for? If we assume this conditon is not | ||
| 38 | // satisifed, dual vertex shaders in Farming Simulator make more sense | ||
| 39 | UNIMPLEMENTED_MSG("Skipping unknown FlowCondition::Fcsm_Tr"); | ||
| 40 | break; | ||
| 41 | |||
| 42 | default: | ||
| 43 | UNIMPLEMENTED_MSG("Unhandled flow condition: {}", | ||
| 44 | static_cast<u32>(instr.flow.cond.Value())); | ||
| 45 | } | ||
| 46 | break; | ||
| 47 | } | ||
| 48 | default: | ||
| 49 | UNIMPLEMENTED_MSG("Unhandled instruction: {}", opcode->get().GetName()); | ||
| 50 | } | ||
| 20 | 51 | ||
| 21 | return pc; | 52 | return pc; |
| 22 | } | 53 | } |