diff options
author | Jason Ekstrand <[email protected]> | 2016-01-28 08:18:50 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-01-28 08:19:40 -0800 |
commit | 608b411e9f69f5e1b39233c1dd4d7a69f49d782c (patch) | |
tree | 19bd6d5d425e81c905941891e60286f2fe2b77f0 | |
parent | 6286a74f6ba0906fe7df9556c1def149de40a88b (diff) |
anv/device: Add a better version check.
We now check that the requested version is precicely within the range of
versions that we support.
-rw-r--r-- | src/vulkan/anv_device.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vulkan/anv_device.c b/src/vulkan/anv_device.c index c82002780eb..27968bdf371 100644 --- a/src/vulkan/anv_device.c +++ b/src/vulkan/anv_device.c @@ -214,8 +214,11 @@ VkResult anv_CreateInstance( assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO); - if (pCreateInfo->pApplicationInfo->apiVersion > VK_MAKE_VERSION(1, 0, 0xfff)) + uint32_t client_version = pCreateInfo->pApplicationInfo->apiVersion; + if (VK_MAKE_VERSION(1, 0, 0) < client_version || + client_version > VK_MAKE_VERSION(1, 0, 2)) { return vk_error(VK_ERROR_INCOMPATIBLE_DRIVER); + } for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) { bool found = false; |