summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2018-12-21 04:07:32 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2019-01-15 21:54:50 +0100
commitcacb934f21d5b2abcbae168f8916bf3e3a21d64b (patch)
tree475d5c74d8765db80d5add9cc38f8f40b079bd7b /src/video_core
parentshader_decode: Implement ST_A (diff)
downloadyuzu-cacb934f21d5b2abcbae168f8916bf3e3a21d64b.tar
yuzu-cacb934f21d5b2abcbae168f8916bf3e3a21d64b.tar.gz
yuzu-cacb934f21d5b2abcbae168f8916bf3e3a21d64b.tar.bz2
yuzu-cacb934f21d5b2abcbae168f8916bf3e3a21d64b.tar.lz
yuzu-cacb934f21d5b2abcbae168f8916bf3e3a21d64b.tar.xz
yuzu-cacb934f21d5b2abcbae168f8916bf3e3a21d64b.tar.zst
yuzu-cacb934f21d5b2abcbae168f8916bf3e3a21d64b.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/shader/decode/other.cpp33
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) {
const Instruction instr = {program_code[pc]};
const auto opcode = OpCode::Decode(instr);
- UNIMPLEMENTED();
+ switch (opcode->get().GetId()) {
+ case OpCode::Id::EXIT: {
+ const Tegra::Shader::ConditionCode cc = instr.flow_condition_code;
+ UNIMPLEMENTED_IF_MSG(cc != Tegra::Shader::ConditionCode::T, "EXIT condition code used: {}",
+ static_cast<u32>(cc));
+
+ switch (instr.flow.cond) {
+ case Tegra::Shader::FlowCondition::Always:
+ bb.push_back(Operation(OperationCode::Exit));
+ if (instr.pred.pred_index == static_cast<u64>(Tegra::Shader::Pred::UnusedIndex)) {
+ // If this is an unconditional exit then just end processing here,
+ // otherwise we have to account for the possibility of the condition
+ // not being met, so continue processing the next instruction.
+ pc = MAX_PROGRAM_LENGTH - 1;
+ }
+ break;
+
+ case Tegra::Shader::FlowCondition::Fcsm_Tr:
+ // TODO(bunnei): What is this used for? If we assume this conditon is not
+ // satisifed, dual vertex shaders in Farming Simulator make more sense
+ UNIMPLEMENTED_MSG("Skipping unknown FlowCondition::Fcsm_Tr");
+ break;
+
+ default:
+ UNIMPLEMENTED_MSG("Unhandled flow condition: {}",
+ static_cast<u32>(instr.flow.cond.Value()));
+ }
+ break;
+ }
+ default:
+ UNIMPLEMENTED_MSG("Unhandled instruction: {}", opcode->get().GetName());
+ }
return pc;
}