Mesa (staging/21.3): zink: be more permissive for injecting LOD into texture() instructions

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Nov 1 19:36:40 UTC 2021


Module: Mesa
Branch: staging/21.3
Commit: 6c7a69c2b252ec216c3412d8d044bc4175f3a06e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6c7a69c2b252ec216c3412d8d044bc4175f3a06e

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Thu Oct 28 09:53:02 2021 -0400

zink: be more permissive for injecting LOD into texture() instructions

there's other variants of implicit lod sampling, and none of them are valid
outside fragment stage

Fixes: 3ad06b69490 ("zink: always use explicit lod for texture() when legal in non-fragment stages")

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13585>
(cherry picked from commit 87fbb0eab03c8348f74ca1f4b3489e89e89f691f)

---

 .pick_status.json                                    | 2 +-
 src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 2e75e5fb31e..fea261458d0 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -274,7 +274,7 @@
         "description": "zink: be more permissive for injecting LOD into texture() instructions",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "3ad06b69490fa990c473e16f78ce658b0eb43b47"
     },
diff --git a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
index 7af2746ab6f..68e0db3bf81 100644
--- a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
+++ b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c
@@ -3220,7 +3220,7 @@ emit_tex(struct ntv_context *ctx, nir_tex_instr *tex)
    if (!tex_instr_is_lod_allowed(tex))
       lod = 0;
    else if (ctx->stage != MESA_SHADER_FRAGMENT &&
-            tex->op == nir_texop_tex && ctx->explicit_lod && !lod && !proj && !bias && !dref && !dx && !dy)
+            tex->op == nir_texop_tex && ctx->explicit_lod && !lod)
       lod = emit_float_const(ctx, 32, 0.0);
    if (tex->op == nir_texop_txs) {
       SpvId image = spirv_builder_emit_image(&ctx->builder, image_type, load);



More information about the mesa-commit mailing list