From 03c18f7efc4398f3a2ef1630bb40c6820aedd0dd Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 16 Jun 2021 14:54:46 -0400 Subject: [PATCH] nir/lower_mediump_io: Don't remap base unless needed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: fb29cef8dda ("nir: add many passes that lower and optimize 16-bit input/outputs and samplers") Signed-off-by: Alyssa Rosenzweig Reviewed-by: Jason Ekstrand Reviewed-by: Marek Olšák Part-of: --- src/compiler/nir/nir_lower_mediump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_lower_mediump.c b/src/compiler/nir/nir_lower_mediump.c index 0cc58c1e755..f4b10806358 100644 --- a/src/compiler/nir/nir_lower_mediump.c +++ b/src/compiler/nir/nir_lower_mediump.c @@ -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);