From eed19eefdaa605d02ff0795c9e7e82ca46636f99 Mon Sep 17 00:00:00 2001 From: Lynne Date: Tue, 4 Aug 2026 02:57:47 +0900 Subject: [PATCH] vulkan: use only coherency to flush mapped memory when needed Host map'd bufs skipped flushes unconditionally, always forcing the coherent flag regardless of the memory type actually chosen for the import. All known implementations import host memory as coherent, in which case nothing changes. --- libavutil/vulkan.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c index 0b7effcc58..568e77f90d 100644 --- a/libavutil/vulkan.c +++ b/libavutil/vulkan.c @@ -1161,7 +1161,7 @@ int ff_vk_flush_buffer(FFVulkanContext *s, FFVkBuffer *buf, VkResult ret; FFVulkanFunctions *vk = &s->vkfn; - if (buf->host_ref || buf->flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) + if (buf->flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) return 0; const VkMappedMemoryRange flush_data = { @@ -1434,7 +1434,6 @@ int ff_vk_host_map_buffer(FFVulkanContext *s, FFVkBuffer **dst, vkb->address += offs; vkb->mapped_mem = src_data; vkb->size = buffer_size - offs; - vkb->flags |= VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; *dst = vkb;