mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
vulkan: Add wait functions
vulkan_wait_idle waits until the device is idle and all referenced objects can be destroyed. vulkan_wait_fence waits until a fence is triggered by a finished queueSubmit. vulkan: wait on fence
This commit is contained in:
parent
0bb662f2e7
commit
2068972bb3
2 changed files with 17 additions and 0 deletions
|
|
@ -435,6 +435,20 @@ int vulkan_vkresult_to_errno(VkResult result)
|
|||
return vkresult_to_errno(result);
|
||||
}
|
||||
|
||||
int vulkan_wait_fence(struct vulkan_base *s, VkFence fence)
|
||||
{
|
||||
VK_CHECK_RESULT(vkWaitForFences(s->device, 1, &fence, VK_TRUE, UINT64_MAX));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int vulkan_wait_idle(struct vulkan_base *s)
|
||||
{
|
||||
VK_CHECK_RESULT(vkDeviceWaitIdle(s->device));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int vulkan_base_init(struct vulkan_base *s, struct vulkan_base_info *info)
|
||||
{
|
||||
if (!s->initialized) {
|
||||
|
|
|
|||
|
|
@ -52,5 +52,8 @@ VkFormat vulkan_id_to_vkformat(uint32_t id);
|
|||
|
||||
int vulkan_vkresult_to_errno(VkResult result);
|
||||
|
||||
int vulkan_wait_fence(struct vulkan_base *s, VkFence fence);
|
||||
int vulkan_wait_idle(struct vulkan_base *s);
|
||||
|
||||
int vulkan_base_init(struct vulkan_base *s, struct vulkan_base_info *info);
|
||||
void vulkan_base_deinit(struct vulkan_base *s);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue