panfrost: Size UBO#0 accurately
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>
diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c
index 1118138..7e5772f 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -1118,9 +1118,9 @@
/* 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 {