diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/vertex_shader.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/video_core/vertex_shader.cpp b/src/video_core/vertex_shader.cpp index 345f3c3fe..de963f5e9 100644 --- a/src/video_core/vertex_shader.cpp +++ b/src/video_core/vertex_shader.cpp | |||
| @@ -118,9 +118,9 @@ static void ProcessShaderCode(VertexShaderState& state) { | |||
| 118 | const Instruction& instr = *(const Instruction*)state.program_counter; | 118 | const Instruction& instr = *(const Instruction*)state.program_counter; |
| 119 | const SwizzlePattern& swizzle = *(SwizzlePattern*)&swizzle_data[instr.common.operand_desc_id]; | 119 | const SwizzlePattern& swizzle = *(SwizzlePattern*)&swizzle_data[instr.common.operand_desc_id]; |
| 120 | 120 | ||
| 121 | auto call = [&](std::stack<VertexShaderState::CallStackElement>& stack, u32 offset, u32 num_instructions, u32 return_offset) { | 121 | auto call = [&](VertexShaderState& state, u32 offset, u32 num_instructions, u32 return_offset) { |
| 122 | state.program_counter = &shader_memory[offset] - 1; // -1 to make sure when incrementing the PC we end up at the correct offset | 122 | state.program_counter = &shader_memory[offset] - 1; // -1 to make sure when incrementing the PC we end up at the correct offset |
| 123 | stack.push({ offset + num_instructions, return_offset }); | 123 | state.call_stack.push({ offset + num_instructions, return_offset }); |
| 124 | }; | 124 | }; |
| 125 | u32 binary_offset = state.program_counter - shader_memory.data(); | 125 | u32 binary_offset = state.program_counter - shader_memory.data(); |
| 126 | 126 | ||
| @@ -356,7 +356,7 @@ static void ProcessShaderCode(VertexShaderState& state) { | |||
| 356 | break; | 356 | break; |
| 357 | 357 | ||
| 358 | case Instruction::OpCode::CALL: | 358 | case Instruction::OpCode::CALL: |
| 359 | call(state.call_stack, | 359 | call(state, |
| 360 | instr.flow_control.dest_offset, | 360 | instr.flow_control.dest_offset, |
| 361 | instr.flow_control.num_instructions, | 361 | instr.flow_control.num_instructions, |
| 362 | binary_offset + 1); | 362 | binary_offset + 1); |
| @@ -367,12 +367,12 @@ static void ProcessShaderCode(VertexShaderState& state) { | |||
| 367 | 367 | ||
| 368 | case Instruction::OpCode::IFU: | 368 | case Instruction::OpCode::IFU: |
| 369 | if (shader_uniforms.b[instr.flow_control.bool_uniform_id]) { | 369 | if (shader_uniforms.b[instr.flow_control.bool_uniform_id]) { |
| 370 | call(state.call_stack, | 370 | call(state, |
| 371 | binary_offset + 1, | 371 | binary_offset + 1, |
| 372 | instr.flow_control.dest_offset - binary_offset - 1, | 372 | instr.flow_control.dest_offset - binary_offset - 1, |
| 373 | instr.flow_control.dest_offset + instr.flow_control.num_instructions); | 373 | instr.flow_control.dest_offset + instr.flow_control.num_instructions); |
| 374 | } else { | 374 | } else { |
| 375 | call(state.call_stack, | 375 | call(state, |
| 376 | instr.flow_control.dest_offset, | 376 | instr.flow_control.dest_offset, |
| 377 | instr.flow_control.num_instructions, | 377 | instr.flow_control.num_instructions, |
| 378 | instr.flow_control.dest_offset + instr.flow_control.num_instructions); | 378 | instr.flow_control.dest_offset + instr.flow_control.num_instructions); |
| @@ -407,12 +407,12 @@ static void ProcessShaderCode(VertexShaderState& state) { | |||
| 407 | } | 407 | } |
| 408 | 408 | ||
| 409 | if (results[2]) { | 409 | if (results[2]) { |
| 410 | call(state.call_stack, | 410 | call(state, |
| 411 | binary_offset + 1, | 411 | binary_offset + 1, |
| 412 | instr.flow_control.dest_offset - binary_offset - 1, | 412 | instr.flow_control.dest_offset - binary_offset - 1, |
| 413 | instr.flow_control.dest_offset + instr.flow_control.num_instructions); | 413 | instr.flow_control.dest_offset + instr.flow_control.num_instructions); |
| 414 | } else { | 414 | } else { |
| 415 | call(state.call_stack, | 415 | call(state, |
| 416 | instr.flow_control.dest_offset, | 416 | instr.flow_control.dest_offset, |
| 417 | instr.flow_control.num_instructions, | 417 | instr.flow_control.num_instructions, |
| 418 | instr.flow_control.dest_offset + instr.flow_control.num_instructions); | 418 | instr.flow_control.dest_offset + instr.flow_control.num_instructions); |