nir: mark XFB varyings as unmoveable to prevent them to be remapped

XFB varyings are considered as always active IO to prevent them to
be removed or compacted. Though, if the NIR linker doesn't mark XFB
varyings as unmoveable it still possible to remap other varyings to
the same location/component.

Fixes KHR-Single-GL46.enhanced_layouts.xfb_override_qualifiers_with_api
with Zink and a bunch of other dEQP XFB tests.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6301
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri  <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16092>
This commit is contained in:
Samuel Pitoiset
2022-04-22 10:13:56 +02:00
committed by Marge Bot
parent 26f74f17d9
commit 4ebb5391ac
2 changed files with 2 additions and 11 deletions

View File

@@ -310,7 +310,8 @@ get_unmoveable_components_masks(nir_shader *shader,
/* If we can pack this varying then don't mark the components as
* used.
*/
if (is_packing_supported_for_type(type))
if (is_packing_supported_for_type(type) &&
!var->data.always_active_io)
continue;
unsigned location = var->data.location - VARYING_SLOT_VAR0;