Module: Mesa
Branch: main
Commit: df3edfc72994d26a87008ddd322ffbc38c2343b2
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=df3edfc72994d26a87008ddd322ffbc38c2343b2

Author: Alyssa Rosenzweig <aly...@collabora.com>
Date:   Wed May 12 13:21:40 2021 -0400

panfrost: Don't upload empty push uniform table

Instead zero out the pointer in this case.

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

---

 src/gallium/drivers/panfrost/pan_cmdstream.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c 
b/src/gallium/drivers/panfrost/pan_cmdstream.c
index 0f9f0b2bc33..5dcbfc13f52 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -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;
 }
 

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to