From baf96518fa47b1ddf1e8e2a6848815d16a2296c8 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 25 Mar 2024 10:16:33 -0400 Subject: [PATCH] zink: fix io slot calculation for vertex inputs in add_derefs Part-of: --- src/gallium/drivers/zink/zink_compiler.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_compiler.c b/src/gallium/drivers/zink/zink_compiler.c index 5b183084ced..05226ef03fe 100644 --- a/src/gallium/drivers/zink/zink_compiler.c +++ b/src/gallium/drivers/zink/zink_compiler.c @@ -1776,7 +1776,8 @@ get_var_slot_count(nir_shader *nir, nir_variable *var) if (nir_is_arrayed_io(var, nir->info.stage)) type = glsl_get_array_element(type); unsigned slot_count = 0; - if (var->data.location >= VARYING_SLOT_VAR0) + if ((nir->info.stage == MESA_SHADER_VERTEX && var->data.mode == nir_var_shader_in && var->data.location >= VERT_ATTRIB_GENERIC0) || + var->data.location >= VARYING_SLOT_VAR0) slot_count = glsl_count_vec4_slots(type, false, false); else if (glsl_type_is_array(type)) slot_count = DIV_ROUND_UP(glsl_get_aoa_size(type), 4);