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 (struct vk_bundle *vk, struct vk_cmd_pool *pool, VkCommandPoolCreateFlags flags) |
Create a command buffer pool. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
Static Public Member Functions | |
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. More... | |
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. More... | |
static void | vk_cmd_pool_unlock (struct vk_cmd_pool *pool) |
Unlock the command pool. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
Data Fields | |
VkCommandPool | pool |
struct os_mutex | 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.
References vk_cmd_pool_create_and_begin_cmd_buffer_locked(), vk_cmd_pool_lock(), and vk_cmd_pool_unlock().
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.
References vk_cmd_pool_create_cmd_buffer_locked().
Referenced by vk_cmd_pool_create_and_begin_cmd_buffer().
|
inlinestatic |
Locks, calls vk_cmd_pool_create_cmd_buffer_locked, and then unlocks the command pool.
References vk_cmd_pool_create_cmd_buffer_locked(), vk_cmd_pool_lock(), and vk_cmd_pool_unlock().
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.
Referenced by vk_cmd_pool_create_and_begin_cmd_buffer_locked(), and vk_cmd_pool_create_cmd_buffer().
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, and os_mutex::os_mutex_destroy().
Referenced by comp_swapchain_shared_destroy(), and render_resources::render_resources_close().
|
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.
References vk_cmd_pool_end_submit_wait_and_free_cmd_buffer_locked(), vk_cmd_pool_lock(), and vk_cmd_pool_unlock().
|
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 vk_cmd_pool_end_submit_wait_and_free_cmd_buffer().
XRT_CHECK_RESULT VkResult vk_cmd_pool_init | ( | struct vk_bundle * | vk, |
struct vk_cmd_pool * | pool, | ||
VkCommandPoolCreateFlags | flags | ||
) |
Create a command buffer pool.
Referenced by comp_swapchain_shared_init().
|
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 vk_cmd_pool_create_and_begin_cmd_buffer(), vk_cmd_pool_create_cmd_buffer(), vk_cmd_pool_end_submit_wait_and_free_cmd_buffer(), vk_cmd_pool_submit(), and vk_cmd_pool_submit_cmd_buffer().
|
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_pool_lock(), vk_cmd_pool_unlock(), and 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.
References vk_cmd_pool_lock(), vk_cmd_pool_submit_cmd_buffer_locked(), and vk_cmd_pool_unlock().
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().
Referenced by vk_cmd_pool_submit_cmd_buffer().
|
inlinestatic |
Unlock the command pool.
References pool::mutex, and os_mutex::os_mutex_unlock().
Referenced by vk_cmd_pool_create_and_begin_cmd_buffer(), vk_cmd_pool_create_cmd_buffer(), vk_cmd_pool_end_submit_wait_and_free_cmd_buffer(), vk_cmd_pool_submit(), and vk_cmd_pool_submit_cmd_buffer().