aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/zink/zink_query.c
Commit message (Collapse)AuthorAgeFilesLines
* zink: use right vulkan type for GL_PRIMITIVES_GENERATED queriesMike Blumenkrantz2020-07-131-1/+1
| | | | | | | | | | | VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT includes primitives which won't get drawn due to e.g., not enough vertices emitted by geometry shader fixes [email protected]@gs-emits-too-few-verts Reviewed-by: Erik Faye-Lund <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5533>
* zink: only reset query pool on query end if current batch isn't in renderpassMike Blumenkrantz2020-07-131-44/+65
| | | | | | | | | reset can't be performed during a renderpass, so we need to defer that until a time when we're definitely not in a renderpass, such as when we're starting a new query or resuming a query Reviewed-by: Erik Faye-Lund <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5533>
* zink: properly handle query pool overflowsMike Blumenkrantz2020-07-131-3/+12
| | | | | | | | | | | | | | | inline a query result value to each query object so we can stash the partial result just before we do a pool reset, which will always happen during the suspend/resume query mechanism that swaps active queries from a flushed batch to the next batch once (or if) the "real" call to fetch query results is called, we can dump the inlined value into the fetch value and return the full results fixes mesa/mesa#3000 Reviewed-by: Erik Faye-Lund <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5533>
* zink: only stall during query destroy for xfb queriesMike Blumenkrantz2020-07-131-7/+24
| | | | | | | | | | | | | xfb queries allocate vk buffer objects in the underlying driver which can be deallocated while an xfb query is in-flight if we attempt to defer it due to the way that gl xfb is translated to vk, so we need to continue forcing this behavior in that case for other query types, we can safely defer here until the current batch has finished rather than block Reviewed-by: Erik Faye-Lund <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5533>
* zink: use #define for number of queries per-poolMike Blumenkrantz2020-07-131-4/+6
| | | | | | | just to ensure we're consistent internally Reviewed-by: Erik Faye-Lund <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5533>
* zink: rework query handlingMike Blumenkrantz2020-07-131-73/+109
| | | | | | | | | | | | | | | | | 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 <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5533>
* zink: fix missing fallthrough commentTimothy Arceri2020-07-091-0/+1
| | | | | Reviewed-by: Erik Faye-Lund <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5819>
* zink: implement transform feedback support to finish off opengl 3.0Mike Blumenkrantz2020-06-171-19/+70
| | | | | | | | | | | | this adds: * context hooks for gallium stream output methods * handling for xfb-related queries * barrier management for pausing and resuming xfb loosely based on patches originally written by Dave Airlie <[email protected]> Reviewed-by: Erik Faye-Lund <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5163>
* zink: pass batch instead of context for queriesErik Faye-Lund2020-05-251-9/+7
| | | | | | | This makes things a bit more consistent IMO. Reviewed-by: Mike Blumenkrantz <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5141>
* zink: reset query on-demand when beginning a new query from resumeMike Blumenkrantz2020-05-221-0/+1
| | | | | | | | | | | | | | the current query pool implementation expects queries to be reset at the time they're initiated, which means queries started at this point need to also be explicitly reset the zink_begin_query() function can't be reused here or else the query will be double-added to the active list, triggering an infinite loop ref mesa/mesa#3000 Reviewed-by: Erik Faye-Lund <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5120>
* zink: fix vkCmdResetQueryPool usageMike Blumenkrantz2020-05-221-1/+1
| | | | | | | | | | 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 <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5120>
* zink: flush active queries on destroy and free query objectMike Blumenkrantz2020-05-221-7/+20
| | | | | | | | | | | | | queries with a valid active_list pointer are likely to still be active, and vk spec requires them to have completed prior to being destroyed this isn't completely accurate, as it's currently possible for queries to remain in the active list while not actually being active, but it resolves driver crashes that can occur from destroying a stilll-running query pool object Reviewed-by: Erik Faye-Lund <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5120>
* zink: enable conditional rendering if availableDave Airlie2020-05-111-0/+57
| | | | | | | | This doesn't seem to work perfect, but I'm not sure what is possible in GL vs Vulkan here Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2867 Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4835>
* zink: delete query rather than allocating a new oneErik Faye-Lund2019-11-291-1/+1
| | | | | | | | | | It seems I had some fat fingers when writing this function, and I accidentally ended up allocating a new query and immediately trying to delete an uninitialized pool instead of just deleting the pool of the query that was passed. CoverityID: 1455196 Reviewed-by: Dave Airlie <[email protected]>
* HACK: zink: suspend / resume queries on batch-boundariesErik Faye-Lund2019-10-281-33/+128
| | | | | | | HACK because we assert that we don't overrun the pool. We need a fallback here instead. Acked-by: Jordan Justen <[email protected]>
* zink: move set_active_query_state-stub to zink_query.cErik Faye-Lund2019-10-281-0/+6
| | | | Acked-by: Jordan Justen <[email protected]>
* zink: fixup boolean queriesErik Faye-Lund2019-10-281-4/+21
| | | | Acked-by: Jordan Justen <[email protected]>
* zink: crash hard on unknown queriesErik Faye-Lund2019-10-281-2/+5
| | | | Acked-by: Jordan Justen <[email protected]>
* zink: clean up render-pass managementErik Faye-Lund2019-10-281-2/+2
| | | | Acked-by: Jordan Justen <[email protected]>
* zink: implement batchingErik Faye-Lund2019-10-281-11/+5
| | | | | | This reduces stalling quite a bit. Acked-by: Jordan Justen <[email protected]>
* zink: query support (v2)Dave Airlie2019-10-281-0/+147
This at least passes piglit occlusion_query test for me here now. Acked-by: Jordan Justen <[email protected]>