summaryrefslogtreecommitdiff
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorTimothy Arceri <tarceri@itsqueeze.com>2022-05-24 14:35:19 +1000
committerMarge Bot <emma+marge@anholt.net>2022-05-24 09:48:36 +0000
commit0a19ae1e98c2f842e5b9f01d13421cdfb6294b1c (patch)
tree96fe9e909a3cd10ce4f41550e8bc34f252019de9 /src/gallium/drivers
parentb2e9e0f2f7dadb2c5c461b3ef8f391f4d5da325b (diff)
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>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c b/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c
index bd6ef14ba40..7f50fbeae4f 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_compiler_nir.c
@@ -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);