summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTony Wasserka <NeoBrainX@gmail.com>2014-12-19 19:58:21 +0100
committerTony Wasserka <NeoBrainX@gmail.com>2014-12-20 18:06:56 +0100
commita664574ecbddb643dd12fb9815f4c4526f59f9ff (patch)
treea3dd5bdb766a4af38f96ea06fbe845150e617561 /src
parentPica/VertexShader: Clarify a comment. (diff)
downloadyuzu-a664574ecbddb643dd12fb9815f4c4526f59f9ff.tar
yuzu-a664574ecbddb643dd12fb9815f4c4526f59f9ff.tar.gz
yuzu-a664574ecbddb643dd12fb9815f4c4526f59f9ff.tar.bz2
yuzu-a664574ecbddb643dd12fb9815f4c4526f59f9ff.tar.lz
yuzu-a664574ecbddb643dd12fb9815f4c4526f59f9ff.tar.xz
yuzu-a664574ecbddb643dd12fb9815f4c4526f59f9ff.tar.zst
yuzu-a664574ecbddb643dd12fb9815f4c4526f59f9ff.zip
Diffstat (limited to 'src')
-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 {
};
static void ProcessShaderCode(VertexShaderState& state) {
+
+ // Placeholder for invalid inputs
+ static float24 dummy_vec4_float24[4];
+
while (true) {
if (!state.call_stack.empty()) {
if (state.program_counter - shader_memory.data() == state.call_stack.top().final_address) {
@@ -132,6 +136,9 @@ static void ProcessShaderCode(VertexShaderState& state) {
case RegisterType::FloatUniform:
return &shader_uniforms.f[source_reg.GetIndex()].x;
+
+ default:
+ return dummy_vec4_float24;
}
};
@@ -182,9 +189,9 @@ static void ProcessShaderCode(VertexShaderState& state) {
}
float24* dest = (instr.common.dest < 0x08) ? state.output_register_table[4*instr.common.dest.GetIndex()]
- : (instr.common.dest < 0x10) ? nullptr
+ : (instr.common.dest < 0x10) ? dummy_vec4_float24
: (instr.common.dest < 0x20) ? &state.temporary_registers[instr.common.dest.GetIndex()][0]
- : nullptr;
+ : dummy_vec4_float24;
state.debug.max_opdesc_id = std::max<u32>(state.debug.max_opdesc_id, 1+instr.common.operand_desc_id);