Преглед изворни кода

Pica/VertexShader: Fix a bug in the call stack handling.

Tony Wasserka пре 12 година
родитељ
комит
697b50c3ff
1 измењених фајлова са 3 додато и 2 уклоњено
  1. 3 2
      src/video_core/vertex_shader.cpp

+ 3 - 2
src/video_core/vertex_shader.cpp

@@ -191,8 +191,9 @@ static void ProcessShaderCode(VertexShaderState& state) {
                 if (*state.call_stack_pointer == VertexShaderState::INVALID_ADDRESS) {
                     exit_loop = true;
                 } else {
-                    state.program_counter = &shader_memory[*state.call_stack_pointer--];
-                    *state.call_stack_pointer = VertexShaderState::INVALID_ADDRESS;
+                    // Jump back to call stack position, invalidate call stack entry, move up call stack pointer
+                    state.program_counter = &shader_memory[*state.call_stack_pointer];
+                    *state.call_stack_pointer-- = VertexShaderState::INVALID_ADDRESS;
                 }
 
                 break;