@@ -337,6 +337,14 @@ VKAPI_ATTR bool VKAPI_CALL loader_icd_init_entries(struct loader_instance* inst,
337337 // ---- VK_ARM_performance_counters_by_region extension commands
338338 LOOKUP_GIPA(EnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM);
339339
340+ // ---- VK_SEC_ubm_surface extension commands
341+ #if defined(VK_USE_PLATFORM_UBM_SEC)
342+ LOOKUP_GIPA(CreateUbmSurfaceSEC);
343+ #endif // VK_USE_PLATFORM_UBM_SEC
344+ #if defined(VK_USE_PLATFORM_UBM_SEC)
345+ LOOKUP_GIPA(GetPhysicalDeviceUbmPresentationSupportSEC);
346+ #endif // VK_USE_PLATFORM_UBM_SEC
347+
340348#undef LOOKUP_REQUIRED_GIPA
341349#undef LOOKUP_GIPA
342350
@@ -1674,6 +1682,14 @@ VKAPI_ATTR void VKAPI_CALL loader_init_instance_extension_dispatch_table(VkLayer
16741682
16751683 // ---- VK_ARM_performance_counters_by_region extension commands
16761684 table->EnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM = (PFN_vkEnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM)gpa(inst, "vkEnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM");
1685+
1686+ // ---- VK_SEC_ubm_surface extension commands
1687+ #if defined(VK_USE_PLATFORM_UBM_SEC)
1688+ table->CreateUbmSurfaceSEC = (PFN_vkCreateUbmSurfaceSEC)gpa(inst, "vkCreateUbmSurfaceSEC");
1689+ #endif // VK_USE_PLATFORM_UBM_SEC
1690+ #if defined(VK_USE_PLATFORM_UBM_SEC)
1691+ table->GetPhysicalDeviceUbmPresentationSupportSEC = (PFN_vkGetPhysicalDeviceUbmPresentationSupportSEC)gpa(inst, "vkGetPhysicalDeviceUbmPresentationSupportSEC");
1692+ #endif // VK_USE_PLATFORM_UBM_SEC
16771693}
16781694
16791695// Functions that required a terminator need to have a separate dispatch table which contains their corresponding
@@ -3691,6 +3707,14 @@ VKAPI_ATTR void* VKAPI_CALL loader_lookup_instance_dispatch_table(const VkLayerI
36913707 // ---- VK_ARM_performance_counters_by_region extension commands
36923708 if (!strcmp(name, "EnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM")) return (void *)table->EnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM;
36933709
3710+ // ---- VK_SEC_ubm_surface extension commands
3711+ #if defined(VK_USE_PLATFORM_UBM_SEC)
3712+ if (!strcmp(name, "CreateUbmSurfaceSEC")) return (void *)table->CreateUbmSurfaceSEC;
3713+ #endif // VK_USE_PLATFORM_UBM_SEC
3714+ #if defined(VK_USE_PLATFORM_UBM_SEC)
3715+ if (!strcmp(name, "GetPhysicalDeviceUbmPresentationSupportSEC")) return (void *)table->GetPhysicalDeviceUbmPresentationSupportSEC;
3716+ #endif // VK_USE_PLATFORM_UBM_SEC
3717+
36943718 *found_name = false;
36953719 return NULL;
36963720}
@@ -11304,6 +11328,74 @@ VKAPI_ATTR void VKAPI_CALL CmdSetComputeOccupancyPriorityNV(
1130411328}
1130511329
1130611330
11331+ // ---- VK_SEC_ubm_surface extension trampoline/terminators
11332+
11333+ #if defined(VK_USE_PLATFORM_UBM_SEC)
11334+ VKAPI_ATTR VkResult VKAPI_CALL CreateUbmSurfaceSEC(
11335+ VkInstance instance,
11336+ const VkUbmSurfaceCreateInfoSEC* pCreateInfo,
11337+ const VkAllocationCallbacks* pAllocator,
11338+ VkSurfaceKHR* pSurface) {
11339+ struct loader_instance *inst = loader_get_instance(instance);
11340+ if (NULL == inst) {
11341+ loader_log(
11342+ NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
11343+ "vkCreateUbmSurfaceSEC: Invalid instance [VUID-vkCreateUbmSurfaceSEC-instance-parameter]");
11344+ abort(); /* Intentionally fail so user can correct issue. */
11345+ }
11346+ #error("Not implemented. Likely needs to be manually generated!");
11347+ return inst->disp->CreateUbmSurfaceSEC(instance, pCreateInfo, pAllocator, pSurface);
11348+ }
11349+
11350+ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateUbmSurfaceSEC(
11351+ VkInstance instance,
11352+ const VkUbmSurfaceCreateInfoSEC* pCreateInfo,
11353+ const VkAllocationCallbacks* pAllocator,
11354+ VkSurfaceKHR* pSurface) {
11355+ struct loader_instance *inst = loader_get_instance(instance);
11356+ if (NULL == inst) {
11357+ loader_log(
11358+ NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
11359+ "vkCreateUbmSurfaceSEC: Invalid instance [VUID-vkCreateUbmSurfaceSEC-instance-parameter]");
11360+ abort(); /* Intentionally fail so user can correct issue. */
11361+ }
11362+ #error("Not implemented. Likely needs to be manually generated!");
11363+ }
11364+
11365+ #endif // VK_USE_PLATFORM_UBM_SEC
11366+ #if defined(VK_USE_PLATFORM_UBM_SEC)
11367+ VKAPI_ATTR VkBool32 VKAPI_CALL GetPhysicalDeviceUbmPresentationSupportSEC(
11368+ VkPhysicalDevice physicalDevice,
11369+ uint32_t queueFamilyIndex,
11370+ struct ubm_device* ubm_device) {
11371+ const VkLayerInstanceDispatchTable *disp;
11372+ VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice);
11373+ if (VK_NULL_HANDLE == unwrapped_phys_dev) {
11374+ loader_log(NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
11375+ "vkGetPhysicalDeviceUbmPresentationSupportSEC: Invalid physicalDevice "
11376+ "[VUID-vkGetPhysicalDeviceUbmPresentationSupportSEC-physicalDevice-parameter]");
11377+ abort(); /* Intentionally fail so user can correct issue. */
11378+ }
11379+ disp = loader_get_instance_layer_dispatch(physicalDevice);
11380+ return disp->GetPhysicalDeviceUbmPresentationSupportSEC(unwrapped_phys_dev, queueFamilyIndex, ubm_device);
11381+ }
11382+
11383+ VKAPI_ATTR VkBool32 VKAPI_CALL terminator_GetPhysicalDeviceUbmPresentationSupportSEC(
11384+ VkPhysicalDevice physicalDevice,
11385+ uint32_t queueFamilyIndex,
11386+ struct ubm_device* ubm_device) {
11387+ struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice;
11388+ struct loader_icd_term *icd_term = phys_dev_term->this_icd_term;
11389+ if (NULL == icd_term->dispatch.GetPhysicalDeviceUbmPresentationSupportSEC) {
11390+ loader_log(icd_term->this_instance, VULKAN_LOADER_ERROR_BIT, 0,
11391+ "ICD associated with VkPhysicalDevice does not support GetPhysicalDeviceUbmPresentationSupportSEC");
11392+ return VK_ERROR_EXTENSION_NOT_PRESENT;
11393+ }
11394+ return icd_term->dispatch.GetPhysicalDeviceUbmPresentationSupportSEC(phys_dev_term->phys_dev, queueFamilyIndex, ubm_device);
11395+ }
11396+
11397+ #endif // VK_USE_PLATFORM_UBM_SEC
11398+
1130711399// ---- VK_KHR_acceleration_structure extension trampoline/terminators
1130811400
1130911401VKAPI_ATTR VkResult VKAPI_CALL CreateAccelerationStructureKHR(
@@ -14033,6 +14125,24 @@ bool extension_instance_gpa(struct loader_instance *ptr_instance, const char *na
1403314125 return true;
1403414126 }
1403514127
14128+ // ---- VK_SEC_ubm_surface extension commands
14129+ #if defined(VK_USE_PLATFORM_UBM_SEC)
14130+ if (!strcmp("vkCreateUbmSurfaceSEC", name)) {
14131+ *addr = (ptr_instance->enabled_extensions.sec_ubm_surface == 1)
14132+ ? (void *)CreateUbmSurfaceSEC
14133+ : NULL;
14134+ return true;
14135+ }
14136+ #endif // VK_USE_PLATFORM_UBM_SEC
14137+ #if defined(VK_USE_PLATFORM_UBM_SEC)
14138+ if (!strcmp("vkGetPhysicalDeviceUbmPresentationSupportSEC", name)) {
14139+ *addr = (ptr_instance->enabled_extensions.sec_ubm_surface == 1)
14140+ ? (void *)GetPhysicalDeviceUbmPresentationSupportSEC
14141+ : NULL;
14142+ return true;
14143+ }
14144+ #endif // VK_USE_PLATFORM_UBM_SEC
14145+
1403614146 // ---- VK_KHR_acceleration_structure extension commands
1403714147 if (!strcmp("vkCreateAccelerationStructureKHR", name)) {
1403814148 *addr = (void *)CreateAccelerationStructureKHR;
@@ -14300,6 +14410,11 @@ void fill_out_enabled_instance_extensions(uint32_t extension_count, const char *
1430014410#if defined(VK_USE_PLATFORM_OHOS)
1430114411 else if (0 == strcmp(extension_list[i], VK_OHOS_SURFACE_EXTENSION_NAME)) { enables->ohos_surface = 1; }
1430214412#endif // VK_USE_PLATFORM_OHOS
14413+
14414+ // ---- VK_SEC_ubm_surface extension commands
14415+ #if defined(VK_USE_PLATFORM_UBM_SEC)
14416+ else if (0 == strcmp(extension_list[i], VK_SEC_UBM_SURFACE_EXTENSION_NAME)) { enables->sec_ubm_surface = 1; }
14417+ #endif // VK_USE_PLATFORM_UBM_SEC
1430314418 }
1430414419}
1430514420
@@ -14668,6 +14783,14 @@ const VkLayerInstanceDispatchTable instance_disp = {
1466814783
1466914784 // ---- VK_ARM_performance_counters_by_region extension commands
1467014785 .EnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM = terminator_EnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM,
14786+
14787+ // ---- VK_SEC_ubm_surface extension commands
14788+ #if defined(VK_USE_PLATFORM_UBM_SEC)
14789+ .CreateUbmSurfaceSEC = terminator_CreateUbmSurfaceSEC,
14790+ #endif // VK_USE_PLATFORM_UBM_SEC
14791+ #if defined(VK_USE_PLATFORM_UBM_SEC)
14792+ .GetPhysicalDeviceUbmPresentationSupportSEC = terminator_GetPhysicalDeviceUbmPresentationSupportSEC,
14793+ #endif // VK_USE_PLATFORM_UBM_SEC
1467114794};
1467214795
1467314796// A null-terminated list of all of the instance extensions supported by the loader.
@@ -14747,5 +14870,8 @@ const char *const LOADER_INSTANCE_EXTENSIONS[] = {
1474714870#if defined(VK_USE_PLATFORM_OHOS)
1474814871 VK_OHOS_SURFACE_EXTENSION_NAME,
1474914872#endif // VK_USE_PLATFORM_OHOS
14873+ #if defined(VK_USE_PLATFORM_UBM_SEC)
14874+ VK_SEC_UBM_SURFACE_EXTENSION_NAME,
14875+ #endif // VK_USE_PLATFORM_UBM_SEC
1475014876 NULL };
1475114877// clang-format on
0 commit comments