zink: rework query handling
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Mon, 25 May 2020 14:38:40 +0000 (10:38 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 13 Jul 2020 20:59:07 +0000 (20:59 +0000)
commit3eea7fc88bb046f9a74454f184cc341e770c63f9
tree3bf91b08e1f5a43cfb651c6efb0c87924ff3519b
parent2096903a05b835d5cd5982b741ba0d28b6ede632
zink: rework query handling

this hooks up query objects to the batches that they're actively running on
(and the related fence) in order to manage the lifetimes of queries more
efficiently by calling vkCmdResetQueryPool only on init and when the query
pool has been completely used up. additionally, this resolves some vk spec
issues related to destroying pools with active queries

note that any time a query pool is completely used up, results are lost,
which is a very slight improvement on the previous abort() that was triggered
in that scenario

ref mesa/mesa#3000

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5533>
src/gallium/drivers/zink/zink_batch.c
src/gallium/drivers/zink/zink_batch.h
src/gallium/drivers/zink/zink_context.c
src/gallium/drivers/zink/zink_context.h
src/gallium/drivers/zink/zink_fence.c
src/gallium/drivers/zink/zink_fence.h
src/gallium/drivers/zink/zink_query.c
src/gallium/drivers/zink/zink_query.h