2020-03-13 12:44:33 +01:00
|
|
|
#include "VulkanAllocator.h"
|
|
|
|
|
#include "VulkanGraphics.h"
|
|
|
|
|
Seele::VulkanAllocator::VulkanAllocator(PVulkanGraphics graphics)
|
|
|
|
|
: graphics(graphics)
|
|
|
|
|
{
|
|
|
|
|
vkGetPhysicalDeviceMemoryProperties(graphics->getPhysicalDevice(), &memProperties);
|
|
|
|
|
heaps.resize(memProperties.memoryHeapCount);
|
|
|
|
|
for (size_t i = 0; i < memProperties.memoryHeapCount; i++)
|
|
|
|
|
{
|
2020-03-16 13:29:17 +01:00
|
|
|
VkMemoryHeap memoryHeap = memProperties.memoryHeaps[i];
|
|
|
|
|
HeapInfo& heapInfo = heaps[i];
|
|
|
|
|
heapInfo.maxSize = memoryHeap.size;
|
2020-03-13 12:44:33 +01:00
|
|
|
}
|
|
|
|
|
for (size_t i = 0; i < memProperties.memoryTypeCount; i++)
|
|
|
|
|
{
|
|
|
|
|
VkMemoryType& type = memProperties.memoryTypes[i];
|
2020-03-16 13:29:17 +01:00
|
|
|
HeapInfo& heapInfo = heaps[type.heapIndex];
|
|
|
|
|
heapInfo.types.add(type);
|
2020-03-13 12:44:33 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Seele::VulkanAllocator::~VulkanAllocator()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Seele::PVulkanSubAllocation Seele::VulkanAllocator::allocate(uint64 size, VkMemoryPropertyFlags properties)
|
|
|
|
|
{
|
|
|
|
|
return PVulkanSubAllocation();
|
|
|
|
|
}
|