diff options
| author | 2015-08-21 10:51:41 +0200 | |
|---|---|---|
| committer | 2015-08-22 11:09:53 +0200 | |
| commit | 2e7cf2f6cf5fd1caf574b9799553f67710395047 (patch) | |
| tree | 34d47406941eef58593e3227f7c0555002853188 /src | |
| parent | Merge pull request #1056 from lioncash/emitter (diff) | |
| download | yuzu-2e7cf2f6cf5fd1caf574b9799553f67710395047.tar.gz yuzu-2e7cf2f6cf5fd1caf574b9799553f67710395047.tar.xz yuzu-2e7cf2f6cf5fd1caf574b9799553f67710395047.zip | |
Shader: implement DPH/DPHI in interpreter
Tests revealed that the component with w=1 is
SRC1 and not SRC2, it is now fixed on 3dbrew.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/shader/shader_interpreter.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/video_core/shader/shader_interpreter.cpp b/src/video_core/shader/shader_interpreter.cpp index 063cc38f0..6b83d2c1c 100644 --- a/src/video_core/shader/shader_interpreter.cpp +++ b/src/video_core/shader/shader_interpreter.cpp | |||
| @@ -197,12 +197,19 @@ void RunInterpreter(UnitState<Debug>& state) { | |||
| 197 | 197 | ||
| 198 | case OpCode::Id::DP3: | 198 | case OpCode::Id::DP3: |
| 199 | case OpCode::Id::DP4: | 199 | case OpCode::Id::DP4: |
| 200 | case OpCode::Id::DPH: | ||
| 201 | case OpCode::Id::DPHI: | ||
| 200 | { | 202 | { |
| 201 | Record<DebugDataRecord::SRC1>(state.debug, iteration, src1); | 203 | Record<DebugDataRecord::SRC1>(state.debug, iteration, src1); |
| 202 | Record<DebugDataRecord::SRC2>(state.debug, iteration, src2); | 204 | Record<DebugDataRecord::SRC2>(state.debug, iteration, src2); |
| 203 | Record<DebugDataRecord::DEST_IN>(state.debug, iteration, dest); | 205 | Record<DebugDataRecord::DEST_IN>(state.debug, iteration, dest); |
| 206 | |||
| 207 | OpCode::Id opcode = instr.opcode.Value().EffectiveOpCode(); | ||
| 208 | if (opcode == OpCode::Id::DPH || opcode == OpCode::Id::DPHI) | ||
| 209 | src1[3] = float24::FromFloat32(1.0f); | ||
| 210 | |||
| 204 | float24 dot = float24::FromFloat32(0.f); | 211 | float24 dot = float24::FromFloat32(0.f); |
| 205 | int num_components = (instr.opcode.Value() == OpCode::Id::DP3) ? 3 : 4; | 212 | int num_components = (opcode == OpCode::Id::DP3) ? 3 : 4; |
| 206 | for (int i = 0; i < num_components; ++i) | 213 | for (int i = 0; i < num_components; ++i) |
| 207 | dot = dot + src1[i] * src2[i]; | 214 | dot = dot + src1[i] * src2[i]; |
| 208 | 215 | ||