diff options
author | Wladimir J. van der Laan <[email protected]> | 2017-07-23 13:24:39 +0200 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2017-08-03 00:19:06 +0100 |
commit | 4a6822864b804c13e1f89724eaa1f81283b1778a (patch) | |
tree | b4a02fb636f6ea5343a7aae931d8a57bcffe8cd6 | |
parent | e96b03037ca455446fd7b5797c4e594ef38dbeb5 (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]>
(cherry picked from commit 15a1ceb127b70ac98b03cae051927f75fb7ee204)
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_compiler.c | 2 |
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 af0f76b5864..a5d51122a37 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_compiler.c +++ b/src/gallium/drivers/etnaviv/etnaviv_compiler.c @@ -2302,7 +2302,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; |