From 653b560413fa90b0fa851538f303d3af367d6c0c Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 12 Apr 2022 11:42:14 -0400 Subject: [PATCH] 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 Part-of: (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 44b622cc32d..b2113ded6fc 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1813,7 +1813,7 @@ "description": "nir/lower_tex: fix rect queries with lower_rect set", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "682e14d3eaee8991ee08ea309cbf9a509b6e6b27" }, 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);