@@ -319,6 +319,11 @@ VKAPI_ATTR bool VKAPI_CALL loader_icd_init_entries(struct loader_instance* inst,
319319 // ---- VK_NV_cooperative_vector extension commands
320320 LOOKUP_GIPA(GetPhysicalDeviceCooperativeVectorPropertiesNV);
321321
322+ // ---- VK_OHOS_surface extension commands
323+ #if defined(VK_USE_PLATFORM_OHOS)
324+ LOOKUP_GIPA(CreateSurfaceOHOS);
325+ #endif // VK_USE_PLATFORM_OHOS
326+
322327 // ---- VK_NV_cooperative_matrix2 extension commands
323328 LOOKUP_GIPA(GetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV);
324329
@@ -1585,6 +1590,11 @@ VKAPI_ATTR void VKAPI_CALL loader_init_instance_extension_dispatch_table(VkLayer
15851590 // ---- VK_NV_cooperative_vector extension commands
15861591 table->GetPhysicalDeviceCooperativeVectorPropertiesNV = (PFN_vkGetPhysicalDeviceCooperativeVectorPropertiesNV)gpa(inst, "vkGetPhysicalDeviceCooperativeVectorPropertiesNV");
15871592
1593+ // ---- VK_OHOS_surface extension commands
1594+ #if defined(VK_USE_PLATFORM_OHOS)
1595+ table->CreateSurfaceOHOS = (PFN_vkCreateSurfaceOHOS)gpa(inst, "vkCreateSurfaceOHOS");
1596+ #endif // VK_USE_PLATFORM_OHOS
1597+
15881598 // ---- VK_NV_cooperative_matrix2 extension commands
15891599 table->GetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV = (PFN_vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV)gpa(inst, "vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV");
15901600}
@@ -3529,6 +3539,11 @@ VKAPI_ATTR void* VKAPI_CALL loader_lookup_instance_dispatch_table(const VkLayerI
35293539 // ---- VK_NV_cooperative_vector extension commands
35303540 if (!strcmp(name, "GetPhysicalDeviceCooperativeVectorPropertiesNV")) return (void *)table->GetPhysicalDeviceCooperativeVectorPropertiesNV;
35313541
3542+ // ---- VK_OHOS_surface extension commands
3543+ #if defined(VK_USE_PLATFORM_OHOS)
3544+ if (!strcmp(name, "CreateSurfaceOHOS")) return (void *)table->CreateSurfaceOHOS;
3545+ #endif // VK_USE_PLATFORM_OHOS
3546+
35323547 // ---- VK_NV_cooperative_matrix2 extension commands
35333548 if (!strcmp(name, "GetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV")) return (void *)table->GetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV;
35343549
@@ -10394,6 +10409,42 @@ VKAPI_ATTR void VKAPI_CALL UpdateIndirectExecutionSetShaderEXT(
1039410409}
1039510410
1039610411
10412+ // ---- VK_OHOS_surface extension trampoline/terminators
10413+
10414+ #if defined(VK_USE_PLATFORM_OHOS)
10415+ VKAPI_ATTR VkResult VKAPI_CALL CreateSurfaceOHOS(
10416+ VkInstance instance,
10417+ const VkSurfaceCreateInfoOHOS* pCreateInfo,
10418+ const VkAllocationCallbacks* pAllocator,
10419+ VkSurfaceKHR* pSurface) {
10420+ struct loader_instance *inst = loader_get_instance(instance);
10421+ if (NULL == inst) {
10422+ loader_log(
10423+ NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
10424+ "vkCreateSurfaceOHOS: Invalid instance [VUID-vkCreateSurfaceOHOS-instance-parameter]");
10425+ abort(); /* Intentionally fail so user can correct issue. */
10426+ }
10427+ #error("Not implemented. Likely needs to be manually generated!");
10428+ return inst->disp->CreateSurfaceOHOS(instance, pCreateInfo, pAllocator, pSurface);
10429+ }
10430+
10431+ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateSurfaceOHOS(
10432+ VkInstance instance,
10433+ const VkSurfaceCreateInfoOHOS* pCreateInfo,
10434+ const VkAllocationCallbacks* pAllocator,
10435+ VkSurfaceKHR* pSurface) {
10436+ struct loader_instance *inst = loader_get_instance(instance);
10437+ if (NULL == inst) {
10438+ loader_log(
10439+ NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
10440+ "vkCreateSurfaceOHOS: Invalid instance [VUID-vkCreateSurfaceOHOS-instance-parameter]");
10441+ abort(); /* Intentionally fail so user can correct issue. */
10442+ }
10443+ #error("Not implemented. Likely needs to be manually generated!");
10444+ }
10445+
10446+ #endif // VK_USE_PLATFORM_OHOS
10447+
1039710448// ---- VK_NV_cooperative_matrix2 extension trampoline/terminators
1039810449
1039910450VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV(
@@ -12998,6 +13049,16 @@ bool extension_instance_gpa(struct loader_instance *ptr_instance, const char *na
1299813049 return true;
1299913050 }
1300013051
13052+ // ---- VK_OHOS_surface extension commands
13053+ #if defined(VK_USE_PLATFORM_OHOS)
13054+ if (!strcmp("vkCreateSurfaceOHOS", name)) {
13055+ *addr = (ptr_instance->enabled_extensions.ohos_surface == 1)
13056+ ? (void *)CreateSurfaceOHOS
13057+ : NULL;
13058+ return true;
13059+ }
13060+ #endif // VK_USE_PLATFORM_OHOS
13061+
1300113062 // ---- VK_NV_cooperative_matrix2 extension commands
1300213063 if (!strcmp("vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV", name)) {
1300313064 *addr = (void *)GetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV;
@@ -13283,6 +13344,11 @@ void fill_out_enabled_instance_extensions(uint32_t extension_count, const char *
1328313344
1328413345 // ---- VK_NV_display_stereo extension commands
1328513346 else if (0 == strcmp(extension_list[i], VK_NV_DISPLAY_STEREO_EXTENSION_NAME)) { enables->nv_display_stereo = 1; }
13347+
13348+ // ---- VK_OHOS_surface extension commands
13349+ #if defined(VK_USE_PLATFORM_OHOS)
13350+ else if (0 == strcmp(extension_list[i], VK_OHOS_SURFACE_EXTENSION_NAME)) { enables->ohos_surface = 1; }
13351+ #endif // VK_USE_PLATFORM_OHOS
1328613352 }
1328713353}
1328813354
@@ -13634,6 +13700,11 @@ const VkLayerInstanceDispatchTable instance_disp = {
1363413700 // ---- VK_NV_cooperative_vector extension commands
1363513701 .GetPhysicalDeviceCooperativeVectorPropertiesNV = terminator_GetPhysicalDeviceCooperativeVectorPropertiesNV,
1363613702
13703+ // ---- VK_OHOS_surface extension commands
13704+ #if defined(VK_USE_PLATFORM_OHOS)
13705+ .CreateSurfaceOHOS = terminator_CreateSurfaceOHOS,
13706+ #endif // VK_USE_PLATFORM_OHOS
13707+
1363713708 // ---- VK_NV_cooperative_matrix2 extension commands
1363813709 .GetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV = terminator_GetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV,
1363913710};
@@ -13711,5 +13782,8 @@ const char *const LOADER_INSTANCE_EXTENSIONS[] = {
1371113782 VK_LUNARG_DIRECT_DRIVER_LOADING_EXTENSION_NAME,
1371213783 VK_EXT_LAYER_SETTINGS_EXTENSION_NAME,
1371313784 VK_NV_DISPLAY_STEREO_EXTENSION_NAME,
13785+ #if defined(VK_USE_PLATFORM_OHOS)
13786+ VK_OHOS_SURFACE_EXTENSION_NAME,
13787+ #endif // VK_USE_PLATFORM_OHOS
1371413788 NULL };
1371513789// clang-format on
0 commit comments