diff options
author | Lynne <dev@lynne.ee> | 2022-12-22 05:03:32 +0100 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2023-05-29 00:41:47 +0200 |
commit | 6eaf3fe69cc18739e9f2cc54418cf29c1d2c113c (patch) | |
tree | 6146c0b8db7d3798c2e399efbb416039e7a620ee /libavutil/vulkan.h | |
parent | f3fb1b50bba09d0a3e8583102b663a348cd92220 (diff) | |
download | ffmpeg-6eaf3fe69cc18739e9f2cc54418cf29c1d2c113c.tar.gz |
vulkan: add support for queries
Diffstat (limited to 'libavutil/vulkan.h')
-rw-r--r-- | libavutil/vulkan.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/libavutil/vulkan.h b/libavutil/vulkan.h index a17cc4a34e..4bd1c9fc00 100644 --- a/libavutil/vulkan.h +++ b/libavutil/vulkan.h @@ -168,6 +168,19 @@ typedef struct FFVkExecContext { VkCommandBuffer *bufs; FFVkQueueCtx *queues; + struct { + int idx; + VkQueryPool pool; + uint8_t *data; + + int nb_queries; + int nb_results; + int nb_statuses; + int elem_64bits; + size_t data_per_queue; + int status_stride; + } query; + AVBufferRef ***deps; int *nb_deps; int *dep_alloc_size; @@ -372,6 +385,23 @@ int ff_vk_create_exec_ctx(FFVulkanContext *s, FFVkExecContext **ctx, FFVkQueueFamilyCtx *qf); /** + * Create a query pool for a command context. + * elem_64bits exists to troll driver devs for compliance. All results + * and statuses returned should be 32 bits, unless this is set, then it's 64bits. + */ +int ff_vk_create_exec_ctx_query_pool(FFVulkanContext *s, FFVkExecContext *e, + int nb_queries, VkQueryType type, + int elem_64bits, void *create_pnext); + +/** + * Get results for query. + * Returns the status of the query. + * Sets *res to the status of the queries. + */ +int ff_vk_get_exec_ctx_query_results(FFVulkanContext *s, FFVkExecContext *e, + int query_idx, void **data, int64_t *status); + +/** * Begin recording to the command buffer. Previous execution must have been * completed, which ff_vk_submit_exec_queue() will ensure. */ |