From a31cd75c73eb5e0642c39446653be9f8088c085f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Wed, 29 Mar 2023 12:58:14 +0200 Subject: [PATCH] vkmemory: flush whole size Running element_vkcolorconver test with Vulkan validation layer this error is raised: Code 0 : Validation Error: [ VUID-VkMappedMemoryRange-size-01390 ] Object 0: handle = 0x100000000010, type = VK_OBJECT_TYPE_DEVICE_MEMORY; | MessageID = 0xdd4e6d8b | vkFlushMappedMemoryRanges: Size in pMemRanges[0] is 0x4, which is not a multiple of VkPhysicalDeviceLimits::nonCoherentAtomSize (0x40) and offset + size (0x0 + 0x4 = 0x4) not equal to the memory size (0xb). The Vulkan spec states: If size is not equal to VK_WHOLE_SIZE, size must either be a multiple of VkPhysicalDeviceLimits::nonCoherentAtomSize, or offset plus size must equal the size of memory The reason of is that the image size used in the test doesn't comply hardware restrictions. In order to avoid juggling with image size and hardware restrictions, this patch proposes to use VK_WHOLE_SIZE macro. Part-of: --- subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkmemory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkmemory.c b/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkmemory.c index 5bec9213e6..18bd5b316f 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkmemory.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkmemory.c @@ -151,7 +151,7 @@ _vk_mem_unmap_full (GstVulkanMemory * mem, GstMapInfo * info) /* .pNext = */ .memory = mem->mem_ptr, .offset = mem->vk_offset, - .size = mem->mem.size, + .size = VK_WHOLE_SIZE, }; err = vkFlushMappedMemoryRanges (mem->device->device, 1u, &range);