From: Mike Blumenkrantz Date: Wed, 20 May 2020 13:52:24 +0000 (-0400) Subject: zink: fix vkCmdResetQueryPool usage X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3933747d87680a3432814aa51f2f5231b2f1ed60;p=mesa.git zink: fix vkCmdResetQueryPool usage the final parameter here is the number of queries to reset, not the index of the last query, meaning that the value passed needs to be (curr_query + 1) in order to reset the query corresponding to curr_query Reviewed-by: Erik Faye-Lund Part-of: --- diff --git a/src/gallium/drivers/zink/zink_query.c b/src/gallium/drivers/zink/zink_query.c index 3f8c640ae65..8f06256bf5b 100644 --- a/src/gallium/drivers/zink/zink_query.c +++ b/src/gallium/drivers/zink/zink_query.c @@ -132,7 +132,7 @@ zink_begin_query(struct pipe_context *pctx, * the pool in the batch instead? */ struct zink_batch *batch = zink_batch_no_rp(zink_context(pctx)); - vkCmdResetQueryPool(batch->cmdbuf, query->query_pool, 0, query->curr_query); + vkCmdResetQueryPool(batch->cmdbuf, query->query_pool, 0, MIN2(query->curr_query + 1, query->num_queries)); query->curr_query = 0; begin_query(ctx, query);