Mesa (main): freedreno: Use correct key for binning pass shader

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Aug 10 21:35:56 UTC 2021


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

Author: Rob Clark <robdclark at chromium.org>
Date:   Tue Aug 10 11:24:47 2021 -0700

freedreno: Use correct key for binning pass shader

We updated the key correctly for whether we wanted to use a
safe_constlen binning pass variant, but then passed the wrong
key to ir3_shader_variant().

Fixes: 1dd24bf27b2 ("freedreno: Share constlen between different stages properly")
Signed-off-by: Rob Clark <robdclark at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12314>

---

 src/gallium/drivers/freedreno/ir3/ir3_cache.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/freedreno/ir3/ir3_cache.c b/src/gallium/drivers/freedreno/ir3/ir3_cache.c
index b330538d12e..c402b3cd4c6 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_cache.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_cache.c
@@ -140,9 +140,13 @@ ir3_cache_lookup(struct ir3_cache *cache, const struct ir3_cache_key *key,
    struct ir3_shader_variant *bs;
 
    if (ir3_has_binning_vs(&key->key)) {
-      shader_key.safe_constlen = !!(safe_constlens & (1 << MESA_SHADER_VERTEX));
+      /* starting with a6xx, the same const state is used for binning and draw
+       * passes, so the binning pass VS variant needs to match the main VS
+       */
+      shader_key.safe_constlen = (compiler->gen >= 6) &&
+            !!(safe_constlens & (1 << MESA_SHADER_VERTEX));
       bs =
-         ir3_shader_variant(shaders[MESA_SHADER_VERTEX], key->key, true, debug);
+         ir3_shader_variant(shaders[MESA_SHADER_VERTEX], shader_key, true, debug);
       if (!bs)
          return NULL;
    } else {



More information about the mesa-commit mailing list