mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-11-22 17:19:18 +01:00
Vulkan: Retry instance creation if validation layer is not present (#909)
This commit is contained in:
parent
7111cbb103
commit
1d1e1e781b
@ -350,7 +350,15 @@ VulkanRenderer::VulkanRenderer()
|
|||||||
create_info.ppEnabledLayerNames = m_layerNames.data();
|
create_info.ppEnabledLayerNames = m_layerNames.data();
|
||||||
create_info.enabledLayerCount = m_layerNames.size();
|
create_info.enabledLayerCount = m_layerNames.size();
|
||||||
|
|
||||||
if ((err = vkCreateInstance(&create_info, nullptr, &m_instance)) != VK_SUCCESS)
|
err = vkCreateInstance(&create_info, nullptr, &m_instance);
|
||||||
|
|
||||||
|
if (err == VK_ERROR_LAYER_NOT_PRESENT) {
|
||||||
|
cemuLog_log(LogType::Force, "Failed to enable vulkan validation (VK_LAYER_KHRONOS_validation)");
|
||||||
|
create_info.enabledLayerCount = 0;
|
||||||
|
err = vkCreateInstance(&create_info, nullptr, &m_instance);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (err != VK_SUCCESS)
|
||||||
throw std::runtime_error(fmt::format("Unable to create a Vulkan instance: {}", err));
|
throw std::runtime_error(fmt::format("Unable to create a Vulkan instance: {}", err));
|
||||||
|
|
||||||
if (!InitializeInstanceVulkan(m_instance))
|
if (!InitializeInstanceVulkan(m_instance))
|
||||||
|
Loading…
Reference in New Issue
Block a user