Mesa (master): pan/bi: Use TEXC for indices >= 8

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jan 11 22:43:59 UTC 2021


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

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Mon Jan 11 13:52:53 2021 -0500

pan/bi: Use TEXC for indices >= 8

Otherwise it can't fit, fixes

   dEQP-GLES3.functional.texture.units.all_units.only_2d.*
   dEQP-GLES3.functional.texture.units.all_units.only_cube.*
   dEQP-GLES3.functional.texture.units.all_units.mixed.*

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Tested-by: Maciej Matuszczyk <maccraft123mc at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8427>

---

 src/panfrost/bifrost/bifrost_compile.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c
index 5f96b5a3eb6..f2306c5bc68 100644
--- a/src/panfrost/bifrost/bifrost_compile.c
+++ b/src/panfrost/bifrost/bifrost_compile.c
@@ -1625,7 +1625,8 @@ bi_emit_texc(bi_builder *b, nir_tex_instr *instr)
 }
 
 /* Simple textures ops correspond to NIR tex or txl with LOD = 0 on 2D (or cube
- * map, TODO) textures. Anything else needs a complete texture op. */
+ * map, TODO) textures with sufficiently small immediate indices. Anything else
+ * needs a complete texture op. */
 
 static bool
 bi_is_simple_tex(nir_tex_instr *instr)
@@ -1639,6 +1640,10 @@ bi_is_simple_tex(nir_tex_instr *instr)
                         return false;
         }
 
+        /* Indices need to fit in 3 bits */
+        if (MAX2(instr->sampler_index, instr->texture_index) >= (1 << 3))
+                return false;
+
         int lod_idx = nir_tex_instr_src_index(instr, nir_tex_src_lod);
         if (lod_idx < 0)
                 return true;



More information about the mesa-commit mailing list