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: c1cdf30a11 ("zink: apply Delete All The Code methodology to the ubo/ssbo variables")

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12070>
(cherry picked from commit 1dc7b9b08b)
This commit is contained in:
Mike Blumenkrantz 2021-07-26 13:11:18 -04:00 committed by Eric Engestrom
parent 949ba26250
commit 492cc6c44e
2 changed files with 2 additions and 2 deletions

View file

@ -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"
},

View file

@ -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