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.
This commit is contained in:
Lynne
2026-08-04 02:57:47 +09:00
parent 9548d68e5b
commit eed19eefda

View File

@@ -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;