mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-02-01 03:18:26 +00:00
aux/vk: Add functions to initialize and clean up mutexes in the vk_bundle
This commit is contained in:
parent
11bf681e3b
commit
adb5eefb86
|
@ -1152,6 +1152,26 @@ err_destroy:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VkResult
|
||||||
|
vk_init_mutex(struct vk_bundle *vk)
|
||||||
|
{
|
||||||
|
if (os_mutex_init(&vk->cmd_pool_mutex) < 0) {
|
||||||
|
return VK_ERROR_INITIALIZATION_FAILED;
|
||||||
|
}
|
||||||
|
if (os_mutex_init(&vk->queue_mutex) < 0) {
|
||||||
|
return VK_ERROR_INITIALIZATION_FAILED;
|
||||||
|
}
|
||||||
|
return VK_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
VkResult
|
||||||
|
vk_deinit_mutex(struct vk_bundle *vk)
|
||||||
|
{
|
||||||
|
os_mutex_destroy(&vk->cmd_pool_mutex);
|
||||||
|
os_mutex_destroy(&vk->queue_mutex);
|
||||||
|
return VK_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
VkResult
|
VkResult
|
||||||
vk_init_from_given(struct vk_bundle *vk,
|
vk_init_from_given(struct vk_bundle *vk,
|
||||||
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr,
|
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr,
|
||||||
|
|
|
@ -331,6 +331,23 @@ vk_get_loader_functions(struct vk_bundle *vk, PFN_vkGetInstanceProcAddr g);
|
||||||
VkResult
|
VkResult
|
||||||
vk_get_instance_functions(struct vk_bundle *vk);
|
vk_get_instance_functions(struct vk_bundle *vk);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Initialize mutexes in the @ref vk_bundle.
|
||||||
|
*
|
||||||
|
* Not required for all uses, but a precondition for some.
|
||||||
|
*
|
||||||
|
* @ingroup aux_vk
|
||||||
|
*/
|
||||||
|
VkResult
|
||||||
|
vk_init_mutex(struct vk_bundle *vk);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief De-initialize mutexes in the @ref vk_bundle.
|
||||||
|
* @ingroup aux_vk
|
||||||
|
*/
|
||||||
|
VkResult
|
||||||
|
vk_deinit_mutex(struct vk_bundle *vk);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @ingroup aux_vk
|
* @ingroup aux_vk
|
||||||
*/
|
*/
|
||||||
|
@ -464,12 +481,14 @@ vk_create_view_swizzle(struct vk_bundle *vk,
|
||||||
VkImageView *out_view);
|
VkImageView *out_view);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
* @pre Requires successful call to vk_init_mutex
|
||||||
* @ingroup aux_vk
|
* @ingroup aux_vk
|
||||||
*/
|
*/
|
||||||
VkResult
|
VkResult
|
||||||
vk_init_cmd_buffer(struct vk_bundle *vk, VkCommandBuffer *out_cmd_buffer);
|
vk_init_cmd_buffer(struct vk_bundle *vk, VkCommandBuffer *out_cmd_buffer);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
* @pre Requires successful call to vk_init_mutex
|
||||||
* @ingroup aux_vk
|
* @ingroup aux_vk
|
||||||
*/
|
*/
|
||||||
VkResult
|
VkResult
|
||||||
|
@ -483,6 +502,7 @@ vk_set_image_layout(struct vk_bundle *vk,
|
||||||
VkImageSubresourceRange subresource_range);
|
VkImageSubresourceRange subresource_range);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
* @pre Requires successful call to vk_init_mutex
|
||||||
* @ingroup aux_vk
|
* @ingroup aux_vk
|
||||||
*/
|
*/
|
||||||
VkResult
|
VkResult
|
||||||
|
@ -531,6 +551,10 @@ vk_buffer_destroy(struct vk_buffer *self, struct vk_bundle *vk);
|
||||||
bool
|
bool
|
||||||
vk_update_buffer(struct vk_bundle *vk, float *buffer, size_t buffer_size, VkDeviceMemory memory);
|
vk_update_buffer(struct vk_bundle *vk, float *buffer, size_t buffer_size, VkDeviceMemory memory);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @pre Requires successful call to vk_init_mutex
|
||||||
|
* @ingroup aux_vk
|
||||||
|
*/
|
||||||
VkResult
|
VkResult
|
||||||
vk_locked_submit(struct vk_bundle *vk, VkQueue queue, uint32_t count, const VkSubmitInfo *infos, VkFence fence);
|
vk_locked_submit(struct vk_bundle *vk, VkQueue queue, uint32_t count, const VkSubmitInfo *infos, VkFence fence);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue