aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/video_core/vertex_shader.cpp
diff options
context:
space:
mode:
authorGravatar Tony Wasserka <NeoBrainX@gmail.com>2014-08-23 14:14:34 +0200
committerGravatar Tony Wasserka <NeoBrainX@gmail.com>2014-08-25 22:03:19 +0200
commit697b50c3ff1b0d179c5862efa56cb19fa640824c (patch)
tree5fc892f9e922daae01366120874bfb8faf754574 /src/video_core/vertex_shader.cpp
parentb5b3aeb57699e531bdc0b8be156aa6476ea4f15d (diff)
Pica/VertexShader: Fix a bug in the call stack handling.
Diffstat (limited to 'src/video_core/vertex_shader.cpp')
-rw-r--r--src/video_core/vertex_shader.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/video_core/vertex_shader.cpp b/src/video_core/vertex_shader.cpp
index cdecbff3..db824431 100644
--- a/src/video_core/vertex_shader.cpp
+++ b/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;