From 43d924ceaef495d999d10a4b8abee7e6b7ef7a28 Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Mon, 6 Jan 2020 21:33:31 +0100 Subject: [PATCH] vulkan: reset physical device at init don't use PhysicalDeviceProperties2KHR with vulkan 1.0 tentative fix for issue #30 --- core/rend/vulkan/vulkan_context.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/core/rend/vulkan/vulkan_context.cpp b/core/rend/vulkan/vulkan_context.cpp index 215b76953..a5c9b715f 100644 --- a/core/rend/vulkan/vulkan_context.cpp +++ b/core/rend/vulkan/vulkan_context.cpp @@ -144,15 +144,6 @@ bool VulkanContext::InitInstance(const char** extensions, uint32_t extensions_co for (int i = 0; i < extensions_count; i++) vext.push_back(extensions[i]); - bool getProperties2KHRSupported = false; - for (const auto& property : vk::enumerateInstanceExtensionProperties()) - if (!strcmp(property.extensionName, "VK_KHR_get_physical_device_properties2")) - { - getProperties2KHRSupported = true; - vext.push_back("VK_KHR_get_physical_device_properties2"); - break; - } - std::vector layer_names; //layer_names.push_back("VK_LAYER_ARM_AGA"); #ifdef VK_DEBUG @@ -191,6 +182,7 @@ bool VulkanContext::InitInstance(const char** extensions, uint32_t extensions_co #endif // Choose a discrete gpu if there's one, otherwise just pick the first one + physicalDevice = nullptr; const auto devices = instance->enumeratePhysicalDevices(); for (const auto& phyDev : devices) { @@ -206,15 +198,12 @@ bool VulkanContext::InitInstance(const char** extensions, uint32_t extensions_co physicalDevice = instance->enumeratePhysicalDevices().front(); const vk::PhysicalDeviceProperties *properties; - if (vulkan11 || getProperties2KHRSupported) + if (vulkan11) { static vk::PhysicalDeviceProperties2 properties2; vk::PhysicalDeviceMaintenance3Properties properties3; properties2.pNext = &properties3; - if (vulkan11) - physicalDevice.getProperties2(&properties2); - else - physicalDevice.getProperties2KHR(&properties2); + physicalDevice.getProperties2(&properties2); properties = &properties2.properties; maxMemoryAllocationSize = properties3.maxMemoryAllocationSize; if (maxMemoryAllocationSize == 0)