@@ -4198,36 +4198,29 @@ VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL loader_gpa_instance_terminator(VkInstan
41984198 // These functions need a terminator to handle the case of a driver not supporting VK_EXT_debug_utils when there are layers
41994199 // present which not check for NULL before calling the function.
42004200 if (!strcmp (pName , "vkSetDebugUtilsObjectNameEXT" )) {
4201- return loader_inst -> enabled_known_extensions .ext_debug_utils ? (PFN_vkVoidFunction )terminator_SetDebugUtilsObjectNameEXT
4202- : NULL ;
4201+ return loader_inst -> enabled_extensions .ext_debug_utils ? (PFN_vkVoidFunction )terminator_SetDebugUtilsObjectNameEXT : NULL ;
42034202 }
42044203 if (!strcmp (pName , "vkSetDebugUtilsObjectTagEXT" )) {
4205- return loader_inst -> enabled_known_extensions .ext_debug_utils ? (PFN_vkVoidFunction )terminator_SetDebugUtilsObjectTagEXT
4206- : NULL ;
4204+ return loader_inst -> enabled_extensions .ext_debug_utils ? (PFN_vkVoidFunction )terminator_SetDebugUtilsObjectTagEXT : NULL ;
42074205 }
42084206 if (!strcmp (pName , "vkQueueBeginDebugUtilsLabelEXT" )) {
4209- return loader_inst -> enabled_known_extensions .ext_debug_utils ? (PFN_vkVoidFunction )terminator_QueueBeginDebugUtilsLabelEXT
4210- : NULL ;
4207+ return loader_inst -> enabled_extensions .ext_debug_utils ? (PFN_vkVoidFunction )terminator_QueueBeginDebugUtilsLabelEXT : NULL ;
42114208 }
42124209 if (!strcmp (pName , "vkQueueEndDebugUtilsLabelEXT" )) {
4213- return loader_inst -> enabled_known_extensions .ext_debug_utils ? (PFN_vkVoidFunction )terminator_QueueEndDebugUtilsLabelEXT
4214- : NULL ;
4210+ return loader_inst -> enabled_extensions .ext_debug_utils ? (PFN_vkVoidFunction )terminator_QueueEndDebugUtilsLabelEXT : NULL ;
42154211 }
42164212 if (!strcmp (pName , "vkQueueInsertDebugUtilsLabelEXT" )) {
4217- return loader_inst -> enabled_known_extensions .ext_debug_utils ? (PFN_vkVoidFunction )terminator_QueueInsertDebugUtilsLabelEXT
4218- : NULL ;
4213+ return loader_inst -> enabled_extensions .ext_debug_utils ? (PFN_vkVoidFunction )terminator_QueueInsertDebugUtilsLabelEXT
4214+ : NULL ;
42194215 }
42204216 if (!strcmp (pName , "vkCmdBeginDebugUtilsLabelEXT" )) {
4221- return loader_inst -> enabled_known_extensions .ext_debug_utils ? (PFN_vkVoidFunction )terminator_CmdBeginDebugUtilsLabelEXT
4222- : NULL ;
4217+ return loader_inst -> enabled_extensions .ext_debug_utils ? (PFN_vkVoidFunction )terminator_CmdBeginDebugUtilsLabelEXT : NULL ;
42234218 }
42244219 if (!strcmp (pName , "vkCmdEndDebugUtilsLabelEXT" )) {
4225- return loader_inst -> enabled_known_extensions .ext_debug_utils ? (PFN_vkVoidFunction )terminator_CmdEndDebugUtilsLabelEXT
4226- : NULL ;
4220+ return loader_inst -> enabled_extensions .ext_debug_utils ? (PFN_vkVoidFunction )terminator_CmdEndDebugUtilsLabelEXT : NULL ;
42274221 }
42284222 if (!strcmp (pName , "vkCmdInsertDebugUtilsLabelEXT" )) {
4229- return loader_inst -> enabled_known_extensions .ext_debug_utils ? (PFN_vkVoidFunction )terminator_CmdInsertDebugUtilsLabelEXT
4230- : NULL ;
4223+ return loader_inst -> enabled_extensions .ext_debug_utils ? (PFN_vkVoidFunction )terminator_CmdInsertDebugUtilsLabelEXT : NULL ;
42314224 }
42324225
42334226 if (loader_inst -> instance_finished_creation ) {
@@ -5564,18 +5557,10 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateInstance(const VkInstanceCreateI
55645557 // Determine if vkGetPhysicalDeviceProperties2 is available to this Instance
55655558 // Also determine if VK_EXT_surface_maintenance1 is available on the ICD
55665559 if (icd_term -> scanned_icd -> api_version >= VK_API_VERSION_1_1 ) {
5567- icd_term -> supports_get_dev_prop_2 = true;
5568- }
5569- for (uint32_t j = 0 ; j < icd_create_info .enabledExtensionCount ; j ++ ) {
5570- if (!strcmp (filtered_extension_names [j ], VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME )) {
5571- icd_term -> supports_get_dev_prop_2 = true;
5572- continue ;
5573- }
5574- if (!strcmp (filtered_extension_names [j ], VK_EXT_SURFACE_MAINTENANCE_1_EXTENSION_NAME )) {
5575- icd_term -> supports_ext_surface_maintenance_1 = true;
5576- continue ;
5577- }
5560+ icd_term -> enabled_instance_extensions .khr_get_physical_device_properties2 = true;
55785561 }
5562+ fill_out_enabled_instance_extensions (icd_create_info .enabledExtensionCount , (const char * const * )filtered_extension_names ,
5563+ & icd_term -> enabled_instance_extensions );
55795564
55805565 loader_destroy_generic_list (ptr_instance , (struct loader_generic_list * )& icd_exts );
55815566
@@ -5698,18 +5683,18 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateInstance(const VkInstanceCreateI
56985683
56995684 // For vkGetPhysicalDeviceProperties2, at least one ICD needs to support the extension for the
57005685 // instance to have it
5701- if (ptr_instance -> supports_get_dev_prop_2 ) {
5686+ if (ptr_instance -> enabled_extensions . khr_get_physical_device_properties2 ) {
57025687 bool at_least_one_supports = false;
57035688 icd_term = ptr_instance -> icd_terms ;
57045689 while (icd_term != NULL ) {
5705- if (icd_term -> supports_get_dev_prop_2 ) {
5690+ if (icd_term -> enabled_instance_extensions . khr_get_physical_device_properties2 ) {
57065691 at_least_one_supports = true;
57075692 break ;
57085693 }
57095694 icd_term = icd_term -> next ;
57105695 }
57115696 if (!at_least_one_supports ) {
5712- ptr_instance -> supports_get_dev_prop_2 = false;
5697+ ptr_instance -> enabled_extensions . khr_get_physical_device_properties2 = false;
57135698 }
57145699 }
57155700
@@ -5747,9 +5732,8 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateInstance(const VkInstanceCreateI
57475732 // This is why we don't clear inside of these function calls.
57485733 // The clearing should actually be handled by the overall memset of the pInstance structure in the
57495734 // trampoline.
5750- wsi_create_instance (ptr_instance , pCreateInfo );
5751- check_for_enabled_debug_extensions (ptr_instance , pCreateInfo );
5752- extensions_create_instance (ptr_instance , pCreateInfo );
5735+ fill_out_enabled_instance_extensions (pCreateInfo -> enabledExtensionCount , pCreateInfo -> ppEnabledExtensionNames ,
5736+ & ptr_instance -> enabled_extensions );
57535737 }
57545738
57555739 return res ;
@@ -5914,7 +5898,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDevice(VkPhysicalDevice physical
59145898 // Before we continue, If KHX_device_group is the list of enabled and viable extensions, then we then need to look for the
59155899 // corresponding VkDeviceGroupDeviceCreateInfo struct in the device list and replace all the physical device values (which
59165900 // are really loader physical device terminator values) with the ICD versions.
5917- // if (icd_term->this_instance->enabled_known_extensions .khr_device_group_creation == 1) {
5901+ // if (icd_term->this_instance->enabled_extensions .khr_device_group_creation == 1) {
59185902 {
59195903 VkBaseOutStructure * pNext = (VkBaseOutStructure * )localCreateInfo .pNext ;
59205904 VkBaseOutStructure * pPrev = (VkBaseOutStructure * )& localCreateInfo ;
@@ -5979,7 +5963,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDevice(VkPhysicalDevice physical
59795963 icd_term -> scanned_icd -> lib_name );
59805964
59815965 // Verify that VK_KHR_get_physical_device_properties2 is enabled
5982- if (icd_term -> this_instance -> enabled_known_extensions .khr_get_physical_device_properties2 ) {
5966+ if (icd_term -> this_instance -> enabled_extensions .khr_get_physical_device_properties2 ) {
59835967 localCreateInfo .pEnabledFeatures = & features -> features ;
59845968 }
59855969 }
@@ -6072,8 +6056,8 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDevice(VkPhysicalDevice physical
60726056 dev -> should_ignore_device_commands_from_newer_version = true;
60736057 }
60746058 }
6075- dev -> layer_extensions .ext_debug_utils_enabled = icd_term -> this_instance -> enabled_known_extensions .ext_debug_utils ;
6076- dev -> driver_extensions .ext_debug_utils_enabled = icd_term -> this_instance -> enabled_known_extensions .ext_debug_utils ;
6059+ dev -> layer_extensions .ext_debug_utils_enabled = icd_term -> this_instance -> enabled_extensions .ext_debug_utils ;
6060+ dev -> driver_extensions .ext_debug_utils_enabled = icd_term -> this_instance -> enabled_extensions .ext_debug_utils ;
60776061
60786062 VkPhysicalDeviceProperties properties ;
60796063 icd_term -> dispatch .GetPhysicalDeviceProperties (phys_dev_term -> phys_dev , & properties );
@@ -7161,7 +7145,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumeratePhysicalDeviceGroups(
71617145 cur_icd_group_count = 0 ;
71627146
71637147 // Get the function pointer to use to call into the ICD. This could be the core or KHR version
7164- if (inst -> enabled_known_extensions .khr_device_group_creation ) {
7148+ if (inst -> enabled_extensions .khr_device_group_creation ) {
71657149 fpEnumeratePhysicalDeviceGroups = icd_term -> dispatch .EnumeratePhysicalDeviceGroupsKHR ;
71667150 } else {
71677151 fpEnumeratePhysicalDeviceGroups = icd_term -> dispatch .EnumeratePhysicalDeviceGroups ;
@@ -7233,7 +7217,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumeratePhysicalDeviceGroups(
72337217 uint32_t count_this_time = total_count - cur_icd_group_count ;
72347218
72357219 // Get the function pointer to use to call into the ICD. This could be the core or KHR version
7236- if (inst -> enabled_known_extensions .khr_device_group_creation ) {
7220+ if (inst -> enabled_extensions .khr_device_group_creation ) {
72377221 fpEnumeratePhysicalDeviceGroups = icd_term -> dispatch .EnumeratePhysicalDeviceGroupsKHR ;
72387222 } else {
72397223 fpEnumeratePhysicalDeviceGroups = icd_term -> dispatch .EnumeratePhysicalDeviceGroups ;
0 commit comments