diff --git a/src/dawn_native/vulkan/BackendVk.cpp b/src/dawn_native/vulkan/BackendVk.cpp index 0a68231e7b..613f0a0126 100644 --- a/src/dawn_native/vulkan/BackendVk.cpp +++ b/src/dawn_native/vulkan/BackendVk.cpp @@ -231,7 +231,17 @@ namespace dawn_native { namespace vulkan { appInfo.applicationVersion = 0; appInfo.pEngineName = nullptr; appInfo.engineVersion = 0; - appInfo.apiVersion = mGlobalInfo.apiVersion; + // Vulkan 1.0 implementations were required to return VK_ERROR_INCOMPATIBLE_DRIVER if + // apiVersion was larger than 1.0. Meanwhile, as long as the instance supports at least + // Vulkan 1.1, an application can use different versions of Vulkan with an instance than + // it does with a device or physical device. So we should set apiVersion to Vulkan 1.0 + // if the instance only supports Vulkan 1.0. Otherwise we set apiVersion to Vulkan 1.2, + // treat 1.2 as the highest API version dawn targets. + if (mGlobalInfo.apiVersion == VK_MAKE_VERSION(1, 0, 0)) { + appInfo.apiVersion = mGlobalInfo.apiVersion; + } else { + appInfo.apiVersion = VK_MAKE_VERSION(1, 2, 0); + } VkInstanceCreateInfo createInfo; createInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;