Skip to content

Commit

Permalink
tests: Allow test ICD to handle NULL pApplicationInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
aqnuep committed May 16, 2024
1 parent ffb58e2 commit 72d8c4c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/framework/icd/test_icd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,16 @@ VKAPI_ATTR VkResult VKAPI_CALL test_vkEnumerateInstanceVersion(uint32_t* pApiVer
VKAPI_ATTR VkResult VKAPI_CALL test_vkCreateInstance(const VkInstanceCreateInfo* pCreateInfo,
[[maybe_unused]] const VkAllocationCallbacks* pAllocator,
VkInstance* pInstance) {
if (pCreateInfo == nullptr || pCreateInfo->pApplicationInfo == nullptr) {
if (pCreateInfo == nullptr) {
return VK_ERROR_OUT_OF_HOST_MEMORY;
}

uint32_t default_api_version = VK_API_VERSION_1_0;
uint32_t api_version =
(pCreateInfo->pApplicationInfo == nullptr) ? default_api_version : pCreateInfo->pApplicationInfo->apiVersion;

if (icd.icd_api_version < VK_API_VERSION_1_1) {
if (pCreateInfo->pApplicationInfo->apiVersion > VK_API_VERSION_1_0) {
if (api_version > VK_API_VERSION_1_0) {
return VK_ERROR_INCOMPATIBLE_DRIVER;
}
}
Expand Down

0 comments on commit 72d8c4c

Please sign in to comment.