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 {