From 88b2c2a5cae3c57644a41e8d2189a48af0753888 Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Thu, 1 Dec 2022 11:10:47 -0800 Subject: [PATCH] microsoft/compiler: Handle nested arrays correctly for emitting global consts Part-of: --- src/microsoft/compiler/nir_to_dxil.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/microsoft/compiler/nir_to_dxil.c b/src/microsoft/compiler/nir_to_dxil.c index 00720f95638..09143ae54f9 100644 --- a/src/microsoft/compiler/nir_to_dxil.c +++ b/src/microsoft/compiler/nir_to_dxil.c @@ -1274,13 +1274,13 @@ var_fill_const_array(struct ntd_context *ctx, const struct nir_constant *c, offset); } else if (glsl_type_is_array(type)) { assert(!glsl_type_is_unsized_array(type)); - const struct glsl_type *without = glsl_without_array(type); - unsigned stride = glsl_get_explicit_stride(without); + const struct glsl_type *without = glsl_get_array_element(type); + unsigned stride = glsl_get_explicit_stride(type); for (unsigned elt = 0; elt < glsl_get_length(type); elt++) { var_fill_const_array(ctx, c->elements[elt], without, - const_vals, offset + (elt * stride)); - offset += glsl_get_cl_size(without); + const_vals, offset); + offset += stride; } } else if (glsl_type_is_struct(type)) { for (unsigned int elt = 0; elt < glsl_get_length(type); elt++) {