From 3933747d87680a3432814aa51f2f5231b2f1ed60 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 20 May 2020 09:52:24 -0400 Subject: [PATCH] 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: --- src/gallium/drivers/zink/zink_query.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.30.2