From 778f40980928dec4f38f4f9b5360a09ac32df95e Mon Sep 17 00:00:00 2001 From: Charles Giessen Date: Fri, 20 Jun 2025 17:02:09 -0500 Subject: mock_icd: Add VkPhysicalDeviceLayeredApiPropertiesListKHR to output --- icd/generated/function_definitions.h | 15 +++++++++++++++ scripts/mock_icd_generator.py | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/icd/generated/function_definitions.h b/icd/generated/function_definitions.h index 7144831c..518e15c2 100644 --- a/icd/generated/function_definitions.h +++ b/icd/generated/function_definitions.h @@ -4074,6 +4074,21 @@ static VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceProperties2KHR( std::strncpy(driver_properties->driverInfo, "Branch: --unknown-- Tag Info: --unknown--", VK_MAX_DRIVER_INFO_SIZE); #endif } + + auto *layered_properties = lvl_find_mod_in_chain(pProperties->pNext); + if (layered_properties) { + layered_properties->layeredApiCount = 1; + if (layered_properties->pLayeredApis) { + layered_properties->pLayeredApis[0] = VkPhysicalDeviceLayeredApiPropertiesKHR{ + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_API_PROPERTIES_KHR, + nullptr, + 0xba5eba11, + 0xf005ba11, + VK_PHYSICAL_DEVICE_LAYERED_API_VULKAN_KHR + }; + std::strncpy(layered_properties->pLayeredApis[0].deviceName, "Fake Driver", VK_MAX_PHYSICAL_DEVICE_NAME_SIZE); + } + } } static VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFormatProperties2KHR( diff --git a/scripts/mock_icd_generator.py b/scripts/mock_icd_generator.py index 64716f5e..641a5b9d 100644 --- a/scripts/mock_icd_generator.py +++ b/scripts/mock_icd_generator.py @@ -721,6 +721,21 @@ CUSTOM_C_INTERCEPTS = { std::strncpy(driver_properties->driverInfo, "Branch: --unknown-- Tag Info: --unknown--", VK_MAX_DRIVER_INFO_SIZE); #endif } + + auto *layered_properties = lvl_find_mod_in_chain(pProperties->pNext); + if (layered_properties) { + layered_properties->layeredApiCount = 1; + if (layered_properties->pLayeredApis) { + layered_properties->pLayeredApis[0] = VkPhysicalDeviceLayeredApiPropertiesKHR{ + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_API_PROPERTIES_KHR, + nullptr, + 0xba5eba11, + 0xf005ba11, + VK_PHYSICAL_DEVICE_LAYERED_API_VULKAN_KHR + }; + std::strncpy(layered_properties->pLayeredApis[0].deviceName, "Fake Driver", VK_MAX_PHYSICAL_DEVICE_NAME_SIZE); + } + } ''', 'vkGetPhysicalDeviceExternalSemaphoreProperties':''' // Hard code support for all handle types and features -- cgit v1.2.3