diff options
| -rw-r--r-- | src/video_core/shader/shader_interpreter.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/video_core/shader/shader_interpreter.cpp b/src/video_core/shader/shader_interpreter.cpp index 295a2466b..2dc8d5d5e 100644 --- a/src/video_core/shader/shader_interpreter.cpp +++ b/src/video_core/shader/shader_interpreter.cpp | |||
| @@ -2,10 +2,10 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <common/file_util.h> | 5 | #include <numeric> |
| 6 | |||
| 7 | #include <nihstro/shader_bytecode.h> | 6 | #include <nihstro/shader_bytecode.h> |
| 8 | 7 | ||
| 8 | #include "common/file_util.h" | ||
| 9 | #include "video_core/pica.h" | 9 | #include "video_core/pica.h" |
| 10 | #include "video_core/pica_state.h" | 10 | #include "video_core/pica_state.h" |
| 11 | #include "video_core/shader/shader.h" | 11 | #include "video_core/shader/shader.h" |
| @@ -214,10 +214,8 @@ void RunInterpreter(UnitState<Debug>& state) { | |||
| 214 | if (opcode == OpCode::Id::DPH || opcode == OpCode::Id::DPHI) | 214 | if (opcode == OpCode::Id::DPH || opcode == OpCode::Id::DPHI) |
| 215 | src1[3] = float24::FromFloat32(1.0f); | 215 | src1[3] = float24::FromFloat32(1.0f); |
| 216 | 216 | ||
| 217 | float24 dot = float24::FromFloat32(0.f); | ||
| 218 | int num_components = (opcode == OpCode::Id::DP3) ? 3 : 4; | 217 | int num_components = (opcode == OpCode::Id::DP3) ? 3 : 4; |
| 219 | for (int i = 0; i < num_components; ++i) | 218 | float24 dot = std::inner_product(src1, src1 + num_components, src2, float24::FromFloat32(0.f)); |
| 220 | dot = dot + src1[i] * src2[i]; | ||
| 221 | 219 | ||
| 222 | for (int i = 0; i < 4; ++i) { | 220 | for (int i = 0; i < 4; ++i) { |
| 223 | if (!swizzle.DestComponentEnabled(i)) | 221 | if (!swizzle.DestComponentEnabled(i)) |