summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFernandoS27 <fsahmkow27@gmail.com>2018-11-16 17:07:22 +0100
committerFernandoS27 <fsahmkow27@gmail.com>2018-11-24 18:25:54 +0100
commit33afff187056ca6ea4c1418d9dbabbdc888d710e (patch)
treed209abb868ebdafbc62b6c96c77b4adccb474b92
parentMerge pull request #1641 from DarkLordZach/sm-register-unregister (diff)
downloadyuzu-33afff187056ca6ea4c1418d9dbabbdc888d710e.tar
yuzu-33afff187056ca6ea4c1418d9dbabbdc888d710e.tar.gz
yuzu-33afff187056ca6ea4c1418d9dbabbdc888d710e.tar.bz2
yuzu-33afff187056ca6ea4c1418d9dbabbdc888d710e.tar.lz
yuzu-33afff187056ca6ea4c1418d9dbabbdc888d710e.tar.xz
yuzu-33afff187056ca6ea4c1418d9dbabbdc888d710e.tar.zst
yuzu-33afff187056ca6ea4c1418d9dbabbdc888d710e.zip
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 97b9028c5..df81286ea 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -3254,6 +3254,10 @@ private:
regs.SetRegisterToInteger(instr.gpr0, false, 0, predicate + " ? 0xFFFFFFFF : 0", 1,
1);
}
+ if (instr.generates_cc.Value() != 0) {
+ regs.SetInternalFlag(InternalFlag::ZeroFlag, predicate);
+ LOG_WARNING(HW_GPU, "FSET Condition Code is incomplete");
+ }
break;
}
case OpCode::Type::IntegerSet: {
@@ -3530,11 +3534,17 @@ private:
"BRA with constant buffers are not implemented");
const Tegra::Shader::ConditionCode cc = instr.flow_condition_code;
- UNIMPLEMENTED_IF_MSG(cc != Tegra::Shader::ConditionCode::T,
- "BRA condition code used: {}", static_cast<u32>(cc));
-
const u32 target = offset + instr.bra.GetBranchTarget();
- shader.AddLine("{ jmp_to = " + std::to_string(target) + "u; break; }");
+ if (cc != Tegra::Shader::ConditionCode::T) {
+ const std::string condition_code = regs.GetConditionCode(cc);
+ shader.AddLine("if (" + condition_code + "){");
+ shader.scope++;
+ shader.AddLine("{ jmp_to = " + std::to_string(target) + "u; break; }");
+ shader.scope--;
+ shader.AddLine('}');
+ } else {
+ shader.AddLine("{ jmp_to = " + std::to_string(target) + "u; break; }");
+ }
break;
}
case OpCode::Id::IPA: {