Optimizing Array add performance for large datasets
This commit is contained in:
@@ -7,12 +7,15 @@ Seele::VulkanAllocator::VulkanAllocator(PVulkanGraphics graphics)
|
||||
heaps.resize(memProperties.memoryHeapCount);
|
||||
for (size_t i = 0; i < memProperties.memoryHeapCount; i++)
|
||||
{
|
||||
std::cout << "Heap: Flags: " << memProperties.memoryHeaps[i].flags << " Size: " << memProperties.memoryHeaps[i].size << std::endl;
|
||||
VkMemoryHeap memoryHeap = memProperties.memoryHeaps[i];
|
||||
HeapInfo& heapInfo = heaps[i];
|
||||
heapInfo.maxSize = memoryHeap.size;
|
||||
}
|
||||
for (size_t i = 0; i < memProperties.memoryTypeCount; i++)
|
||||
{
|
||||
VkMemoryType& type = memProperties.memoryTypes[i];
|
||||
std::cout << "Memory Type: Properties" << type.propertyFlags << " on Index: " << type.heapIndex << std::endl;
|
||||
HeapInfo& heapInfo = heaps[type.heapIndex];
|
||||
heapInfo.types.add(type);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,27 @@ void Seele::VulkanGraphics::pickPhysicalDevice()
|
||||
uint32 deviceRating = 0;
|
||||
for (auto physicalDevice : physicalDevices)
|
||||
{
|
||||
uint32 currentRating = 0;
|
||||
VkPhysicalDeviceProperties props;
|
||||
vkGetPhysicalDeviceProperties(physicalDevice, &props);
|
||||
if (props.deviceType == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU)
|
||||
{
|
||||
currentRating += 100;
|
||||
}
|
||||
else if (props.deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU)
|
||||
{
|
||||
currentRating += 10;
|
||||
}
|
||||
if (currentRating > deviceRating)
|
||||
{
|
||||
deviceRating = currentRating;
|
||||
bestDevice = physicalDevice;
|
||||
}
|
||||
}
|
||||
this->physicalDevice = bestDevice;
|
||||
}
|
||||
|
||||
void Seele::VulkanGraphics::createDevice()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace Seele
|
||||
void initInstance(GraphicsInitializer initInfo);
|
||||
void setupDebugCallback();
|
||||
void pickPhysicalDevice();
|
||||
void createDevice();
|
||||
|
||||
VkDevice handle;
|
||||
VkPhysicalDevice physicalDevice;
|
||||
|
||||
Reference in New Issue
Block a user