Module: Mesa Branch: main Commit: 23f5e2edbd85b50cd8b26a3b1aa9bb3bfe1cf202 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=23f5e2edbd85b50cd8b26a3b1aa9bb3bfe1cf202
Author: Corentin Noël <corentin.n...@collabora.com> Date: Fri Apr 1 16:34:13 2022 +0200 nir_to_tgsi: Handle blocks defined as arrays of arrays 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 <corentin.n...@collabora.com> Reviewed-by: Jason Ekstrand <jason.ekstr...@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15713> --- 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 b3bb405d18f..f4d3110b7fd 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.