zink: fix separate shader patch variable location adjustment

in spirv, these start at location 0, not location 32

fixes #10414

Fixes: d9942442f2 ("zink: handle patch variable locations for separate shaders better")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26981>
(cherry picked from commit 565ee4fafc)
This commit is contained in:
Mike Blumenkrantz 2024-01-10 12:22:56 -05:00 committed by Eric Engestrom
parent 62161b7425
commit 151cd31e05
2 changed files with 3 additions and 3 deletions

View file

@ -564,7 +564,7 @@
"description": "zink: fix separate shader patch variable location adjustment",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "d9942442f200bea0ef5b906f288a5234994767b5",
"notes": null

View file

@ -4912,7 +4912,7 @@ fixup_io_locations(nir_shader *nir)
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;
var->data.driver_location = var->data.location - VARYING_SLOT_PATCH0;
else
var->data.driver_location = var->data.location;
}
@ -4939,7 +4939,7 @@ fixup_io_locations(nir_shader *nir)
size += glsl_count_vec4_slots(var->type, false, false);
}
if (var->data.patch)
var->data.driver_location = var->data.location - VARYING_SLOT_VAR0;
var->data.driver_location = var->data.location - VARYING_SLOT_PATCH0;
else
var->data.driver_location = slot;
found = true;