diff options
| author | 2016-01-26 09:58:16 -0500 | |
|---|---|---|
| committer | 2016-01-26 09:58:16 -0500 | |
| commit | c407b6ce2fbd6f438e5258bc14dc3def1a8c33e5 (patch) | |
| tree | 8df2098c831d561bad520b08727b1af0958cc605 /src | |
| parent | Merge pull request #1370 from yuriks/gpureg-names (diff) | |
| parent | Shader: Implement "invert condition" feature of IFU instruction (diff) | |
| download | yuzu-c407b6ce2fbd6f438e5258bc14dc3def1a8c33e5.tar.gz yuzu-c407b6ce2fbd6f438e5258bc14dc3def1a8c33e5.tar.xz yuzu-c407b6ce2fbd6f438e5258bc14dc3def1a8c33e5.zip | |
Merge pull request #1369 from yuriks/jmpu-inverted
Shader: Implement "invert condition" feature of IFU instruction
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/shader/shader_interpreter.cpp | 3 | ||||
| -rw-r--r-- | src/video_core/shader/shader_jit_x64.cpp | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/video_core/shader/shader_interpreter.cpp b/src/video_core/shader/shader_interpreter.cpp index 7b0c20b74..aeced71b0 100644 --- a/src/video_core/shader/shader_interpreter.cpp +++ b/src/video_core/shader/shader_interpreter.cpp | |||
| @@ -515,7 +515,8 @@ void RunInterpreter(UnitState<Debug>& state) { | |||
| 515 | 515 | ||
| 516 | case OpCode::Id::JMPU: | 516 | case OpCode::Id::JMPU: |
| 517 | Record<DebugDataRecord::COND_BOOL_IN>(state.debug, iteration, uniforms.b[instr.flow_control.bool_uniform_id]); | 517 | Record<DebugDataRecord::COND_BOOL_IN>(state.debug, iteration, uniforms.b[instr.flow_control.bool_uniform_id]); |
| 518 | if (uniforms.b[instr.flow_control.bool_uniform_id]) { | 518 | |
| 519 | if (uniforms.b[instr.flow_control.bool_uniform_id] == !(instr.flow_control.num_instructions & 1)) { | ||
| 519 | state.program_counter = instr.flow_control.dest_offset - 1; | 520 | state.program_counter = instr.flow_control.dest_offset - 1; |
| 520 | } | 521 | } |
| 521 | break; | 522 | break; |
diff --git a/src/video_core/shader/shader_jit_x64.cpp b/src/video_core/shader/shader_jit_x64.cpp index 00415e402..6554830b2 100644 --- a/src/video_core/shader/shader_jit_x64.cpp +++ b/src/video_core/shader/shader_jit_x64.cpp | |||
| @@ -710,7 +710,9 @@ void JitCompiler::Compile_JMP(Instruction instr) { | |||
| 710 | else | 710 | else |
| 711 | UNREACHABLE(); | 711 | UNREACHABLE(); |
| 712 | 712 | ||
| 713 | FixupBranch b = J_CC(CC_NZ, true); | 713 | bool inverted_condition = (instr.opcode.Value() == OpCode::Id::JMPU) && |
| 714 | (instr.flow_control.num_instructions & 1); | ||
| 715 | FixupBranch b = J_CC(inverted_condition ? CC_Z : CC_NZ, true); | ||
| 714 | 716 | ||
| 715 | Compile_Block(instr.flow_control.dest_offset); | 717 | Compile_Block(instr.flow_control.dest_offset); |
| 716 | 718 | ||