vkAllocateMemory says:
Allocations returned by vkAllocateMemory are guaranteed to meet any alignment requirement of the implementation.
But in some cases, the alignments are required by the spec itself and happen to be higher than this maximum implementation alignment requirement.
An example of this is:
VUID-VkAccelerationStructureCreateInfo2KHR-addressRange-11605
addressRange.address must be a multiple of 256 bytes
If the implementation doesn't require a min alignment >= 256 for anything, the allocated memory may not be aligned to 256 bytes.
This means a simple alignment of the offset within the memory is no longer sufficient.
Currently, the only way to avoid this problem is to overallocate by alignment - 1 and manually pad the device address.
vkAllocateMemorysays:But in some cases, the alignments are required by the spec itself and happen to be higher than this maximum implementation alignment requirement.
An example of this is:
If the implementation doesn't require a min alignment >= 256 for anything, the allocated memory may not be aligned to 256 bytes.
This means a simple alignment of the offset within the memory is no longer sufficient.
Currently, the only way to avoid this problem is to overallocate by
alignment - 1and manually pad the device address.