From c1ffdb3ee9a7aa75af3f0f19c71e5154b71a26a2 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Tue, 3 Oct 2023 00:51:46 -0500 Subject: [PATCH] nak/nir: Use count_vec4_slots instead of count_attribute_slots This will give us the correct behavior in for doubles when the time comes. The count_attribute_slots() helper is for GL attributes where a dvec4 countes as one slot. Part-of: --- src/nouveau/compiler/nak_nir.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nouveau/compiler/nak_nir.c b/src/nouveau/compiler/nak_nir.c index a424508de9f..9bdefec41dd 100644 --- a/src/nouveau/compiler/nak_nir.c +++ b/src/nouveau/compiler/nak_nir.c @@ -225,9 +225,9 @@ nak_attribute_attr_addr(gl_vert_attrib attrib) } static int -count_location_bytes(const struct glsl_type *type, bool bindless) +type_size_vec4_bytes(const struct glsl_type *type, bool bindless) { - return glsl_count_attribute_slots(type, false) * 16; + return glsl_count_vec4_slots(type, false, bindless) * 16; } static bool @@ -240,7 +240,7 @@ nak_nir_lower_vs_inputs(nir_shader *nir) nak_attribute_attr_addr(var->data.location); } - progress |= OPT(nir, nir_lower_io, nir_var_shader_in, count_location_bytes, + progress |= OPT(nir, nir_lower_io, nir_var_shader_in, type_size_vec4_bytes, nir_lower_io_lower_64bit_to_32); return progress; @@ -343,7 +343,7 @@ nak_nir_lower_varyings(nir_shader *nir, nir_variable_mode modes) nir_foreach_variable_with_modes(var, nir, modes) var->data.driver_location = nak_varying_attr_addr(var->data.location); - OPT(nir, nir_lower_io, modes, count_location_bytes, 0); + OPT(nir, nir_lower_io, modes, type_size_vec4_bytes, 0); switch (nir->info.stage) { case MESA_SHADER_TESS_CTRL: