zink: zero allocate resident_defs array in ntv

this makes assert(def!=0) more reliable

Fixes: 73ef54e342 ("zink: handle residency return value from sparse texture instructions")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27414>
This commit is contained in:
Mike Blumenkrantz
2024-02-01 10:46:55 -05:00
committed by Marge Bot
parent 3b025d6b42
commit aacc4e1c68

View File

@@ -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;