aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLynne <dev@lynne.ee>2021-11-12 13:05:42 +0100
committerLynne <dev@lynne.ee>2021-11-12 14:45:17 +0100
commit57e11321ea378a57a909d817c2fcf2ebcaf8c123 (patch)
tree78c472041b0999fdf9ea237c1086dc25315c78bb
parentec6187b05be51f93af303db3f4364010fe16fee0 (diff)
downloadffmpeg-57e11321ea378a57a909d817c2fcf2ebcaf8c123.tar.gz
hwcontext_vulkan: use vkDeviceWaitIdle instead of vkWaitSemaphores on uninit
To silence a possible validation layer bug, switch the function. It only gets triggered by vf_libplacebo, which is odd.
-rw-r--r--libavutil/hwcontext_vulkan.c12
-rw-r--r--libavutil/vulkan_functions.h1
2 files changed, 4 insertions, 9 deletions
diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index 93a304ca95..6e746d4aa4 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -1589,15 +1589,9 @@ static void vulkan_frame_free(void *opaque, uint8_t *data)
FFVulkanFunctions *vk = &p->vkfn;
int planes = av_pix_fmt_count_planes(hwfc->sw_format);
- VkSemaphoreWaitInfo wait_info = {
- .sType = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO,
- .flags = 0x0,
- .pSemaphores = f->sem,
- .pValues = f->sem_value,
- .semaphoreCount = planes,
- };
-
- vk->WaitSemaphores(hwctx->act_dev, &wait_info, UINT64_MAX);
+ /* We could use vkWaitSemaphores, but the validation layer seems to have
+ * issues tracking command buffer execution state on uninit. */
+ vk->DeviceWaitIdle(hwctx->act_dev);
vulkan_free_internal(f->internal);
diff --git a/libavutil/vulkan_functions.h b/libavutil/vulkan_functions.h
index de2054e0c2..913667befb 100644
--- a/libavutil/vulkan_functions.h
+++ b/libavutil/vulkan_functions.h
@@ -47,6 +47,7 @@ typedef enum FFVulkanExtensions {
MACRO(1, 0, FF_VK_EXT_NO_FLAG, CreateDevice) \
MACRO(1, 0, FF_VK_EXT_NO_FLAG, GetPhysicalDeviceFeatures2) \
MACRO(1, 0, FF_VK_EXT_NO_FLAG, GetPhysicalDeviceProperties) \
+ MACRO(1, 0, FF_VK_EXT_NO_FLAG, DeviceWaitIdle) \
MACRO(1, 0, FF_VK_EXT_NO_FLAG, DestroyDevice) \
\
MACRO(1, 0, FF_VK_EXT_NO_FLAG, EnumeratePhysicalDevices) \