panfrost: Don't upload empty push uniform table
authorAlyssa Rosenzweig <alyssa@collabora.com>
Wed, 12 May 2021 17:21:40 +0000 (13:21 -0400)
committerMarge Bot <eric+marge@anholt.net>
Wed, 12 May 2021 20:04:21 +0000 (20:04 +0000)
Instead zero out the pointer in this case.

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

src/gallium/drivers/panfrost/pan_cmdstream.c

index 0f9f0b2..5dcbfc1 100644 (file)
@@ -1205,6 +1205,11 @@ panfrost_emit_const_buf(struct panfrost_batch *batch,
                 }
         }
 
+        buf->dirty_mask = 0;
+
+        if (ss->info.push.count == 0)
+                return ubos.gpu;
+
         /* Copy push constants required by the shader */
         struct panfrost_ptr push_transfer =
                 panfrost_pool_alloc_aligned(&batch->pool,
@@ -1259,7 +1264,6 @@ panfrost_emit_const_buf(struct panfrost_batch *batch,
                 memcpy(push_cpu + i, (uint8_t *) mapped_ubo + src.offset, 4);
         }
 
-        buf->dirty_mask = 0;
         return ubos.gpu;
 }