From 2fda17cf3c61440ea9e9e976c8629101715b0790 Mon Sep 17 00:00:00 2001 From: Dan Weatherford Date: Wed, 11 Nov 2015 17:05:51 -0600 Subject: [PATCH] Fix relative constant fetch on second source operand of shader instruction The sense for this test was backwards, causing AppendSrcReg to read the wrong const_n_rel_abs flag if the first operand was not a constant fetch. --- src/xenia/gpu/gl4/gl4_shader_translator.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xenia/gpu/gl4/gl4_shader_translator.cc b/src/xenia/gpu/gl4/gl4_shader_translator.cc index 3c6d82240..078bd5c70 100644 --- a/src/xenia/gpu/gl4/gl4_shader_translator.cc +++ b/src/xenia/gpu/gl4/gl4_shader_translator.cc @@ -174,13 +174,13 @@ void GL4ShaderTranslator::AppendSrcReg(const ucode::instr_alu_t& op, int i) { break; } case 2: { - int const_slot = op.src1_sel ? 1 : 0; + int const_slot = op.src1_sel ? 0 : 1; AppendSrcReg(op, op.src2_reg, op.src2_sel, op.src2_swiz, op.src2_reg_negate, const_slot); break; } case 3: { - int const_slot = (op.src1_sel || op.src2_sel) ? 1 : 0; + int const_slot = (op.src1_sel && op.src2_sel) ? 0 : 1; AppendSrcReg(op, op.src3_reg, op.src3_sel, op.src3_swiz, op.src3_reg_negate, const_slot); break;