summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/etnaviv
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2017-07-23 13:24:39 +0200
committerChristian Gmeiner <[email protected]>2017-07-23 21:52:44 +0200
commit15a1ceb127b70ac98b03cae051927f75fb7ee204 (patch)
treef07e6f65a837dae914a1ef60974e157c7aea41a5 /src/gallium/drivers/etnaviv
parent6874b953f6f9762fd8e7abf959aed09ab15693c5 (diff)
etnaviv: Clear lbl_usage array correctly
Fill the entire array instead of just a quarter. This avoids crashes with large shaders. (currently this never causes a problem because shaders larger than 2048/4 instructions are not supported by this driver on any hardware, but it will cause problems in the future) Fixes: ec436051899 ("etnaviv: fix shader miscompilation with more than 16 labels") Cc: [email protected] Signed-off-by: Wladimir J. van der Laan <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
Diffstat (limited to 'src/gallium/drivers/etnaviv')
-rw-r--r--src/gallium/drivers/etnaviv/etnaviv_compiler.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_compiler.c b/src/gallium/drivers/etnaviv/etnaviv_compiler.c
index cc6bfc9425d..165ab74298a 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_compiler.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_compiler.c
@@ -2353,7 +2353,7 @@ etna_compile_shader(struct etna_shader_variant *v)
if (!c)
return false;
- memset(&c->lbl_usage, -1, ARRAY_SIZE(c->lbl_usage));
+ memset(&c->lbl_usage, -1, sizeof(c->lbl_usage));
const struct tgsi_token *tokens = v->shader->tokens;