panfrost: Size UBO#0 accurately
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 19 Aug 2020 13:48:40 +0000 (09:48 -0400)
committerTomeu Vizoso <tomeu.vizoso@collabora.com>
Tue, 25 Aug 2020 15:05:34 +0000 (17:05 +0200)
We explicitly calculated its size as (sysvals + uniforms). We don't need
to check the shader metadata for that.

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_cmdstream.c

index 1118138359654d2f6ea715d9aaf360f2533d5d1d..7e5772f8ca3a6e5b509728a94f5469d3295723a7 100644 (file)
@@ -1118,9 +1118,9 @@ panfrost_emit_const_buf(struct panfrost_batch *batch,
 
         /* Upload uniforms as a UBO */
 
-        if (ss->uniform_count) {
+        if (size) {
                 pan_pack(ubo_ptr, UNIFORM_BUFFER, cfg) {
-                        cfg.entries = ss->uniform_count;
+                        cfg.entries = DIV_ROUND_UP(size, 16);
                         cfg.pointer = transfer.gpu;
                 }
         } else {