zink: fix vkCmdResetQueryPool usage
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Wed, 20 May 2020 13:52:24 +0000 (09:52 -0400)
committerMarge Bot <eric+marge@anholt.net>
Fri, 22 May 2020 13:24:10 +0000 (13:24 +0000)
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 <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5120>

src/gallium/drivers/zink/zink_query.c

index 3f8c640ae6550b712e743142122719bc5ad17fa8..8f06256bf5b0a76a614e057ffca2badfda4b7515 100644 (file)
@@ -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);