From 492cc6c44e5f0c3581d2b88977b3af527088272b Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 26 Jul 2021 13:11:18 -0400 Subject: [PATCH] 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 Part-of: (cherry picked from commit 1dc7b9b08b6a272693f85e956ec3c4e498823a65) --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_compiler.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index e78f2df8a46..bc65dd9707f 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3055,7 +3055,7 @@ "description": "zink: use array size in spirv bo length calculations", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "c1cdf30a119cc523616b3825daf144c1620c17b7" }, diff --git a/src/gallium/drivers/zink/zink_compiler.c b/src/gallium/drivers/zink/zink_compiler.c index cff1f6d671f..c91d97dc7a4 100644 --- a/src/gallium/drivers/zink/zink_compiler.c +++ b/src/gallium/drivers/zink/zink_compiler.c @@ -746,7 +746,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