summaryrefslogtreecommitdiffstats
path: root/src/citra_qt/debugger/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'src/citra_qt/debugger/graphics')
-rw-r--r--src/citra_qt/debugger/graphics/graphics_cmdlists.cpp4
-rw-r--r--src/citra_qt/debugger/graphics/graphics_surface.cpp3
-rw-r--r--src/citra_qt/debugger/graphics/graphics_vertex_shader.cpp41
3 files changed, 22 insertions, 26 deletions
diff --git a/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp b/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp
index 7d06ec28a..ce2b9fa50 100644
--- a/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp
+++ b/src/citra_qt/debugger/graphics/graphics_cmdlists.cpp
@@ -26,8 +26,8 @@
namespace {
QImage LoadTexture(const u8* src, const Pica::Texture::TextureInfo& info) {
QImage decoded_image(info.width, info.height, QImage::Format_ARGB32);
- for (int y = 0; y < info.height; ++y) {
- for (int x = 0; x < info.width; ++x) {
+ for (u32 y = 0; y < info.height; ++y) {
+ for (u32 x = 0; x < info.width; ++x) {
Math::Vec4<u8> color = Pica::Texture::LookupTexture(src, x, y, info, true);
decoded_image.setPixel(x, y, qRgba(color.r(), color.g(), color.b(), color.a()));
}
diff --git a/src/citra_qt/debugger/graphics/graphics_surface.cpp b/src/citra_qt/debugger/graphics/graphics_surface.cpp
index 47d9924e1..c974545ef 100644
--- a/src/citra_qt/debugger/graphics/graphics_surface.cpp
+++ b/src/citra_qt/debugger/graphics/graphics_surface.cpp
@@ -273,7 +273,8 @@ void GraphicsSurfaceWidget::Pick(int x, int y) {
surface_picker_x_control->setValue(x);
surface_picker_y_control->setValue(y);
- if (x < 0 || x >= surface_width || y < 0 || y >= surface_height) {
+ if (x < 0 || x >= static_cast<int>(surface_width) || y < 0 ||
+ y >= static_cast<int>(surface_height)) {
surface_info_label->setText(tr("Pixel out of bounds"));
surface_info_label->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
return;
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
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;
@@ -247,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:
@@ -255,7 +246,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,13 +258,17 @@ 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";
}
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 << ' ';
}