From 70b8babe3cd14a8ce21704005a5efbbdc3e53841 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 25 May 2023 13:22:42 -0400 Subject: [PATCH] agx: Use textures_used, not num_textures The latter doesn't account for holes. Fixes regression in Neverball on Asahi. Fixes: e607a89f ("mesa/main: ff-fragshader to nir") Signed-off-by: Alyssa Rosenzweig Part-of: --- src/asahi/compiler/agx_compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/asahi/compiler/agx_compile.c b/src/asahi/compiler/agx_compile.c index d4fd385feb0..69da543926a 100644 --- a/src/asahi/compiler/agx_compile.c +++ b/src/asahi/compiler/agx_compile.c @@ -2405,7 +2405,7 @@ agx_compile_shader_nir(nir_shader *nir, struct agx_shader_key *key, out->depth_layout = layout; } - out->nr_bindful_textures = nir->info.num_textures; + out->nr_bindful_textures = BITSET_LAST_BIT(nir->info.textures_used); /* Late clip plane lowering created discards */ if (nir->info.stage == MESA_SHADER_FRAGMENT) {