summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bunnei2017-07-26 16:00:10 -0400
committerGravatar GitHub2017-07-26 16:00:10 -0400
commita724fb365787718f9e44adedc14e59d0854905a6 (patch)
tree0882b47c36facd60122e783735fefc0da57e1176
parentMerge pull request #2847 from B3n30/network_linux_fix (diff)
parentdebugger/shader: display LOOP (diff)
downloadyuzu-a724fb365787718f9e44adedc14e59d0854905a6.tar.gz
yuzu-a724fb365787718f9e44adedc14e59d0854905a6.tar.xz
yuzu-a724fb365787718f9e44adedc14e59d0854905a6.zip
Merge pull request #2837 from wwylele/shader-debugger-fix
Misc shader debugger fixes
-rw-r--r--src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp41
1 files changed, 18 insertions, 23 deletions
diff --git a/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp
index e3f3194db..7f4ec0c52 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
183 print_input(output, src1, swizzle.negate_src1, 183 print_input(output, src1, swizzle.negate_src1,
184 SelectorToString(swizzle.src1_selector)); 184 SelectorToString(swizzle.src1_selector));
185 AlignToColumn(kInputOperandColumnWidth); 185 AlignToColumn(kInputOperandColumnWidth);
186 if (src_is_inverted) { 186 print_input(output, src2, swizzle.negate_src2,
187 print_input(output, src2, swizzle.negate_src2, 187 SelectorToString(swizzle.src2_selector), true,
188 SelectorToString(swizzle.src2_selector)); 188 src_is_inverted ? "" : instr.mad.AddressRegisterName());
189 } else {
190 print_input(output, src2, swizzle.negate_src2,
191 SelectorToString(swizzle.src2_selector), true,
192 instr.mad.AddressRegisterName());
193 }
194 AlignToColumn(kInputOperandColumnWidth); 189 AlignToColumn(kInputOperandColumnWidth);
195 if (src_is_inverted) { 190 print_input(output, src3, swizzle.negate_src3,
196 print_input(output, src3, swizzle.negate_src3, 191 SelectorToString(swizzle.src3_selector), true,
197 SelectorToString(swizzle.src3_selector), true, 192 src_is_inverted ? instr.mad.AddressRegisterName() : "");
198 instr.mad.AddressRegisterName());
199 } else {
200 print_input(output, src3, swizzle.negate_src3,
201 SelectorToString(swizzle.src3_selector));
202 }
203 AlignToColumn(kInputOperandColumnWidth); 193 AlignToColumn(kInputOperandColumnWidth);
204 break; 194 break;
205 } 195 }
@@ -222,16 +212,15 @@ QVariant GraphicsVertexShaderModel::data(const QModelIndex& index, int role) con
222 SourceRegister src1 = instr.common.GetSrc1(src_is_inverted); 212 SourceRegister src1 = instr.common.GetSrc1(src_is_inverted);
223 print_input(output, src1, swizzle.negate_src1, 213 print_input(output, src1, swizzle.negate_src1,
224 swizzle.SelectorToString(false), true, 214 swizzle.SelectorToString(false), true,
225 instr.common.AddressRegisterName()); 215 src_is_inverted ? "" : instr.common.AddressRegisterName());
226 AlignToColumn(kInputOperandColumnWidth); 216 AlignToColumn(kInputOperandColumnWidth);
227 } 217 }
228 218
229 // TODO: In some cases, the Address Register is used as an index for SRC2
230 // instead of SRC1
231 if (opcode_info.subtype & OpCode::Info::Src2) { 219 if (opcode_info.subtype & OpCode::Info::Src2) {
232 SourceRegister src2 = instr.common.GetSrc2(src_is_inverted); 220 SourceRegister src2 = instr.common.GetSrc2(src_is_inverted);
233 print_input(output, src2, swizzle.negate_src2, 221 print_input(output, src2, swizzle.negate_src2,
234 swizzle.SelectorToString(true)); 222 swizzle.SelectorToString(true), true,
223 src_is_inverted ? instr.common.AddressRegisterName() : "");
235 AlignToColumn(kInputOperandColumnWidth); 224 AlignToColumn(kInputOperandColumnWidth);
236 } 225 }
237 break; 226 break;
@@ -247,7 +236,9 @@ QVariant GraphicsVertexShaderModel::data(const QModelIndex& index, int role) con
247 236
248 switch (opcode.EffectiveOpCode()) { 237 switch (opcode.EffectiveOpCode()) {
249 case OpCode::Id::LOOP: 238 case OpCode::Id::LOOP:
250 output << "(unknown instruction format)"; 239 output << 'i' << instr.flow_control.int_uniform_id << " (end on 0x"
240 << std::setw(4) << std::right << std::setfill('0') << std::hex
241 << (4 * instr.flow_control.dest_offset) << ")";
251 break; 242 break;
252 243
253 default: 244 default:
@@ -255,7 +246,7 @@ QVariant GraphicsVertexShaderModel::data(const QModelIndex& index, int role) con
255 output << '('; 246 output << '(';
256 247
257 if (instr.flow_control.op != instr.flow_control.JustY) { 248 if (instr.flow_control.op != instr.flow_control.JustY) {
258 if (instr.flow_control.refx) 249 if (!instr.flow_control.refx)
259 output << '!'; 250 output << '!';
260 output << "cc.x"; 251 output << "cc.x";
261 } 252 }
@@ -267,13 +258,17 @@ QVariant GraphicsVertexShaderModel::data(const QModelIndex& index, int role) con
267 } 258 }
268 259
269 if (instr.flow_control.op != instr.flow_control.JustX) { 260 if (instr.flow_control.op != instr.flow_control.JustX) {
270 if (instr.flow_control.refy) 261 if (!instr.flow_control.refy)
271 output << '!'; 262 output << '!';
272 output << "cc.y"; 263 output << "cc.y";
273 } 264 }
274 265
275 output << ") "; 266 output << ") ";
276 } else if (opcode_info.subtype & OpCode::Info::HasUniformIndex) { 267 } else if (opcode_info.subtype & OpCode::Info::HasUniformIndex) {
268 if (opcode.EffectiveOpCode() == OpCode::Id::JMPU &&
269 (instr.flow_control.num_instructions & 1) == 1) {
270 output << '!';
271 }
277 output << 'b' << instr.flow_control.bool_uniform_id << ' '; 272 output << 'b' << instr.flow_control.bool_uniform_id << ' ';
278 } 273 }
279 274