-
-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix texture corruption due to buffer mis-align
This patch ensures that even when the dynamic allocator fulfills an allocation request by returning multiple small blocks, the memory is correctly aligned. This wasn't the case previously, as alignment was only guaranteed to match the block size, so when fulfilling a large allocation with multiple smaller blocks, the memory would be aligned to the smaller block size. The validation triggered by the Vulkan layer before this fix would look like this: VALIDATION [VUID-vkBindImageMemory-memoryOffset-01048 (0)]: vkBindImageMemory(): memoryOffset is 0x43300 but must be an integer multiple of the VkMemoryRequirements::alignment value 0x1000, returned from a call to vkGetImageMemoryRequirements with image. The Vulkan spec states: memoryOffset must be an integer multiple of the alignment member of the VkMemoryRequirements structure returned from a call to vkGetImageMemoryRequirements [...]
- Loading branch information
Showing
1 changed file
with
44 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters