diff options
author | Jason Ekstrand <jason.ekstrand@intel.com> | 2017-10-11 16:06:13 -0700 |
---|---|---|
committer | Jason Ekstrand <jason.ekstrand@intel.com> | 2018-03-07 12:13:47 -0800 |
commit | 59b0ea0c7483bc95f9d24742ea4bdbaa998fc0ec (patch) | |
tree | f304e65ad3d63778f443f8d38b467e73e826ffb0 /src/intel/vulkan | |
parent | cbab2d1da5edfe9df27a010adf8b1aa9dbee473b (diff) |
anv: Stop returning VK_ERROR_INCOMPATIBLE_DRIVER
From the Vulkan 1.1 spec:
"Vulkan 1.0 implementations were required to return
VK_ERROR_INCOMPATIBLE_DRIVER if apiVersion was larger than 1.0.
Implementations that support Vulkan 1.1 or later must not return
VK_ERROR_INCOMPATIBLE_DRIVER for any value of apiVersion."
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Diffstat (limited to 'src/intel/vulkan')
-rw-r--r-- | src/intel/vulkan/anv_device.c | 36 |
1 files changed, 7 insertions, 29 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index a4237d6b2e..57316e474b 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -521,34 +521,6 @@ VkResult anv_CreateInstance( vk_find_struct_const(pCreateInfo->pNext, DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT); - 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, 0xfff)) { - - if (ctor_cb && ctor_cb->flags & VK_DEBUG_REPORT_ERROR_BIT_EXT) - ctor_cb->pfnCallback(VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT, - VK_NULL_HANDLE, /* No handle available yet. */ - __LINE__, - 0, - "anv", - "incompatible driver version", - ctor_cb->pUserData); - - return vk_errorf(NULL, NULL, VK_ERROR_INCOMPATIBLE_DRIVER, - "Client requested version %d.%d.%d", - VK_VERSION_MAJOR(client_version), - VK_VERSION_MINOR(client_version), - VK_VERSION_PATCH(client_version)); - } - struct anv_instance_extension_table enabled_extensions = {}; for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) { int idx; @@ -579,7 +551,13 @@ VkResult anv_CreateInstance( else instance->alloc = default_alloc; - instance->apiVersion = client_version; + if (pCreateInfo->pApplicationInfo && + pCreateInfo->pApplicationInfo->apiVersion != 0) { + instance->apiVersion = pCreateInfo->pApplicationInfo->apiVersion; + } else { + anv_EnumerateInstanceVersion(&instance->apiVersion); + } + instance->enabled_extensions = enabled_extensions; for (unsigned i = 0; i < ARRAY_SIZE(instance->dispatch.entrypoints); i++) { |