Vulkan-ValidationLayers icon indicating copy to clipboard operation
Vulkan-ValidationLayers copied to clipboard

VkMemoryAllocateInfo dedicated allocation related VUs are incorrectly validated at vkBind*Memory time

Open aqnuep opened this issue 8 months ago • 2 comments

There are certain VUs, such as VUID-VkMemoryAllocateInfo-pNext-00639 that are validated at vkBind*Memory time even though they should be validated in vkAllocateMemory, because the VUs belong to VkMemoryAllocateInfo.

The validation code even "justifies it" in comments:

        // Validate VkExportMemoryAllocateInfo's VUs that can't be checked during vkAllocateMemory
        // because they require buffer information.

However, that is not really true, certainly not for VUID-VkMemoryAllocateInfo-pNext-00639, because buffer information is readily available during vkAllocateMemory, as the VkMemoryDedicatedAllocateInfo structure includes the buffer/image handles the dedicated allocations are created for.

aqnuep avatar Aug 08 '25 13:08 aqnuep

agree this should be done at vkAllocateMemory because for export memory, the dedicated buffer/image is known

@aqnuep curious how this was hit, was something failing in the driver at vkAllocateMemory time and VVL was not catching it early enough?

spencer-lunarg avatar Aug 14 '25 15:08 spencer-lunarg

I just randomly ran into it in the validation source code :)

aqnuep avatar Aug 14 '25 16:08 aqnuep