VERY experimental Nintendo Switch 2 emulator
C++
vertex_shader: Implement MADI instruction.
bunneif935130a0f2d
diff --git a/externals/nihstro b/externals/nihstroindex 4a78588b30..81f1804a43 160000--- a/externals/nihstro+++ b/externals/nihstro@@ -1 +1 @@-Subproject commit 4a78588b308564f7ebae193e0ae00d9a0d5741d5+Subproject commit 81f1804a43f625e3a1a20752c0db70a413410380diff --git a/src/video_core/vertex_shader.cpp b/src/video_core/vertex_shader.cppindex 51f4e58bff..89d663a150 100644--- a/src/video_core/vertex_shader.cpp+++ b/src/video_core/vertex_shader.cpp@@ -366,12 +366,15 @@ static void ProcessShaderCode(VertexShaderState& state) {case OpCode::Type::MultiplyAdd:{- if (instr.opcode.Value().EffectiveOpCode() == OpCode::Id::MAD) {+ if ((instr.opcode.Value().EffectiveOpCode() == OpCode::Id::MAD) ||+ (instr.opcode.Value().EffectiveOpCode() == OpCode::Id::MADI)) {const SwizzlePattern& swizzle = *(SwizzlePattern*)&swizzle_data[instr.mad.operand_desc_id];- const float24* src1_ = LookupSourceRegister(instr.mad.src1);- const float24* src2_ = LookupSourceRegister(instr.mad.src2);- const float24* src3_ = LookupSourceRegister(instr.mad.src3);+ bool is_inverted = (instr.opcode.Value().EffectiveOpCode() == OpCode::Id::MADI);++ const float24* src1_ = LookupSourceRegister(instr.mad.GetSrc1(is_inverted));+ const float24* src2_ = LookupSourceRegister(instr.mad.GetSrc2(is_inverted));+ const float24* src3_ = LookupSourceRegister(instr.mad.GetSrc3(is_inverted));const bool negate_src1 = ((bool)swizzle.negate_src1 != false);const bool negate_src2 = ((bool)swizzle.negate_src2 != false);