summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-03-10 08:58:34 +0100
committerRémi Verschelde <rverschelde@gmail.com>2020-03-10 08:58:34 +0100
commitf70b5fa30cd91f0375b43efae7de5d9d7151130c (patch)
treeaf3bb12d139d68f7855afd073909191f58625973 /drivers
parent17c3c223dcb93ea1be506afd115b8c8030bdfc33 (diff)
Revert "Enhanced physical device selection to use device type and available memory in relation to issue #35397"
This reverts commit 4f3006e5ac30d00b90eb531f3bdfd4bfa0d4025b.
Diffstat (limited to 'drivers')
-rw-r--r--drivers/vulkan/vulkan_context.cpp35
1 files changed, 2 insertions, 33 deletions
diff --git a/drivers/vulkan/vulkan_context.cpp b/drivers/vulkan/vulkan_context.cpp
index 3a1ab0cf56..c8ff342713 100644
--- a/drivers/vulkan/vulkan_context.cpp
+++ b/drivers/vulkan/vulkan_context.cpp
@@ -356,39 +356,8 @@ Error VulkanContext::_create_physical_device() {
free(physical_devices);
ERR_FAIL_V(ERR_CANT_CREATE);
}
-
- /*Find the first discrete GPU with the most VRAM.*/
- {
- print_line("Selecting primary GPU.");
- VkPhysicalDeviceProperties device_properties;
- VkPhysicalDeviceMemoryProperties memory_properties;
- gpu = physical_devices[0];
- uint32_t largest_vram_size = 0;
- VkPhysicalDeviceType gpu_type = VK_PHYSICAL_DEVICE_TYPE_OTHER;
- for (uint32_t i = 0; i < gpu_count; i++) {
- vkGetPhysicalDeviceProperties(physical_devices[i], &device_properties);
-
- /*Skip virtual and CPU devices for now.*/
- if (device_properties.deviceType > VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU) {
- continue;
- }
-
- vkGetPhysicalDeviceMemoryProperties(physical_devices[i], &memory_properties);
-
- /*Total all heaps in case of 3GB+1GB configurations and similar.*/
- uint32_t memory_size = 0;
- for (uint32_t j = 0; j < memory_properties.memoryHeapCount; j++) {
- memory_size += memory_properties.memoryHeaps[j].size;
- }
-
- if ((device_properties.deviceType >= gpu_type) || (device_properties.deviceType == gpu_type && memory_size > largest_vram_size)) {
- gpu = physical_devices[i];
- gpu_type = device_properties.deviceType;
- largest_vram_size = memory_size;
- print_line(device_properties.deviceName);
- }
- }
- }
+ /* for now, just grab the first physical device */
+ gpu = physical_devices[0];
free(physical_devices);
/* Look for device extensions */