From 6ca31f544a4559eca547b45b5158d210932cc428 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Mon, 17 Dec 2018 19:03:53 -0300 Subject: [PATCH] shader_decode: Implement BRA internal flag --- src/video_core/shader/decode/other.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/video_core/shader/decode/other.cpp b/src/video_core/shader/decode/other.cpp index 0416d7eaa..5b3f9aa30 100644 --- a/src/video_core/shader/decode/other.cpp +++ b/src/video_core/shader/decode/other.cpp @@ -50,11 +50,15 @@ u32 ShaderIR::DecodeOther(BasicBlock& bb, u32 pc) { UNIMPLEMENTED_IF_MSG(instr.bra.constant_buffer != 0, "BRA with constant buffers are not implemented"); - const Tegra::Shader::ConditionCode cc = instr.flow_condition_code; - UNIMPLEMENTED_IF(cc != Tegra::Shader::ConditionCode::T); - const u32 target = pc + instr.bra.GetBranchTarget(); - bb.push_back(Operation(OperationCode::Bra, Immediate(target))); + const Node branch = Operation(OperationCode::Bra, Immediate(target)); + + const Tegra::Shader::ConditionCode cc = instr.flow_condition_code; + if (cc != Tegra::Shader::ConditionCode::T) { + bb.push_back(Conditional(GetConditionCode(cc), {branch})); + } else { + bb.push_back(branch); + } break; } case OpCode::Id::SSY: {