diff --git a/.pick_status.json b/.pick_status.json index af5ae35b5a1..b39c3613f57 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -4180,7 +4180,7 @@ "description": "st/mesa: Treat vertex outputs absent in outputMapping as zero in mesa_to_tgsi", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "d684fb37bfbc47d098158cb03c0672119a4469fe" }, diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index 6fe8f851757..dca9acb3f31 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -97,9 +97,12 @@ dst_register(struct st_translate *t, gl_register_file file, GLuint index) else assert(index < VARYING_SLOT_MAX); - assert(t->outputMapping[index] < ARRAY_SIZE(t->outputs)); - - return t->outputs[t->outputMapping[index]]; + if (t->outputMapping[index] < ARRAY_SIZE(t->outputs)) + return t->outputs[t->outputMapping[index]]; + else { + assert(t->procType == PIPE_SHADER_VERTEX); + return ureg_dst(ureg_DECL_constant(t->ureg, 0)); + } case PROGRAM_ADDRESS: return t->address[index]; @@ -149,8 +152,12 @@ src_register(struct st_translate *t, } case PROGRAM_OUTPUT: - assert(t->outputMapping[index] < ARRAY_SIZE(t->outputs)); - return ureg_src(t->outputs[t->outputMapping[index]]); /* not needed? */ + if (t->outputMapping[index] < ARRAY_SIZE(t->outputs)) + return ureg_src(t->outputs[t->outputMapping[index]]); + else { + assert(t->procType == PIPE_SHADER_VERTEX); + return ureg_DECL_constant(t->ureg, 0); + } case PROGRAM_ADDRESS: return ureg_src(t->address[index]);