From aacc4e1c687b643929d496cec72891b814fc2256 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 1 Feb 2024 10:46:55 -0500 Subject: [PATCH] zink: zero allocate resident_defs array in ntv this makes assert(def!=0) more reliable Fixes: 73ef54e3424 ("zink: handle residency return value from sparse texture instructions") Part-of: --- src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c index bf4b259a5e8..1369011cd48 100644 --- a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c +++ b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c @@ -4774,7 +4774,7 @@ nir_to_spirv(struct nir_shader *s, const struct zink_shader_info *sinfo, uint32_ /* this could be huge, so only alloc if needed since it's extremely unlikely to * ever be used by anything except cts */ - ctx.resident_defs = ralloc_array_size(ctx.mem_ctx, + ctx.resident_defs = rzalloc_array_size(ctx.mem_ctx, sizeof(SpvId), entry->ssa_alloc); if (!ctx.resident_defs) goto fail;