@@ -331,6 +331,9 @@ VKAPI_ATTR bool VKAPI_CALL loader_icd_init_entries(struct loader_instance* inst,
331331 // ---- VK_NV_cooperative_matrix2 extension commands
332332 LOOKUP_GIPA(GetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV);
333333
334+ // ---- VK_ARM_performance_counters_by_region extension commands
335+ LOOKUP_GIPA(EnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM);
336+
334337#undef LOOKUP_REQUIRED_GIPA
335338#undef LOOKUP_GIPA
336339
@@ -1183,6 +1186,14 @@ VKAPI_ATTR void VKAPI_CALL loader_init_device_extension_dispatch_table(struct lo
11831186 table->CmdUpdatePipelineIndirectBufferNV = (PFN_vkCmdUpdatePipelineIndirectBufferNV)gdpa(dev, "vkCmdUpdatePipelineIndirectBufferNV");
11841187 table->GetPipelineIndirectDeviceAddressNV = (PFN_vkGetPipelineIndirectDeviceAddressNV)gdpa(dev, "vkGetPipelineIndirectDeviceAddressNV");
11851188
1189+ // ---- VK_OHOS_external_memory extension commands
1190+ #if defined(VK_USE_PLATFORM_OHOS)
1191+ table->GetNativeBufferPropertiesOHOS = (PFN_vkGetNativeBufferPropertiesOHOS)gdpa(dev, "vkGetNativeBufferPropertiesOHOS");
1192+ #endif // VK_USE_PLATFORM_OHOS
1193+ #if defined(VK_USE_PLATFORM_OHOS)
1194+ table->GetMemoryNativeBufferOHOS = (PFN_vkGetMemoryNativeBufferOHOS)gdpa(dev, "vkGetMemoryNativeBufferOHOS");
1195+ #endif // VK_USE_PLATFORM_OHOS
1196+
11861197 // ---- VK_EXT_extended_dynamic_state3 extension commands
11871198 table->CmdSetDepthClampEnableEXT = (PFN_vkCmdSetDepthClampEnableEXT)gdpa(dev, "vkCmdSetDepthClampEnableEXT");
11881199 table->CmdSetPolygonModeEXT = (PFN_vkCmdSetPolygonModeEXT)gdpa(dev, "vkCmdSetPolygonModeEXT");
@@ -1641,6 +1652,9 @@ VKAPI_ATTR void VKAPI_CALL loader_init_instance_extension_dispatch_table(VkLayer
16411652
16421653 // ---- VK_NV_cooperative_matrix2 extension commands
16431654 table->GetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV = (PFN_vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV)gpa(inst, "vkGetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV");
1655+
1656+ // ---- VK_ARM_performance_counters_by_region extension commands
1657+ table->EnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM = (PFN_vkEnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM)gpa(inst, "vkEnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM");
16441658}
16451659
16461660// Functions that required a terminator need to have a separate dispatch table which contains their corresponding
@@ -3167,6 +3181,14 @@ VKAPI_ATTR void* VKAPI_CALL loader_lookup_device_dispatch_table(const VkLayerDis
31673181 if (!strcmp(name, "CmdUpdatePipelineIndirectBufferNV")) return (void *)table->CmdUpdatePipelineIndirectBufferNV;
31683182 if (!strcmp(name, "GetPipelineIndirectDeviceAddressNV")) return (void *)table->GetPipelineIndirectDeviceAddressNV;
31693183
3184+ // ---- VK_OHOS_external_memory extension commands
3185+ #if defined(VK_USE_PLATFORM_OHOS)
3186+ if (!strcmp(name, "GetNativeBufferPropertiesOHOS")) return (void *)table->GetNativeBufferPropertiesOHOS;
3187+ #endif // VK_USE_PLATFORM_OHOS
3188+ #if defined(VK_USE_PLATFORM_OHOS)
3189+ if (!strcmp(name, "GetMemoryNativeBufferOHOS")) return (void *)table->GetMemoryNativeBufferOHOS;
3190+ #endif // VK_USE_PLATFORM_OHOS
3191+
31703192 // ---- VK_EXT_extended_dynamic_state3 extension commands
31713193 if (!strcmp(name, "CmdSetDepthClampEnableEXT")) return (void *)table->CmdSetDepthClampEnableEXT;
31723194 if (!strcmp(name, "CmdSetPolygonModeEXT")) return (void *)table->CmdSetPolygonModeEXT;
@@ -3631,6 +3653,9 @@ VKAPI_ATTR void* VKAPI_CALL loader_lookup_instance_dispatch_table(const VkLayerI
36313653 // ---- VK_NV_cooperative_matrix2 extension commands
36323654 if (!strcmp(name, "GetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV")) return (void *)table->GetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV;
36333655
3656+ // ---- VK_ARM_performance_counters_by_region extension commands
3657+ if (!strcmp(name, "EnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM")) return (void *)table->EnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM;
3658+
36343659 *found_name = false;
36353660 return NULL;
36363661}
@@ -9290,6 +9315,41 @@ VKAPI_ATTR VkDeviceAddress VKAPI_CALL GetPipelineIndirectDeviceAddressNV(
92909315}
92919316
92929317
9318+ // ---- VK_OHOS_external_memory extension trampoline/terminators
9319+
9320+ #if defined(VK_USE_PLATFORM_OHOS)
9321+ VKAPI_ATTR VkResult VKAPI_CALL GetNativeBufferPropertiesOHOS(
9322+ VkDevice device,
9323+ const struct OH_NativeBuffer* buffer,
9324+ VkNativeBufferPropertiesOHOS* pProperties) {
9325+ const VkLayerDispatchTable *disp = loader_get_dispatch(device);
9326+ if (NULL == disp) {
9327+ loader_log(NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
9328+ "vkGetNativeBufferPropertiesOHOS: Invalid device "
9329+ "[VUID-vkGetNativeBufferPropertiesOHOS-device-parameter]");
9330+ abort(); /* Intentionally fail so user can correct issue. */
9331+ }
9332+ return disp->GetNativeBufferPropertiesOHOS(device, buffer, pProperties);
9333+ }
9334+
9335+ #endif // VK_USE_PLATFORM_OHOS
9336+ #if defined(VK_USE_PLATFORM_OHOS)
9337+ VKAPI_ATTR VkResult VKAPI_CALL GetMemoryNativeBufferOHOS(
9338+ VkDevice device,
9339+ const VkMemoryGetNativeBufferInfoOHOS* pInfo,
9340+ struct OH_NativeBuffer** pBuffer) {
9341+ const VkLayerDispatchTable *disp = loader_get_dispatch(device);
9342+ if (NULL == disp) {
9343+ loader_log(NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
9344+ "vkGetMemoryNativeBufferOHOS: Invalid device "
9345+ "[VUID-vkGetMemoryNativeBufferOHOS-device-parameter]");
9346+ abort(); /* Intentionally fail so user can correct issue. */
9347+ }
9348+ return disp->GetMemoryNativeBufferOHOS(device, pInfo, pBuffer);
9349+ }
9350+
9351+ #endif // VK_USE_PLATFORM_OHOS
9352+
92939353// ---- VK_EXT_extended_dynamic_state3 extension trampoline/terminators
92949354
92959355VKAPI_ATTR void VKAPI_CALL CmdSetDepthClampEnableEXT(
@@ -10947,6 +11007,43 @@ VKAPI_ATTR VkResult VKAPI_CALL GetMemoryMetalHandlePropertiesEXT(
1094711007
1094811008#endif // VK_USE_PLATFORM_METAL_EXT
1094911009
11010+ // ---- VK_ARM_performance_counters_by_region extension trampoline/terminators
11011+
11012+ VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM(
11013+ VkPhysicalDevice physicalDevice,
11014+ uint32_t queueFamilyIndex,
11015+ uint32_t* pCounterCount,
11016+ VkPerformanceCounterARM* pCounters,
11017+ VkPerformanceCounterDescriptionARM* pCounterDescriptions) {
11018+ const VkLayerInstanceDispatchTable *disp;
11019+ VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(physicalDevice);
11020+ if (VK_NULL_HANDLE == unwrapped_phys_dev) {
11021+ loader_log(NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
11022+ "vkEnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM: Invalid physicalDevice "
11023+ "[VUID-vkEnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM-physicalDevice-parameter]");
11024+ abort(); /* Intentionally fail so user can correct issue. */
11025+ }
11026+ disp = loader_get_instance_layer_dispatch(physicalDevice);
11027+ return disp->EnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM(unwrapped_phys_dev, queueFamilyIndex, pCounterCount, pCounters, pCounterDescriptions);
11028+ }
11029+
11030+ VKAPI_ATTR VkResult VKAPI_CALL terminator_EnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM(
11031+ VkPhysicalDevice physicalDevice,
11032+ uint32_t queueFamilyIndex,
11033+ uint32_t* pCounterCount,
11034+ VkPerformanceCounterARM* pCounters,
11035+ VkPerformanceCounterDescriptionARM* pCounterDescriptions) {
11036+ struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)physicalDevice;
11037+ struct loader_icd_term *icd_term = phys_dev_term->this_icd_term;
11038+ if (NULL == icd_term->dispatch.EnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM) {
11039+ loader_log(icd_term->this_instance, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT, 0,
11040+ "ICD associated with VkPhysicalDevice does not support EnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM");
11041+ abort(); /* Intentionally fail so user can correct issue. */
11042+ }
11043+ return icd_term->dispatch.EnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM(phys_dev_term->phys_dev, queueFamilyIndex, pCounterCount, pCounters, pCounterDescriptions);
11044+ }
11045+
11046+
1095011047// ---- VK_EXT_fragment_density_map_offset extension trampoline/terminators
1095111048
1095211049VKAPI_ATTR void VKAPI_CALL CmdEndRendering2EXT(
@@ -13134,6 +13231,20 @@ bool extension_instance_gpa(struct loader_instance *ptr_instance, const char *na
1313413231 return true;
1313513232 }
1313613233
13234+ // ---- VK_OHOS_external_memory extension commands
13235+ #if defined(VK_USE_PLATFORM_OHOS)
13236+ if (!strcmp("vkGetNativeBufferPropertiesOHOS", name)) {
13237+ *addr = (void *)GetNativeBufferPropertiesOHOS;
13238+ return true;
13239+ }
13240+ #endif // VK_USE_PLATFORM_OHOS
13241+ #if defined(VK_USE_PLATFORM_OHOS)
13242+ if (!strcmp("vkGetMemoryNativeBufferOHOS", name)) {
13243+ *addr = (void *)GetMemoryNativeBufferOHOS;
13244+ return true;
13245+ }
13246+ #endif // VK_USE_PLATFORM_OHOS
13247+
1313713248 // ---- VK_EXT_extended_dynamic_state3 extension commands
1313813249 if (!strcmp("vkCmdSetDepthClampEnableEXT", name)) {
1313913250 *addr = (void *)CmdSetDepthClampEnableEXT;
@@ -13610,6 +13721,12 @@ bool extension_instance_gpa(struct loader_instance *ptr_instance, const char *na
1361013721 }
1361113722#endif // VK_USE_PLATFORM_METAL_EXT
1361213723
13724+ // ---- VK_ARM_performance_counters_by_region extension commands
13725+ if (!strcmp("vkEnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM", name)) {
13726+ *addr = (void *)EnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM;
13727+ return true;
13728+ }
13729+
1361313730 // ---- VK_EXT_fragment_density_map_offset extension commands
1361413731 if (!strcmp("vkCmdEndRendering2EXT", name)) {
1361513732 *addr = (void *)CmdEndRendering2EXT;
@@ -14245,6 +14362,9 @@ const VkLayerInstanceDispatchTable instance_disp = {
1424514362
1424614363 // ---- VK_NV_cooperative_matrix2 extension commands
1424714364 .GetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV = terminator_GetPhysicalDeviceCooperativeMatrixFlexibleDimensionsPropertiesNV,
14365+
14366+ // ---- VK_ARM_performance_counters_by_region extension commands
14367+ .EnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM = terminator_EnumeratePhysicalDeviceQueueFamilyPerformanceCountersByRegionARM,
1424814368};
1424914369
1425014370// A null-terminated list of all of the instance extensions supported by the loader.
0 commit comments