Mesa (master): pan/midgard: Use lower_tex_without_implicit_lod

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Nov 22 14:20:24 UTC 2019


Module: Mesa
Branch: master
Commit: 4c43b354c3aabe308302405a79bc0be5a8cde91f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4c43b354c3aabe308302405a79bc0be5a8cde91f

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Thu Nov 21 13:40:00 2019 -0500

pan/midgard: Use lower_tex_without_implicit_lod

Just a bit of cleanup. lower_tex can do this lowering for us, which
should also eliminate some special cases (one less thing to fix if we
ever need texturing in tess/geom/etc, perhaps?)

Closes #2133

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso at collabora.com>

---

 src/panfrost/midgard/midgard_compile.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c
index 91cba1c1d54..2d8145c2ec0 100644
--- a/src/panfrost/midgard/midgard_compile.c
+++ b/src/panfrost/midgard/midgard_compile.c
@@ -499,7 +499,9 @@ optimise_nir(nir_shader *nir, unsigned quirks)
 
         nir_lower_tex_options lower_tex_options = {
                 .lower_txs_lod = true,
-                .lower_txp = ~0
+                .lower_txp = ~0,
+                .lower_tex_without_implicit_lod =
+                        (quirks & MIDGARD_EXPLICIT_LOD),
         };
 
         NIR_PASS(progress, nir, nir_lower_tex, &lower_tex_options);
@@ -1829,15 +1831,6 @@ emit_texop_native(compiler_context *ctx, nir_tex_instr *instr,
 static void
 emit_tex(compiler_context *ctx, nir_tex_instr *instr)
 {
-        /* Fixup op, since only textureLod is permitted in VS on later Midgard
-         * but NIR can give generic tex in some cases (which confuses the
-         * hardware). Interestingly, early Midgard lines up with NIR */
-
-        bool is_vertex = ctx->stage == MESA_SHADER_VERTEX;
-
-        if (is_vertex && instr->op == nir_texop_tex && ctx->quirks & MIDGARD_EXPLICIT_LOD)
-                instr->op = nir_texop_txl;
-
         switch (instr->op) {
         case nir_texop_tex:
         case nir_texop_txb:




More information about the mesa-commit mailing list