diff options
| -rw-r--r-- | src/citra_qt/debugger/graphics_vertex_shader.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/citra_qt/debugger/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics_vertex_shader.cpp index ce81e7fae..e0a78f657 100644 --- a/src/citra_qt/debugger/graphics_vertex_shader.cpp +++ b/src/citra_qt/debugger/graphics_vertex_shader.cpp | |||
| @@ -65,6 +65,15 @@ QVariant GraphicsVertexShaderModel::headerData(int section, Qt::Orientation orie | |||
| 65 | return QVariant(); | 65 | return QVariant(); |
| 66 | } | 66 | } |
| 67 | 67 | ||
| 68 | static std::string SelectorToString(u32 selector) { | ||
| 69 | std::string ret; | ||
| 70 | for (int i = 0; i < 4; ++i) { | ||
| 71 | int component = (selector >> ((3 - i) * 2)) & 3; | ||
| 72 | ret += "xyzw"[component]; | ||
| 73 | } | ||
| 74 | return ret; | ||
| 75 | } | ||
| 76 | |||
| 68 | // e.g. "-c92[a0.x].xyzw" | 77 | // e.g. "-c92[a0.x].xyzw" |
| 69 | static void print_input(std::ostringstream& output, const SourceRegister& input, | 78 | static void print_input(std::ostringstream& output, const SourceRegister& input, |
| 70 | bool negate, const std::string& swizzle_mask, bool align = true, | 79 | bool negate, const std::string& swizzle_mask, bool align = true, |
| @@ -133,6 +142,7 @@ QVariant GraphicsVertexShaderModel::data(const QModelIndex& index, int role) con | |||
| 133 | break; | 142 | break; |
| 134 | 143 | ||
| 135 | case OpCode::Type::Arithmetic: | 144 | case OpCode::Type::Arithmetic: |
| 145 | case OpCode::Type::MultiplyAdd: | ||
| 136 | { | 146 | { |
| 137 | // Use custom code for special instructions | 147 | // Use custom code for special instructions |
| 138 | switch (opcode.EffectiveOpCode()) { | 148 | switch (opcode.EffectiveOpCode()) { |
| @@ -161,6 +171,27 @@ QVariant GraphicsVertexShaderModel::data(const QModelIndex& index, int role) con | |||
| 161 | break; | 171 | break; |
| 162 | } | 172 | } |
| 163 | 173 | ||
| 174 | case OpCode::Id::MAD: | ||
| 175 | case OpCode::Id::MADI: | ||
| 176 | { | ||
| 177 | AlignToColumn(kOpcodeColumnWidth); | ||
| 178 | |||
| 179 | bool src_is_inverted = 0 != (opcode_info.subtype & OpCode::Info::SrcInversed); | ||
| 180 | SourceRegister src1 = instr.mad.GetSrc1(src_is_inverted); | ||
| 181 | SourceRegister src2 = instr.mad.GetSrc2(src_is_inverted); | ||
| 182 | SourceRegister src3 = instr.mad.GetSrc3(src_is_inverted); | ||
| 183 | |||
| 184 | output << std::setw(3) << std::right << instr.mad.dest.Value().GetName() << '.' << swizzle.DestMaskToString(); | ||
| 185 | AlignToColumn(kOutputColumnWidth); | ||
| 186 | print_input(output, src1, swizzle.negate_src1, SelectorToString(swizzle.src1_selector)); | ||
| 187 | AlignToColumn(kInputOperandColumnWidth); | ||
| 188 | print_input(output, src2, swizzle.negate_src2, SelectorToString(swizzle.src2_selector)); | ||
| 189 | AlignToColumn(kInputOperandColumnWidth); | ||
| 190 | print_input(output, src3, swizzle.negate_src3, SelectorToString(swizzle.src3_selector)); | ||
| 191 | AlignToColumn(kInputOperandColumnWidth); | ||
| 192 | break; | ||
| 193 | } | ||
| 194 | |||
| 164 | default: | 195 | default: |
| 165 | { | 196 | { |
| 166 | AlignToColumn(kOpcodeColumnWidth); | 197 | AlignToColumn(kOpcodeColumnWidth); |