Mesa (staging/22.0): nir/lower_tex: avoid adding invalid LOD to RECT textures
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Apr 13 18:24:05 UTC 2022
Module: Mesa
Branch: staging/22.0
Commit: d41ae7fe2df47698d3fba4cc9fc2c781d1aba78b
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d41ae7fe2df47698d3fba4cc9fc2c781d1aba78b
Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date: Thu Apr 7 14:49:07 2022 -0400
nir/lower_tex: avoid adding invalid LOD to RECT textures
this is illegal
Fixes: 74ec2b12be1 ("nir/lower_tex: Rework invalid implicit LOD lowering")
Reviewed-by: Jason Ekstrand <jason.ekstrand at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15804>
(cherry picked from commit 6cfcf891c1d5baa1e5e073b875831884ed049b5a)
---
.pick_status.json | 2 +-
src/compiler/nir/nir_lower_tex.c | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/.pick_status.json b/.pick_status.json
index 1e646ed8c8d..6b87f104978 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1964,7 +1964,7 @@
"description": "nir/lower_tex: avoid adding invalid LOD to RECT textures",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"because_sha": "74ec2b12be17a7796186b3100a5a6b208be45b23"
},
{
diff --git a/src/compiler/nir/nir_lower_tex.c b/src/compiler/nir/nir_lower_tex.c
index 2664925568f..fb1a34f9679 100644
--- a/src/compiler/nir/nir_lower_tex.c
+++ b/src/compiler/nir/nir_lower_tex.c
@@ -1470,8 +1470,10 @@ nir_lower_tex_block(nir_block *block, nir_builder *b,
/* Only fragment and compute (in some cases) support implicit
* derivatives. Lower those opcodes which use implicit derivatives to
* use an explicit LOD of 0.
+ * But don't touch RECT samplers because they don't have mips.
*/
if (nir_tex_instr_has_implicit_derivative(tex) &&
+ tex->sampler_dim != GLSL_SAMPLER_DIM_RECT &&
!nir_shader_supports_implicit_lod(b->shader)) {
lower_zero_lod(b, tex);
progress = true;
More information about the mesa-commit
mailing list