nir/lower_mediump_io: Don't remap base unless needed

Otherwise drivers that don't use 16-bit slots for varyings will get
confused and have their driver_locations scribbled over. This has caused
multiple problems for both Panfrost and Asahi this week. Given the only
other user of the pass for varyings is radeonsi, which needs both
together, I think this is the least controversial fix.

Fixes: fb29cef8dd ("nir: add many passes that lower and optimize 16-bit input/outputs and samplers")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11732>
(cherry picked from commit 03c18f7efc)
This commit is contained in:
Alyssa Rosenzweig 2021-06-16 14:54:46 -04:00 committed by Dylan Baker
parent b750b385cf
commit 4b0f88e7e5
2 changed files with 2 additions and 2 deletions

View file

@ -292,7 +292,7 @@
"description": "nir/lower_mediump_io: Don't remap base unless needed",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "fb29cef8ddabdd05aeddc5220017bb28a83bb19c"
},

View file

@ -224,7 +224,7 @@ nir_lower_mediump_io(nir_shader *nir, nir_variable_mode modes,
}
}
if (changed)
if (changed && use_16bit_slots)
nir_recompute_io_bases(impl, modes);
nir_metadata_preserve(impl, nir_metadata_all);