Mesa (main): nir_to_tgsi: Drop the txl(lod=0)->tex nir_lower_tex() fixup.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 28 21:55:32 UTC 2022


Module: Mesa
Branch: main
Commit: 463cb1153f996a01e7960ec20f520cb07ea67959
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=463cb1153f996a01e7960ec20f520cb07ea67959

Author: Emma Anholt <emma at anholt.net>
Date:   Mon Apr 25 17:02:20 2022 -0700

nir_to_tgsi: Drop the txl(lod=0)->tex nir_lower_tex() fixup.

I've fixed nir_lower_tex() to not do that for us any more.

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16156>

---

 src/gallium/auxiliary/nir/nir_to_tgsi.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/src/gallium/auxiliary/nir/nir_to_tgsi.c b/src/gallium/auxiliary/nir/nir_to_tgsi.c
index 4c3929e3fd4..d85044659ea 100644
--- a/src/gallium/auxiliary/nir/nir_to_tgsi.c
+++ b/src/gallium/auxiliary/nir/nir_to_tgsi.c
@@ -3468,20 +3468,6 @@ nir_to_tgsi_lower_tex_instr(nir_builder *b, nir_instr *instr, void *data)
    if (nir_tex_instr_src_index(tex, nir_tex_src_coord) < 0)
       return false;
 
-   /* NIR after lower_tex will have LOD set to 0 for tex ops that wanted
-    * implicit lod in shader stages that don't have quad-based derivatives.
-    * TGSI doesn't want that, it requires that the backend do implict LOD 0 for
-    * those stages.
-    */
-   if (!nir_shader_supports_implicit_lod(b->shader) && tex->op == nir_texop_txl) {
-      int lod_index = nir_tex_instr_src_index(tex, nir_tex_src_lod);
-      nir_src *lod_src = &tex->src[lod_index].src;
-      if (nir_src_is_const(*lod_src) && nir_src_as_uint(*lod_src) == 0) {
-         nir_tex_instr_remove_src(tex, lod_index);
-         tex->op = nir_texop_tex;
-      }
-   }
-
    b->cursor = nir_before_instr(instr);
 
    struct ntt_lower_tex_state s = {0};



More information about the mesa-commit mailing list