panfrost: Initialize shift/extra_flags
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 11 Jul 2019 22:46:22 +0000 (15:46 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 12 Jul 2019 14:38:37 +0000 (07:38 -0700)
Don't rely on them being preinitialized to zero; this can cause junk to
appear on the wire.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/pan_context.c
src/gallium/drivers/panfrost/pan_instancing.c

index cc3a00902e611cc15b7146695c442a8c2589f25e..f9b11b691dae596ef9b219d2a28ff095594f24fd 100644 (file)
@@ -530,6 +530,7 @@ panfrost_emit_varyings(
         slot->elements = varying_address | MALI_ATTR_LINEAR;
         slot->stride = stride;
         slot->size = stride * count;
+        slot->shift = slot->extra_flags = 0;
 
         ctx->varying_height += ALIGN_POT(slot->size, 64);
         assert(ctx->varying_height < ctx->varying_mem.bo->size);
@@ -541,7 +542,7 @@ static void
 panfrost_emit_point_coord(union mali_attr *slot)
 {
         slot->elements = MALI_VARYING_POINT_COORD | MALI_ATTR_LINEAR;
-        slot->stride = slot->size = 0;
+        slot->stride = slot->size = slot->shift = slot->extra_flags = 0;
 }
 
 static void
index a4d5b8823aca5c899ad5b2898b478964883c1da2..e74cc4365cbfae6e70ae62e8d2ae0963e8e5890a 100644 (file)
@@ -308,6 +308,9 @@ panfrost_emit_vertex_data(struct panfrost_job *batch)
                  * correctness) so the data doesn't get clamped away */
                 attrs[k].size += chopped_addr;
 
+                /* For non-instancing make sure we initialize */
+                attrs[k].shift = attrs[k].extra_flags = 0;
+
                 /* Instancing uses a dramatically different code path than
                  * linear, so dispatch for the actual emission now that the
                  * common code is finished */