summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/video_core/vertex_shader.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/video_core/vertex_shader.cpp b/src/video_core/vertex_shader.cpp
index 5ca30ba53..345f3c3fe 100644
--- a/src/video_core/vertex_shader.cpp
+++ b/src/video_core/vertex_shader.cpp
@@ -99,6 +99,10 @@ struct VertexShaderState {
99}; 99};
100 100
101static void ProcessShaderCode(VertexShaderState& state) { 101static void ProcessShaderCode(VertexShaderState& state) {
102
103 // Placeholder for invalid inputs
104 static float24 dummy_vec4_float24[4];
105
102 while (true) { 106 while (true) {
103 if (!state.call_stack.empty()) { 107 if (!state.call_stack.empty()) {
104 if (state.program_counter - shader_memory.data() == state.call_stack.top().final_address) { 108 if (state.program_counter - shader_memory.data() == state.call_stack.top().final_address) {
@@ -132,6 +136,9 @@ static void ProcessShaderCode(VertexShaderState& state) {
132 136
133 case RegisterType::FloatUniform: 137 case RegisterType::FloatUniform:
134 return &shader_uniforms.f[source_reg.GetIndex()].x; 138 return &shader_uniforms.f[source_reg.GetIndex()].x;
139
140 default:
141 return dummy_vec4_float24;
135 } 142 }
136 }; 143 };
137 144
@@ -182,9 +189,9 @@ static void ProcessShaderCode(VertexShaderState& state) {
182 } 189 }
183 190
184 float24* dest = (instr.common.dest < 0x08) ? state.output_register_table[4*instr.common.dest.GetIndex()] 191 float24* dest = (instr.common.dest < 0x08) ? state.output_register_table[4*instr.common.dest.GetIndex()]
185 : (instr.common.dest < 0x10) ? nullptr 192 : (instr.common.dest < 0x10) ? dummy_vec4_float24
186 : (instr.common.dest < 0x20) ? &state.temporary_registers[instr.common.dest.GetIndex()][0] 193 : (instr.common.dest < 0x20) ? &state.temporary_registers[instr.common.dest.GetIndex()][0]
187 : nullptr; 194 : dummy_vec4_float24;
188 195
189 state.debug.max_opdesc_id = std::max<u32>(state.debug.max_opdesc_id, 1+instr.common.operand_desc_id); 196 state.debug.max_opdesc_id = std::max<u32>(state.debug.max_opdesc_id, 1+instr.common.operand_desc_id);
190 197