Mesa (staging/21.2): nir/lower_mediump_io: Don't remap base unless needed

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Aug 12 17:09:47 UTC 2021


Module: Mesa
Branch: staging/21.2
Commit: 4b0f88e7e541e6d3cb51b0861df08de16c323aaa
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4b0f88e7e541e6d3cb51b0861df08de16c323aaa

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Wed Jun 16 14:54:46 2021 -0400

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 at collabora.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11732>
(cherry picked from commit 03c18f7efc4398f3a2ef1630bb40c6820aedd0dd)

---

 .pick_status.json                    | 2 +-
 src/compiler/nir/nir_lower_mediump.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index ad85ee20307..b97ffb384d4 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -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"
     },
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);



More information about the mesa-commit mailing list