Skip to content

Commit

Permalink
Hacked buffer memory alignment for the iOS/tvOS simulator
Browse files Browse the repository at this point in the history
When running in the iOS/tvOS simulator, constant buffer offsets must be
aligned to 256 bytes. `vkGetBufferMemoryRequirements` is reporting the
wrong alignement in this case. see: KhronosGroup/MoltenVK#1250
  • Loading branch information
George Dorobantu committed Feb 10, 2021
1 parent 4db97b9 commit 2e24f4c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/vk_mem_alloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -15196,6 +15196,10 @@ void VmaAllocator_T::GetBufferMemoryRequirements(
requiresDedicatedAllocation = false;
prefersDedicatedAllocation = false;
}
#if TARGET_OS_SIMULATOR
// See: https://github.com/KhronosGroup/MoltenVK/issues/1250
memReq.alignment = 256;
#endif
}

void VmaAllocator_T::GetImageMemoryRequirements(
Expand Down

0 comments on commit 2e24f4c

Please sign in to comment.