vulkan/include/vulkan_helper.h
2026-04-11 22:27:12 -05:00

19 lines
853 B
C

#pragma once
#include <assert.h>
inline static constexpr VkDeviceSize roundAlignment(VkDeviceSize offset, VkDeviceSize alignment)
{
// must be a power of two
assert(alignment && ((alignment & (alignment - 1)) == 0));
return (offset + (alignment - 1)) & (-alignment);
}
VkDeviceSize allocateFromMemoryRequirements(VkDevice device,
VkPhysicalDeviceMemoryProperties const & physicalDeviceMemoryProperties,
VkMemoryRequirements const & memoryRequirements,
VkMemoryPropertyFlags memoryPropertyFlags,
VkMemoryAllocateFlags memoryAllocateFlags,
uint32_t count,
VkDeviceMemory * memory);