From 98cd5164c508e7cc5eedee1d6541948e341f32a9 Mon Sep 17 00:00:00 2001 From: wwylele Date: Thu, 20 Jul 2017 22:47:53 +0300 Subject: debugger/shader: fix inverted uniform flow control --- src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp') diff --git a/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp index e3f3194db..f8584dce7 100644 --- a/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp +++ b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp @@ -255,7 +255,7 @@ QVariant GraphicsVertexShaderModel::data(const QModelIndex& index, int role) con output << '('; if (instr.flow_control.op != instr.flow_control.JustY) { - if (instr.flow_control.refx) + if (!instr.flow_control.refx) output << '!'; output << "cc.x"; } @@ -267,7 +267,7 @@ QVariant GraphicsVertexShaderModel::data(const QModelIndex& index, int role) con } if (instr.flow_control.op != instr.flow_control.JustX) { - if (instr.flow_control.refy) + if (!instr.flow_control.refy) output << '!'; output << "cc.y"; } -- cgit v1.2.3 From 8375fd2aba3d700bf8b5269820f3b7cb93c56c8c Mon Sep 17 00:00:00 2001 From: wwylele Date: Thu, 20 Jul 2017 22:58:38 +0300 Subject: debugger/shader: fix address register for reverted arithmetic op --- .../debugger/graphics/graphics_vertex_shader.cpp | 29 +++++++--------------- 1 file changed, 9 insertions(+), 20 deletions(-) (limited to 'src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp') diff --git a/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp index f8584dce7..f6bd6bf61 100644 --- a/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp +++ b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp @@ -183,23 +183,13 @@ QVariant GraphicsVertexShaderModel::data(const QModelIndex& index, int role) con print_input(output, src1, swizzle.negate_src1, SelectorToString(swizzle.src1_selector)); AlignToColumn(kInputOperandColumnWidth); - if (src_is_inverted) { - print_input(output, src2, swizzle.negate_src2, - SelectorToString(swizzle.src2_selector)); - } else { - print_input(output, src2, swizzle.negate_src2, - SelectorToString(swizzle.src2_selector), true, - instr.mad.AddressRegisterName()); - } + print_input(output, src2, swizzle.negate_src2, + SelectorToString(swizzle.src2_selector), true, + src_is_inverted ? "" : instr.mad.AddressRegisterName()); AlignToColumn(kInputOperandColumnWidth); - if (src_is_inverted) { - print_input(output, src3, swizzle.negate_src3, - SelectorToString(swizzle.src3_selector), true, - instr.mad.AddressRegisterName()); - } else { - print_input(output, src3, swizzle.negate_src3, - SelectorToString(swizzle.src3_selector)); - } + print_input(output, src3, swizzle.negate_src3, + SelectorToString(swizzle.src3_selector), true, + src_is_inverted ? instr.mad.AddressRegisterName() : ""); AlignToColumn(kInputOperandColumnWidth); break; } @@ -222,16 +212,15 @@ QVariant GraphicsVertexShaderModel::data(const QModelIndex& index, int role) con SourceRegister src1 = instr.common.GetSrc1(src_is_inverted); print_input(output, src1, swizzle.negate_src1, swizzle.SelectorToString(false), true, - instr.common.AddressRegisterName()); + src_is_inverted ? "" : instr.common.AddressRegisterName()); AlignToColumn(kInputOperandColumnWidth); } - // TODO: In some cases, the Address Register is used as an index for SRC2 - // instead of SRC1 if (opcode_info.subtype & OpCode::Info::Src2) { SourceRegister src2 = instr.common.GetSrc2(src_is_inverted); print_input(output, src2, swizzle.negate_src2, - swizzle.SelectorToString(true)); + swizzle.SelectorToString(true), true, + src_is_inverted ? instr.common.AddressRegisterName() : ""); AlignToColumn(kInputOperandColumnWidth); } break; -- cgit v1.2.3 From b5609e15781010a08afbd20778d34b1a8567995d Mon Sep 17 00:00:00 2001 From: wwylele Date: Thu, 20 Jul 2017 23:18:07 +0300 Subject: debugger/shader: print the invert flag for JMPU --- src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp') diff --git a/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp index f6bd6bf61..1301a3fed 100644 --- a/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp +++ b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp @@ -263,6 +263,10 @@ QVariant GraphicsVertexShaderModel::data(const QModelIndex& index, int role) con output << ") "; } else if (opcode_info.subtype & OpCode::Info::HasUniformIndex) { + if (opcode.EffectiveOpCode() == OpCode::Id::JMPU && + (instr.flow_control.num_instructions & 1) == 1) { + output << '!'; + } output << 'b' << instr.flow_control.bool_uniform_id << ' '; } -- cgit v1.2.3 From 49602139c8cca0bf20e9c6f95ff8243751401578 Mon Sep 17 00:00:00 2001 From: wwylele Date: Thu, 20 Jul 2017 23:30:34 +0300 Subject: debugger/shader: display LOOP --- src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp') diff --git a/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp index 1301a3fed..7f4ec0c52 100644 --- a/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp +++ b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp @@ -236,7 +236,9 @@ QVariant GraphicsVertexShaderModel::data(const QModelIndex& index, int role) con switch (opcode.EffectiveOpCode()) { case OpCode::Id::LOOP: - output << "(unknown instruction format)"; + output << 'i' << instr.flow_control.int_uniform_id << " (end on 0x" + << std::setw(4) << std::right << std::setfill('0') << std::hex + << (4 * instr.flow_control.dest_offset) << ")"; break; default: -- cgit v1.2.3