Mesa (staging/22.0): nir/lower_tex: avoid adding invalid LOD to RECT textures

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 21 18:03:05 UTC 2022


Module: Mesa
Branch: staging/22.0
Commit: e84a7123866ab64dd0312c64dd8724c42fd65121
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e84a7123866ab64dd0312c64dd8724c42fd65121

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Thu Apr  7 14:49:07 2022 -0400

nir/lower_tex: avoid adding invalid LOD to RECT textures

this is illegal

Fixes: 74ec2b12be1 ("nir/lower_tex: Rework invalid implicit LOD lowering")

Reviewed-by: Jason Ekstrand <jason.ekstrand at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15804>
(cherry picked from commit 6cfcf891c1d5baa1e5e073b875831884ed049b5a)

---

 .pick_status.json                | 2 +-
 src/compiler/nir/nir_lower_tex.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index 3798f7658e7..7af0e36073e 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -4036,7 +4036,7 @@
         "description": "nir/lower_tex: avoid adding invalid LOD to RECT textures",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 5,
+        "resolution": 1,
         "because_sha": "74ec2b12be17a7796186b3100a5a6b208be45b23"
     },
     {
diff --git a/src/compiler/nir/nir_lower_tex.c b/src/compiler/nir/nir_lower_tex.c
index 60e49984bab..9ab986d5d74 100644
--- a/src/compiler/nir/nir_lower_tex.c
+++ b/src/compiler/nir/nir_lower_tex.c
@@ -1471,8 +1471,10 @@ nir_lower_tex_block(nir_block *block, nir_builder *b,
       /* Only fragment and compute (in some cases) support implicit
        * derivatives.  Lower those opcodes which use implicit derivatives to
        * use an explicit LOD of 0.
+       * But don't touch RECT samplers because they don't have mips.
        */
       if (nir_tex_instr_has_implicit_derivative(tex) &&
+          tex->sampler_dim != GLSL_SAMPLER_DIM_RECT &&
           !nir_shader_supports_implicit_lod(b->shader)) {
          lower_zero_lod(b, tex);
          progress = true;



More information about the mesa-commit mailing list