etnaviv: assert if etna_shader_io_file reg overrun

This code depends on optimisations eliminating all but a single write
to outputs. assert if we are about to overrun the array i.e an
output was possibly written to twice.

See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6536

Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16683>
This commit is contained in:
Timothy Arceri
2022-05-24 14:35:19 +10:00
committed by Marge Bot
parent b2e9e0f2f7
commit 0a19ae1e98

View File

@@ -123,6 +123,7 @@ etna_emit_output(struct etna_compile *c, nir_variable *var, struct etna_inst_src
c->variant->vs_pointsize_out_reg = src.reg;
break;
default:
assert(sf->num_reg < ETNA_NUM_INPUTS);
sf->reg[sf->num_reg].reg = src.reg;
sf->reg[sf->num_reg].slot = var->data.location;
sf->reg[sf->num_reg].num_components = glsl_get_components(var->type);