From 43e521f7a58b9e83eebcff696c426c59711a6b52 Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Mon, 24 Mar 2025 09:11:31 -0700 Subject: [PATCH] hk: Don't expect garbage on shared_size Talking to Alyssa this looks like an artifact of old ways that the shader was being produced, so get rid of that zeroing. Add an assert as a canary for any problems we might be missing. Reviewed-by: Alyssa Rosenzweig Part-of: --- src/asahi/vulkan/hk_shader.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/asahi/vulkan/hk_shader.c b/src/asahi/vulkan/hk_shader.c index 3a3d39a5d41..bf5602c9519 100644 --- a/src/asahi/vulkan/hk_shader.c +++ b/src/asahi/vulkan/hk_shader.c @@ -750,11 +750,7 @@ hk_lower_nir(struct hk_device *dev, nir_shader *nir, lower_load_global_constant_offset_instr, nir_metadata_none, &soft_fault); - /* There may be garbage in shared_size, but it's the job of - * nir_lower_vars_to_explicit_types to allocate it. We have to reset to - * avoid overallocation. - */ - nir->info.shared_size = 0; + assert(nir->info.shared_size == 0); NIR_PASS(_, nir, nir_lower_vars_to_explicit_types, nir_var_mem_shared, shared_var_info);