summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-11-27 00:28:03 +0100
committerGitHub <noreply@github.com>2018-11-27 00:28:03 +0100
commit7684f4d0cf92f3badf4e8599122d6d5f599764cb (patch)
treeecf4d5a4e078f3a707627a0ad782c137bf955d75
parentMerge pull request #1798 from ReinUsesLisp/y-direction (diff)
parentImplemented BRA CC conditional and FSET CC Setting (diff)
downloadyuzu-7684f4d0cf92f3badf4e8599122d6d5f599764cb.tar
yuzu-7684f4d0cf92f3badf4e8599122d6d5f599764cb.tar.gz
yuzu-7684f4d0cf92f3badf4e8599122d6d5f599764cb.tar.bz2
yuzu-7684f4d0cf92f3badf4e8599122d6d5f599764cb.tar.lz
yuzu-7684f4d0cf92f3badf4e8599122d6d5f599764cb.tar.xz
yuzu-7684f4d0cf92f3badf4e8599122d6d5f599764cb.tar.zst
yuzu-7684f4d0cf92f3badf4e8599122d6d5f599764cb.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 3d4d0f23e..7c0935a4e 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -3401,6 +3401,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: {
@@ -3682,11 +3686,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: {