|
Monado OpenXR Runtime
|
Small helper to manage lock around a command pool. More...
#include <vk/vk_cmd_pool.h>

Public Member Functions | |
| XRT_CHECK_RESULT VkResult | vk_cmd_pool_init_for_queue (struct vk_bundle *vk, struct vk_cmd_pool *pool, VkCommandPoolCreateFlags flags, struct vk_bundle_queue *queue) |
| Create a command buffer pool. | |
| void | vk_cmd_pool_destroy (struct vk_bundle *vk, struct vk_cmd_pool *pool) |
| Destroy a command buffer pool, lock must not be held, externally synchronizable with all other pool commands. | |
| XRT_CHECK_RESULT VkResult | vk_cmd_pool_create_cmd_buffer_locked (struct vk_bundle *vk, struct vk_cmd_pool *pool, VkCommandBuffer *out_cmd_buffer) |
| Create a command buffer, call with the pool mutex held. | |
| XRT_CHECK_RESULT VkResult | vk_cmd_pool_create_and_begin_cmd_buffer_locked (struct vk_bundle *vk, struct vk_cmd_pool *pool, VkCommandBufferUsageFlags flags, VkCommandBuffer *out_cmd_buffer) |
| Create a command buffer and also begin it, call with the pool mutex held. | |
| XRT_CHECK_RESULT VkResult | vk_cmd_pool_submit_cmd_buffer_locked (struct vk_bundle *vk, struct vk_cmd_pool *pool, VkCommandBuffer cmd_buffer) |
| Submit to the vulkan queue, will take the queue mutex. | |
Static Public Member Functions | |
| static XRT_CHECK_RESULT VkResult | vk_cmd_pool_init (struct vk_bundle *vk, struct vk_cmd_pool *pool, VkCommandPoolCreateFlags flags) |
| Create a command buffer pool. | |
| static XRT_CHECK_RESULT VkResult | vk_cmd_pool_end_submit_wait_and_free_cmd_buffer_locked (struct vk_bundle *vk, struct vk_cmd_pool *pool, VkCommandBuffer cmd_buffer) |
| A do everything submit function, will take the queue mutex. | |
| static void | vk_cmd_pool_lock (struct vk_cmd_pool *pool) |
| Lock the command pool, needed for creating command buffers, filling out commands on any command buffers created from this pool and submitting any command buffers created from this pool to a VkQueue. | |
| static void | vk_cmd_pool_unlock (struct vk_cmd_pool *pool) |
| Unlock the command pool. | |
| static XRT_CHECK_RESULT VkResult | vk_cmd_pool_create_cmd_buffer (struct vk_bundle *vk, struct vk_cmd_pool *pool, VkCommandBuffer *out_cmd_buffer) |
| Locks, calls vk_cmd_pool_create_cmd_buffer_locked, and then unlocks the command pool. | |
| static XRT_CHECK_RESULT VkResult | vk_cmd_pool_create_and_begin_cmd_buffer (struct vk_bundle *vk, struct vk_cmd_pool *pool, VkCommandBufferUsageFlags flags, VkCommandBuffer *out_cmd_buffer) |
| Locks, calls vk_cmd_pool_create_and_begin_cmd_buffer_locked, and then unlocks the command pool. | |
| static XRT_CHECK_RESULT VkResult | vk_cmd_pool_submit (struct vk_bundle *vk, struct vk_cmd_pool *pool, uint32_t count, const VkSubmitInfo *infos, VkFence fence) |
| Locks, calls vk_cmd_submit_locked, and then unlocks the command pool. | |
| static XRT_CHECK_RESULT VkResult | vk_cmd_pool_submit_cmd_buffer (struct vk_bundle *vk, struct vk_cmd_pool *pool, VkCommandBuffer cmd_buffer) |
| Locks, calls vk_cmd_pool_submit_cmd_buffer_locked, and then unlocks the command pool. | |
| static XRT_CHECK_RESULT VkResult | vk_cmd_pool_end_submit_wait_and_free_cmd_buffer (struct vk_bundle *vk, struct vk_cmd_pool *pool, VkCommandBuffer cmd_buffer) |
| Locks, calls vk_cmd_pool_end_submit_wait_and_free_cmd_buffer_locked, and then unlocks the command pool. | |
Data Fields | |
| VkCommandPool | pool |
| The command pool for command buffers. | |
| struct vk_bundle_queue * | queue |
| Queue (family) associated with vk_cmd_pool::pool,. | |
| struct os_mutex | mutex |
| Command Pool mutex. | |
Small helper to manage lock around a command pool.
|
inlinestatic |
Locks, calls vk_cmd_pool_create_and_begin_cmd_buffer_locked, and then unlocks the command pool.
| XRT_CHECK_RESULT VkResult vk_cmd_pool_create_and_begin_cmd_buffer_locked | ( | struct vk_bundle * | vk, |
| struct vk_cmd_pool * | pool, | ||
| VkCommandBufferUsageFlags | flags, | ||
| VkCommandBuffer * | out_cmd_buffer | ||
| ) |
Create a command buffer and also begin it, call with the pool mutex held.
Referenced by comp_mirror_to_debug_gui::comp_mirror_do_blit(), and do_post_create_vulkan_setup().
|
inlinestatic |
Locks, calls vk_cmd_pool_create_cmd_buffer_locked, and then unlocks the command pool.
| XRT_CHECK_RESULT VkResult vk_cmd_pool_create_cmd_buffer_locked | ( | struct vk_bundle * | vk, |
| struct vk_cmd_pool * | pool, | ||
| VkCommandBuffer * | out_cmd_buffer | ||
| ) |
Create a command buffer, call with the pool mutex held.
| void vk_cmd_pool_destroy | ( | struct vk_bundle * | vk, |
| struct vk_cmd_pool * | pool | ||
| ) |
Destroy a command buffer pool, lock must not be held, externally synchronizable with all other pool commands.
References pool::mutex.
|
inlinestatic |
Locks, calls vk_cmd_pool_end_submit_wait_and_free_cmd_buffer_locked, and then unlocks the command pool.
Will during the call take the queue lock and release it.
|
inlinestatic |
A do everything submit function, will take the queue mutex.
Will create a fence and wait on the commands to complete. Will also end and destroy the passed in command buffer.
Calls:
References vk_cmd_end_submit_wait_and_free_cmd_buffer_locked().
Referenced by do_post_create_vulkan_setup().
|
inlinestatic |
Create a command buffer pool.
References vk_bundle::main_queue.
| XRT_CHECK_RESULT VkResult vk_cmd_pool_init_for_queue | ( | struct vk_bundle * | vk, |
| struct vk_cmd_pool * | pool, | ||
| VkCommandPoolCreateFlags | flags, | ||
| struct vk_bundle_queue * | queue | ||
| ) |
Create a command buffer pool.
References vk_bundle_queue::family_index, and pool::mutex.
|
inlinestatic |
Lock the command pool, needed for creating command buffers, filling out commands on any command buffers created from this pool and submitting any command buffers created from this pool to a VkQueue.
References pool::mutex, and os_mutex::os_mutex_lock().
Referenced by comp_mirror_to_debug_gui::comp_mirror_do_blit(), and do_post_create_vulkan_setup().
|
inlinestatic |
Locks, calls vk_cmd_submit_locked, and then unlocks the command pool.
Will, during the call, take the queue lock and release it.
References vk_cmd_submit_locked().
|
inlinestatic |
Locks, calls vk_cmd_pool_submit_cmd_buffer_locked, and then unlocks the command pool.
Will during the call take the queue lock and release it.
| XRT_CHECK_RESULT VkResult vk_cmd_pool_submit_cmd_buffer_locked | ( | struct vk_bundle * | vk, |
| struct vk_cmd_pool * | pool, | ||
| VkCommandBuffer | cmd_buffer | ||
| ) |
Submit to the vulkan queue, will take the queue mutex.
References vk_cmd_submit_locked().
|
inlinestatic |
Unlock the command pool.
References pool::mutex, and os_mutex::os_mutex_unlock().
Referenced by comp_mirror_to_debug_gui::comp_mirror_do_blit(), and do_post_create_vulkan_setup().
| struct os_mutex vk_cmd_pool::mutex |
Command Pool mutex.
| VkCommandPool vk_cmd_pool::pool |
The command pool for command buffers.
Referenced by client_vk_compositor::client_vk_compositor_create(), comp_mirror_to_debug_gui::comp_mirror_init(), and render_resources::render_resources_init().
| struct vk_bundle_queue* vk_cmd_pool::queue |
Queue (family) associated with vk_cmd_pool::pool,.
weak reference to any queue in vk_bundle (e.g. vk_bundle::[graphics|compute]_queue) should not live longer than the vk_bundle instance.