diff --git a/rpcs3/Emu/RSX/Common/ShaderParam.h b/rpcs3/Emu/RSX/Common/ShaderParam.h index 2437a4377c..ae30e4bf69 100644 --- a/rpcs3/Emu/RSX/Common/ShaderParam.h +++ b/rpcs3/Emu/RSX/Common/ShaderParam.h @@ -7,6 +7,7 @@ enum class FUNCTION { FUNCTION_DP2A, FUNCTION_DP3, FUNCTION_DP4, + FUNCTION_DPH, FUNCTION_SFL, // Set zero FUNCTION_STR, // Set One FUNCTION_FRACT, diff --git a/rpcs3/Emu/RSX/Common/VertexProgramDecompiler.cpp b/rpcs3/Emu/RSX/Common/VertexProgramDecompiler.cpp index 6df8cf9d42..2c5b8088c3 100644 --- a/rpcs3/Emu/RSX/Common/VertexProgramDecompiler.cpp +++ b/rpcs3/Emu/RSX/Common/VertexProgramDecompiler.cpp @@ -654,7 +654,7 @@ std::string VertexProgramDecompiler::Decompile() case RSX_VEC_OPCODE_ADD: SetDSTVec("($0 + $2)"); break; case RSX_VEC_OPCODE_MAD: SetDSTVec("($0 * $1 + $2)"); break; case RSX_VEC_OPCODE_DP3: SetDSTVec(getFunction(FUNCTION::FUNCTION_DP3)); break; - case RSX_VEC_OPCODE_DPH: SetDSTVec("dot(float4($0.xyz, 1.0), $1).xxxx"); break; + case RSX_VEC_OPCODE_DPH: SetDSTVec(getFunction(FUNCTION::FUNCTION_DPH)); break; case RSX_VEC_OPCODE_DP4: SetDSTVec(getFunction(FUNCTION::FUNCTION_DP4)); break; case RSX_VEC_OPCODE_DST: SetDSTVec("vec4(distance($0, $1))"); break; case RSX_VEC_OPCODE_MIN: SetDSTVec("min($0, $1)"); break; diff --git a/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp b/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp index 32475e2600..080bcf4403 100644 --- a/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp +++ b/rpcs3/Emu/RSX/GL/GLVertexProgram.cpp @@ -35,6 +35,8 @@ std::string GLVertexDecompilerThread::getFunction(FUNCTION f) return "vec4(dot($0.xyz, $1.xyz))"; case FUNCTION::FUNCTION_DP4: return "vec4(dot($0, $1))"; + case FUNCTION::FUNCTION_DPH: + return "vec4(dot(vec4($0.xyz, 1.0), $1))"; case FUNCTION::FUNCTION_SFL: return "vec4(0., 0., 0., 0.)"; case FUNCTION::FUNCTION_STR: