Mesa (master): nir/lower_tex: skip lower_tex_packing for the texture samples query

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Aug 5 07:02:57 UTC 2020


Module: Mesa
Branch: master
Commit: 71572ebb32e5a460e5039fb27903f60b3b89e037
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=71572ebb32e5a460e5039fb27903f60b3b89e037

Author: Iago Toral Quiroga <itoral at igalia.com>
Date:   Tue Aug  4 11:18:46 2020 +0200

nir/lower_tex: skip lower_tex_packing for the texture samples query

Similar to other skips for texture queries that don't actually sample
the texture and which results are not packed.

We can't use nir_tex_instr_is_query() here to skip the lowering for all
queries since that causes regressions in Piglit. Apparently, we do want
to lower some of the query results. In particularly, the LOD query.

Reviewed-by: Alejandro Piñeiro <apinheiro at igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6169>

---

 src/compiler/nir/nir_lower_tex.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/compiler/nir/nir_lower_tex.c b/src/compiler/nir/nir_lower_tex.c
index 2e68f2b164e..0d23cde0c28 100644
--- a/src/compiler/nir/nir_lower_tex.c
+++ b/src/compiler/nir/nir_lower_tex.c
@@ -1086,7 +1086,8 @@ nir_lower_tex_block(nir_block *block, nir_builder *b,
       if (options->lower_tex_packing[tex->sampler_index] !=
           nir_lower_tex_packing_none &&
           tex->op != nir_texop_txs &&
-          tex->op != nir_texop_query_levels) {
+          tex->op != nir_texop_query_levels &&
+          tex->op != nir_texop_texture_samples) {
          lower_tex_packing(b, tex, options);
          progress = true;
       }



More information about the mesa-commit mailing list