nir/lower_mediump_io: Don't remap base unless needed
authorAlyssa Rosenzweig <alyssa@collabora.com>
Wed, 16 Jun 2021 18:54:46 +0000 (14:54 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 10 Aug 2021 20:55:33 +0000 (20:55 +0000)
commit03c18f7efc4398f3a2ef1630bb40c6820aedd0dd
treec07bb5a119ee75cff28152732a367f51d303789f
parent4f9ac2f7374500619ac1b36c71bb162f1a5bb98b
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: fb29cef8dda ("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>
src/compiler/nir/nir_lower_mediump.c