From a58e8a3c9752fa00400384128b14dacf90f135fc Mon Sep 17 00:00:00 2001 From: wheremyfoodat Date: Thu, 8 Dec 2022 00:28:38 +0200 Subject: [PATCH] [PICA] Add idx to DP3/DP4 --- src/core/PICA/shader_interpreter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/PICA/shader_interpreter.cpp b/src/core/PICA/shader_interpreter.cpp index ec656937..a265ffc5 100644 --- a/src/core/PICA/shader_interpreter.cpp +++ b/src/core/PICA/shader_interpreter.cpp @@ -250,12 +250,12 @@ void PICAShader::mova(u32 instruction) { void PICAShader::dp3(u32 instruction) { const u32 operandDescriptor = operandDescriptors[instruction & 0x7f]; - const u32 src1 = (instruction >> 12) & 0x7f; + u32 src1 = (instruction >> 12) & 0x7f; const u32 src2 = (instruction >> 7) & 0x1f; // src2 coming first because PICA moment const u32 idx = (instruction >> 19) & 3; const u32 dest = (instruction >> 21) & 0x1f; - if (idx) Helpers::panic("[PICA] DP3: idx != 0"); + src1 = getIndexedSource(src1, idx); vec4f srcVec1 = getSourceSwizzled<1>(src1, operandDescriptor); vec4f srcVec2 = getSourceSwizzled<2>(src2, operandDescriptor); @@ -272,12 +272,12 @@ void PICAShader::dp3(u32 instruction) { void PICAShader::dp4(u32 instruction) { const u32 operandDescriptor = operandDescriptors[instruction & 0x7f]; - const u32 src1 = (instruction >> 12) & 0x7f; + u32 src1 = (instruction >> 12) & 0x7f; const u32 src2 = (instruction >> 7) & 0x1f; // src2 coming first because PICA moment const u32 idx = (instruction >> 19) & 3; const u32 dest = (instruction >> 21) & 0x1f; - if (idx) Helpers::panic("[PICA] DP4: idx != 0"); + src1 = getIndexedSource(src1, idx); vec4f srcVec1 = getSourceSwizzled<1>(src1, operandDescriptor); vec4f srcVec2 = getSourceSwizzled<2>(src2, operandDescriptor);