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>
(cherry picked from commit aacc4e1c68)
This commit is contained in:
Mike Blumenkrantz
2024-02-01 10:46:55 -05:00
committed by Eric Engestrom
parent c7750d900a
commit 751c5689f0
2 changed files with 2 additions and 2 deletions

View File

@@ -44,7 +44,7 @@
"description": "zink: zero allocate resident_defs array in ntv",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "73ef54e34242fa59803a3a89b5a6eb92053e917e",
"notes": null

View File

@@ -4705,7 +4705,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;