Mesa (main): nir/lower_tex: fix rect queries with lower_rect set

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 14 23:56:55 UTC 2022


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Tue Apr 12 11:42:14 2022 -0400

nir/lower_tex: fix rect queries with lower_rect set

queries still need the sampler_dim changed

Fixes: 682e14d3eae ("nir: lower_tex: Don't normalize coordinates for TXF with RECT")

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15895>

---

 src/compiler/nir/nir_lower_tex.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/compiler/nir/nir_lower_tex.c b/src/compiler/nir/nir_lower_tex.c
index 511171da60d..d011ee63759 100644
--- a/src/compiler/nir/nir_lower_tex.c
+++ b/src/compiler/nir/nir_lower_tex.c
@@ -1334,9 +1334,10 @@ nir_lower_tex_block(nir_block *block, nir_builder *b,
       }
 
       if ((tex->sampler_dim == GLSL_SAMPLER_DIM_RECT) && options->lower_rect &&
-          tex->op != nir_texop_txf && !nir_tex_instr_is_query(tex)) {
-
-         if (compiler_options->has_txs)
+          tex->op != nir_texop_txf) {
+         if (nir_tex_instr_is_query(tex))
+            tex->sampler_dim = GLSL_SAMPLER_DIM_2D;
+         else if (compiler_options->has_txs)
             lower_rect(b, tex);
          else
             lower_rect_tex_scale(b, tex);



More information about the mesa-commit mailing list