freedreno: Fix helgrind complaint on shader-db key setup.
authorEric Anholt <eric@anholt.net>
Thu, 25 Jul 2019 19:58:59 +0000 (12:58 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 29 Jul 2019 19:50:49 +0000 (12:50 -0700)
If the variable's going to be static, we shouldn't be memsetting it
from every thread and instead just have it in the data section.

Reviewed-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/ir3/ir3_gallium.c

index b94909bed1648fd6bdc2a63fa55d800f3dc8f0da..48562965dc2a59e8a6ee41471ee616ac85154791 100644 (file)
@@ -135,8 +135,7 @@ ir3_shader_create(struct ir3_compiler *compiler,
                 * (as otherwise nothing will trigger the shader to be
                 * actually compiled)
                 */
-               static struct ir3_shader_key key;
-               memset(&key, 0, sizeof(key));
+               static struct ir3_shader_key key; /* static is implicitly zeroed */
                ir3_shader_variant(shader, key, false, debug);
 
                if (nir->info.stage != MESA_SHADER_FRAGMENT)