zink: fix pool overflow handling on batch reset

this mechanism worked off the previous iteration of descriptor updating,
in which pools were stored in a set to the batch state and could be iterated
normally

now, however, they're stored as a sparse array, and so the dynarray util for getting
the number of elements cannot be used

instead, use the calculated size for the array like every other accessor for
the pools to ensure correct indexing

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19053>
This commit is contained in:
Mike Blumenkrantz
2022-10-12 11:51:14 -04:00
committed by Marge Bot
parent 6c59aeebbf
commit 340cfa1001
+1 -2
View File
@@ -994,8 +994,7 @@ zink_batch_descriptor_reset(struct zink_screen *screen, struct zink_batch_state
{
for (unsigned i = 0; i < ZINK_DESCRIPTOR_TYPES; i++) {
struct zink_descriptor_pool_multi **mpools = bs->dd.pools[i].data;
unsigned count = util_dynarray_num_elements(&bs->dd.pools[i], struct zink_descriptor_pool_multi *);
for (unsigned j = 0; j < count; j++) {
for (unsigned j = 0; j < bs->dd.pool_size[i]; j++) {
struct zink_descriptor_pool_multi *mpool = mpools[j];
if (!mpool)
continue;