From 23f5e2edbd85b50cd8b26a3b1aa9bb3bfe1cf202 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Corentin=20No=C3=ABl?= Date: Fri, 1 Apr 2022 16:34:13 +0200 Subject: [PATCH] nir_to_tgsi: Handle blocks defined as arrays of arrays MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Make sure to take all the array sizes into account when generating the TGSI. Makes the `piglit.spec@arb_arrays_of_arrays@execution@ubo@fs-const-explicit-binding` test pass Signed-off-by: Corentin Noël Reviewed-by: Jason Ekstrand Part-of: --- src/gallium/auxiliary/nir/nir_to_tgsi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/nir/nir_to_tgsi.c b/src/gallium/auxiliary/nir/nir_to_tgsi.c index b3bb405..f4d3110 100644 --- a/src/gallium/auxiliary/nir/nir_to_tgsi.c +++ b/src/gallium/auxiliary/nir/nir_to_tgsi.c @@ -961,7 +961,8 @@ ntt_setup_uniforms(struct ntt_compile *c) int array_size = 1; if (glsl_type_is_interface(glsl_without_array(var->type))) - array_size = MAX2(1, glsl_array_size(var->type)); + array_size = MAX2(1, glsl_get_aoa_size(var->type)); + for (int i = 0; i < array_size; i++) { /* Even if multiple NIR variables are in the same uniform block, their * explicit size is the size of the block. -- 2.7.4