Mesa (staging/22.0): nir/lower_tex: fix rect queries with lower_rect set
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Apr 21 20:48:23 UTC 2022
Module: Mesa
Branch: staging/22.0
Commit: 1bf1ede8e81317a6f808f92ea0131c4e5a31ecf4
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1bf1ede8e81317a6f808f92ea0131c4e5a31ecf4
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>
(cherry picked from commit 5b0634d7353017464c0bdb9e009f4b2d98948187)
---
.pick_status.json | 2 +-
src/compiler/nir/nir_lower_tex.c | 7 ++++---
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/.pick_status.json b/.pick_status.json
index a07625fe5fc..56420b64ed6 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1956,7 +1956,7 @@
"description": "nir/lower_tex: fix rect queries with lower_rect set",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"because_sha": "682e14d3eaee8991ee08ea309cbf9a509b6e6b27"
},
{
diff --git a/src/compiler/nir/nir_lower_tex.c b/src/compiler/nir/nir_lower_tex.c
index 9ab986d5d74..f96bffec1d2 100644
--- a/src/compiler/nir/nir_lower_tex.c
+++ b/src/compiler/nir/nir_lower_tex.c
@@ -1328,9 +1328,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