[dxvk] Request Vulkan 1.1 instance

Falls back to a regular 1.0 instance on old drivers.
We need to do this in order to legally use SPIR-V 1.3.
This commit is contained in:
Philip Rebohle 2018-11-07 19:39:38 +01:00
parent 59d0ad4413
commit 67e10246cb
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
1 changed files with 11 additions and 2 deletions

View File

@ -73,7 +73,7 @@ namespace dxvk {
appInfo.applicationVersion = 0;
appInfo.pEngineName = "DXVK";
appInfo.engineVersion = VK_MAKE_VERSION(0, 9, 2);
appInfo.apiVersion = 0;
appInfo.apiVersion = VK_MAKE_VERSION(1, 1, 0);
VkInstanceCreateInfo info;
info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
@ -86,8 +86,17 @@ namespace dxvk {
info.ppEnabledExtensionNames = extensionNameList.names();
VkInstance result = VK_NULL_HANDLE;
if (m_vkl->vkCreateInstance(&info, nullptr, &result) != VK_SUCCESS)
VkResult status = m_vkl->vkCreateInstance(&info, nullptr, &result);
if (status == VK_ERROR_INCOMPATIBLE_DRIVER) {
Logger::warn("Failed to create Vulkan 1.1 instance, falling back to 1.0");
appInfo.apiVersion = 0; /* some very old drivers may not accept 1.0 */
status = m_vkl->vkCreateInstance(&info, nullptr, &result);
}
if (status != VK_SUCCESS)
throw DxvkError("DxvkInstance::createInstance: Failed to create Vulkan instance");
return result;
}