Mesa (main): zink: use array size in spirv bo length calculations

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jul 26 21:10:34 UTC 2021


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Mon Jul 26 13:11:18 2021 -0400

zink: use array size in spirv bo length calculations

I don't know why I was dropping this, but doing so breaks drivers that have
optimization passes based on the lengths of these variables

Fixes: c1cdf30a119 ("zink: apply Delete All The Code methodology to the ubo/ssbo variables")

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12070>

---

 src/gallium/drivers/zink/zink_compiler.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/zink/zink_compiler.c b/src/gallium/drivers/zink/zink_compiler.c
index 43770bba54b..c32c6fe3651 100644
--- a/src/gallium/drivers/zink/zink_compiler.c
+++ b/src/gallium/drivers/zink/zink_compiler.c
@@ -844,7 +844,7 @@ unbreak_bos(nir_shader *shader)
       const struct glsl_type *type = glsl_without_array(var->type);
       if (type_is_counter(type))
          continue;
-      unsigned size = glsl_count_attribute_slots(type, false);
+      unsigned size = glsl_count_attribute_slots(glsl_type_is_array(var->type) ? var->type : type, false);
       if (var->data.mode == nir_var_mem_ubo)
          max_ubo_size = MAX2(max_ubo_size, size);
       else



More information about the mesa-commit mailing list