diff options
author | Jason Ekstrand <[email protected]> | 2016-02-25 08:52:35 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-02-25 08:52:37 -0800 |
commit | c32273d246e8bf46924d8852d1b3fd1d34194df2 (patch) | |
tree | dacc55f2e5682b2885bc77e21afc316159ee1d96 /src/intel/vulkan/anv_device.c | |
parent | 59f57289959702e528b68bdd0d06488089517a00 (diff) |
anv/device: Properly handle apiVersion == 0
From the Vulkan 1.0 spec section 3.2:
"If apiVersion is 0 the implementation must ignore it"
Diffstat (limited to 'src/intel/vulkan/anv_device.c')
-rw-r--r-- | src/intel/vulkan/anv_device.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 7a5cb234ac5..59930552f59 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -214,9 +214,14 @@ VkResult anv_CreateInstance( assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO); - uint32_t client_version = pCreateInfo->pApplicationInfo ? - pCreateInfo->pApplicationInfo->apiVersion : - VK_MAKE_VERSION(1, 0, 0); + uint32_t client_version; + if (pCreateInfo->pApplicationInfo && + pCreateInfo->pApplicationInfo->apiVersion != 0) { + client_version = pCreateInfo->pApplicationInfo->apiVersion; + } else { + client_version = VK_MAKE_VERSION(1, 0, 0); + } + if (VK_MAKE_VERSION(1, 0, 0) > client_version || client_version > VK_MAKE_VERSION(1, 0, 3)) { return vk_errorf(VK_ERROR_INCOMPATIBLE_DRIVER, |