zink: handle patch variable locations for separate shaders better

these don't overlap with other locations so they can keep whatever their
current assignments are

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24757>
This commit is contained in:
Mike Blumenkrantz 2023-08-17 12:40:52 -04:00 committed by Marge Bot
parent ca987c0dfb
commit d9942442f2

View file

@ -4833,6 +4833,8 @@ fixup_io_locations(nir_shader *nir)
continue;
if (var->data.location == VARYING_SLOT_VAR0)
var->data.driver_location = 0;
else if (var->data.patch)
var->data.driver_location = var->data.location - VARYING_SLOT_VAR0;
else
var->data.driver_location = var->data.location;
}
@ -4858,7 +4860,10 @@ fixup_io_locations(nir_shader *nir)
else
size += glsl_count_vec4_slots(var->type, false, false);
}
var->data.driver_location = slot;
if (var->data.patch)
var->data.driver_location = var->data.location - VARYING_SLOT_VAR0;
else
var->data.driver_location = slot;
found = true;
}
slot += size;