panfrost: Ensure compute shader_meta is zeroed
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 4 Feb 2020 19:24:44 +0000 (14:24 -0500)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Sun, 16 Feb 2020 14:16:46 +0000 (09:16 -0500)
In theory the hardware doesn't care but it'll make for easier traces.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3835>

src/gallium/drivers/panfrost/pan_compute.c

index 9e3306b673f190069681193f4fecf69b6618538c..56bac7a85231e4cd08664948d4d06de5aa6f7b84 100644 (file)
@@ -52,7 +52,8 @@ panfrost_create_compute_state(
         so->variant_count = 1;
         so->active_variant = 0;
 
-        v->tripipe = malloc(sizeof(struct mali_shader_meta));
+        /* calloc, instead of malloc - to zero unused fields */
+        v->tripipe = CALLOC_STRUCT(mali_shader_meta);
 
         if (cso->ir_type == PIPE_SHADER_IR_NIR_SERIALIZED) {
                 struct blob_reader reader;