zink: fix sparse bo deallocation

this loop was not correctly iterating the dynarray

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31124>
This commit is contained in:
Mike Blumenkrantz 2024-09-10 19:49:57 -04:00 committed by Marge Bot
parent d72f7cbc5a
commit bb16203a8d

View file

@ -131,10 +131,10 @@ zink_reset_batch_state(struct zink_context *ctx, struct zink_batch_state *bs)
zink_batch_descriptor_reset(screen, bs);
util_dynarray_foreach(&bs->freed_sparse_backing_bos, struct zink_bo, bo) {
while (util_dynarray_contains(&bs->freed_sparse_backing_bos, struct zink_bo*)) {
struct zink_bo *bo = util_dynarray_pop(&bs->freed_sparse_backing_bos, struct zink_bo*);
zink_bo_unref(screen, bo);
}
util_dynarray_clear(&bs->freed_sparse_backing_bos);
/* programs are refcounted and batch-tracked */
set_foreach_remove(&bs->programs, entry) {