dzn: Fix dzn_cmd_buffer_collect_queries()

We can have an empty dzn_cmd_buffer_query_pool_state::collect
bitset, handle that case properly.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16396>
This commit is contained in:
Boris Brezillon 2022-04-26 01:09:18 -07:00 committed by Marge Bot
parent b9489ba7d2
commit 3999fcba15

View file

@ -516,6 +516,9 @@ dzn_cmd_buffer_collect_queries(struct dzn_cmd_buffer *cmdbuf,
uint32_t nbits = util_dynarray_num_elements(&state->collect, BITSET_WORD) * BITSET_WORDBITS;
uint32_t start, end;
if (!nbits)
return VK_SUCCESS;
query_count = MIN2(query_count, nbits - first_query);
nbits = MIN2(first_query + query_count, nbits);