diff --git a/src/gallium/drivers/zink/zink_compiler.c b/src/gallium/drivers/zink/zink_compiler.c index ffb992ef443..f1fb82e805b 100644 --- a/src/gallium/drivers/zink/zink_compiler.c +++ b/src/gallium/drivers/zink/zink_compiler.c @@ -5424,16 +5424,17 @@ loop_io_var_mask(nir_shader *nir, nir_variable_mode mode, bool indirect, bool pa { ASSERTED bool is_vertex_input = nir->info.stage == MESA_SHADER_VERTEX && mode == nir_var_shader_in; u_foreach_bit64(slot, mask) { + unsigned location = slot; if (patch) - slot += VARYING_SLOT_PATCH0; + location += VARYING_SLOT_PATCH0; /* this should've been handled explicitly */ - assert(is_vertex_input || !is_clipcull_dist(slot)); + assert(is_vertex_input || !is_clipcull_dist(location)); unsigned remaining = 0; do { /* scan the slot for usage */ - struct rework_io_state ris = scan_io_var_slot(nir, mode, slot, indirect); + struct rework_io_state ris = scan_io_var_slot(nir, mode, location, indirect); /* one of these must be true or things have gone very wrong */ assert(indirect || ris.component_mask || find_rework_var(nir, &ris) || remaining); /* release builds only */