panfrost: Ensure shader-db state is zero-initialized
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 24 Aug 2020 20:51:12 +0000 (16:51 -0400)
committerTomeu Vizoso <tomeu.vizoso@collabora.com>
Tue, 25 Aug 2020 15:05:37 +0000 (17:05 +0200)
Otherwise the next commit will invoke undefined behaviour.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6440>

src/gallium/drivers/panfrost/pan_context.c

index 2fbb19c7d257457269be40210fccb8cfaf50d848..55f4ea667a11873cfdf6aa06aaf908c11e24013c 100644 (file)
@@ -460,7 +460,7 @@ panfrost_create_shader_state(
         if (unlikely((dev->debug & PAN_DBG_PRECOMPILE) && cso->type == PIPE_SHADER_IR_NIR)) {
                 struct panfrost_context *ctx = pan_context(pctx);
 
-                struct panfrost_shader_state state;
+                struct panfrost_shader_state state = { 0 };
                 uint64_t outputs_written;
 
                 panfrost_shader_compile(ctx, PIPE_SHADER_IR_NIR,