anv/device: Properly handle apiVersion == 0
From the Vulkan 1.0 spec section 3.2: "If apiVersion is 0 the implementation must ignore it"
This commit is contained in:
@@ -214,9 +214,14 @@ VkResult anv_CreateInstance(
|
|||||||
|
|
||||||
assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO);
|
assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO);
|
||||||
|
|
||||||
uint32_t client_version = pCreateInfo->pApplicationInfo ?
|
uint32_t client_version;
|
||||||
pCreateInfo->pApplicationInfo->apiVersion :
|
if (pCreateInfo->pApplicationInfo &&
|
||||||
VK_MAKE_VERSION(1, 0, 0);
|
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 ||
|
if (VK_MAKE_VERSION(1, 0, 0) > client_version ||
|
||||||
client_version > VK_MAKE_VERSION(1, 0, 3)) {
|
client_version > VK_MAKE_VERSION(1, 0, 3)) {
|
||||||
return vk_errorf(VK_ERROR_INCOMPATIBLE_DRIVER,
|
return vk_errorf(VK_ERROR_INCOMPATIBLE_DRIVER,
|
||||||
|
Reference in New Issue
Block a user