mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-07-06 13:15:59 +00:00
Vulkan: Set apiVersion dawn targets
Set apiVersion to Vulkan 1.0 if the instance only supports Vulkan 1.0. Otherwise set apiVersion to Vulkan 1.2, treat 1.2 as the highest API version dawn targets. Bug: dawn:426 Change-Id: I322eaa0a93a518df36b86717c2ed5a98c5d056ea Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25065 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Xinghua Cao <xinghua.cao@intel.com>
This commit is contained in:
parent
d0dd661f18
commit
92ebe87b74
@ -231,7 +231,17 @@ namespace dawn_native { namespace vulkan {
|
||||
appInfo.applicationVersion = 0;
|
||||
appInfo.pEngineName = nullptr;
|
||||
appInfo.engineVersion = 0;
|
||||
// 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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user