Lines Matching refs:funcs

838         funcs = ''
870 funcs += '\n// ---- Core %s trampoline/terminators\n\n' % ext_cmd.ext_name[11:]
872 funcs += '\n// ---- %s extension trampoline/terminators\n\n' % ext_cmd.ext_name
876 funcs += '#ifdef %s\n' % ext_cmd.protect
931 funcs += tramp_header
934 funcs += ' const VkLayerInstanceDispatchTable *disp;\n'
935 funcs += ' VkPhysicalDevice unwrapped_phys_dev = loader_unwrap_physical_device(%s);\n' % (phys_dev_var_name)
936 funcs += ' disp = loader_get_instance_layer_dispatch(%s);\n' % (phys_dev_var_name)
938 funcs += '#error("Not implemented. Likely needs to be manually generated!");\n'
940 funcs += ' const VkLayerDispatchTable *disp = loader_get_dispatch('
941 funcs += ext_cmd.params[0].name
942 funcs += ');\n'
945 funcs += ' VkDebugMarkerObjectNameInfoEXT local_name_info;\n'
946 funcs += ' memcpy(&local_name_info, pNameInfo, sizeof(VkDebugMarkerObjectNameInfoEXT));\n'
947 funcs += ' // If this is a physical device, we have to replace it with the proper one for the next call.\n'
948 funcs += ' if (pNameInfo->objectType == VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT) {\n'
949 funcs += ' struct loader_physical_device_tramp *phys_dev_tramp = (struct loader_physical_device_tramp *)(uintptr_t)pNameInfo->object;\n'
950 funcs += ' local_name_info.object = (uint64_t)(uintptr_t)phys_dev_tramp->phys_dev;\n'
951 funcs += ' }\n'
953 funcs += ' VkDebugMarkerObjectTagInfoEXT local_tag_info;\n'
954 funcs += ' memcpy(&local_tag_info, pTagInfo, sizeof(VkDebugMarkerObjectTagInfoEXT));\n'
955 funcs += ' // If this is a physical device, we have to replace it with the proper one for the next call.\n'
956 funcs += ' if (pTagInfo->objectType == VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT) {\n'
957 funcs += ' struct loader_physical_device_tramp *phys_dev_tramp = (struct loader_physical_device_tramp *)(uintptr_t)pTagInfo->object;\n'
958 funcs += ' local_tag_info.object = (uint64_t)(uintptr_t)phys_dev_tramp->phys_dev;\n'
959 funcs += ' }\n'
961 funcs += return_prefix
962 funcs += 'disp->'
963 funcs += base_name
964 funcs += '('
968 funcs += ', '
971 funcs += 'unwrapped_phys_dev'
973 funcs += '&local_name_info'
975 funcs += '&local_tag_info'
977 funcs += param.name
980 funcs += ');\n'
981 funcs += '}\n\n'
983 funcs += term_header
985 funcs += ' struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)%s;\n' % (phys_dev_var_name)
986 funcs += ' struct loader_icd_term *icd_term = phys_dev_term->this_icd_term;\n'
987 funcs += ' if (NULL == icd_term->dispatch.'
988 funcs += base_name
989 funcs += ') {\n'
990 funcs += ' loader_log(icd_term->this_instance, VK_DEBUG_REPORT_ERROR_BIT_EXT, 0,\n'
991 funcs += ' "ICD associated with VkPhysicalDevice does not support '
992 funcs += base_name
993 funcs += '");\n'
994 funcs += ' }\n'
997 funcs += ' VkIcdSurface *icd_surface = (VkIcdSurface *)(%s);\n' % (surface_var_name)
998 funcs += ' uint8_t icd_index = phys_dev_term->icd_index;\n'
999 funcs += ' if (NULL != icd_surface->real_icd_surfaces && NULL != (void *)icd_surface->real_icd_surfaces[icd_index]) {\n'
1003 funcs += update_structure_string
1005 funcs += ' ' + return_prefix + 'icd_term->dispatch.'
1006 funcs += base_name
1007 funcs += '('
1011 funcs += ', '
1015 funcs += surface_name_replacement
1017 funcs += physdev_name_replacement
1019 funcs += param.name
1021 funcs += param.name
1024 funcs += ');\n'
1026 funcs += ' return;\n'
1027 funcs += ' }\n'
1029 funcs += return_prefix
1030 funcs += 'icd_term->dispatch.'
1031 funcs += base_name
1032 funcs += '('
1036 funcs += ', '
1039 funcs += 'phys_dev_term->phys_dev'
1041 funcs += param.name
1044 funcs += ');\n'
1047 funcs += ' uint32_t icd_index = 0;\n'
1048 funcs += ' struct loader_device *dev;\n'
1049 funcs += ' struct loader_icd_term *icd_term = loader_get_icd_and_device(device, &dev, &icd_index);\n'
1050 funcs += ' if (NULL != icd_term && NULL != icd_term->dispatch.%s) {\n' % base_name
1051 funcs += ' VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)%s;\n' % (surface_var_name)
1052 funcs += ' if (NULL != icd_surface->real_icd_surfaces && (VkSurfaceKHR)NULL != icd_surface->real_icd_surfaces[icd_index]) {\n'
1053 funcs += ' %sicd_term->dispatch.%s(' % (return_prefix, base_name)
1057 funcs += ', '
1060 funcs += 'icd_surface->real_icd_surfaces[icd_index]'
1062 funcs += param.name
1065 funcs += ');\n'
1067 funcs += ' return;\n'
1068 funcs += ' }\n'
1069 funcs += ' %sicd_term->dispatch.%s(' % (return_prefix, base_name)
1073 funcs += ', '
1074 funcs += param.name
1076 funcs += ');\n'
1077 funcs += ' }\n'
1079 funcs += ' return VK_SUCCESS;\n'
1082 funcs += '#error("Not implemented. Likely needs to be manually generated!");\n'
1084 funcs += ' uint32_t icd_index = 0;\n'
1085 funcs += ' struct loader_device *dev;\n'
1086 funcs += ' struct loader_icd_term *icd_term = loader_get_icd_and_device(%s, &dev, &icd_index);\n' % (ext_cmd.params[0].name)
1087 funcs += ' if (NULL != icd_term && NULL != icd_term->dispatch.'
1088 funcs += base_name
1089 funcs += ') {\n'
1091 funcs += ' VkDebugMarkerObjectNameInfoEXT local_name_info;\n'
1092 funcs += ' memcpy(&local_name_info, pNameInfo, sizeof(VkDebugMarkerObjectNameInfoEXT));\n'
1093 funcs += ' // If this is a physical device, we have to replace it with the proper one for the next call.\n'
1094 funcs += ' if (pNameInfo->objectType == VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT) {\n'
1095 funcs += ' struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)(uintptr_t)pNameInfo->object;\n'
1096 funcs += ' local_name_info.object = (uint64_t)(uintptr_t)phys_dev_term->phys_dev;\n'
1097 funcs += ' // If this is a KHR_surface, and the ICD has created its own, we have to replace it with the proper one for the next call.\n'
1098 funcs += ' } else if (pNameInfo->objectType == VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT) {\n'
1099 funcs += ' if (NULL != icd_term && NULL != icd_term->dispatch.CreateSwapchainKHR) {\n'
1100 funcs += ' VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)pNameInfo->object;\n'
1101 funcs += ' if (NULL != icd_surface->real_icd_surfaces) {\n'
1102 funcs += ' local_name_info.object = (uint64_t)icd_surface->real_icd_surfaces[icd_index];\n'
1103 funcs += ' }\n'
1105 funcs += ' VkDebugMarkerObjectTagInfoEXT local_tag_info;\n'
1106 funcs += ' memcpy(&local_tag_info, pTagInfo, sizeof(VkDebugMarkerObjectTagInfoEXT));\n'
1107 funcs += ' // If this is a physical device, we have to replace it with the proper one for the next call.\n'
1108 funcs += ' if (pTagInfo->objectType == VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT) {\n'
1109 funcs += ' struct loader_physical_device_term *phys_dev_term = (struct loader_physical_device_term *)(uintptr_t)pTagInfo->object;\n'
1110 funcs += ' local_tag_info.object = (uint64_t)(uintptr_t)phys_dev_term->phys_dev;\n'
1111 funcs += ' // If this is a KHR_surface, and the ICD has created its own, we have to replace it with the proper one for the next call.\n'
1112 funcs += ' } else if (pTagInfo->objectType == VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT) {\n'
1113 funcs += ' if (NULL != icd_term && NULL != icd_term->dispatch.CreateSwapchainKHR) {\n'
1114 funcs += ' VkIcdSurface *icd_surface = (VkIcdSurface *)(uintptr_t)pTagInfo->object;\n'
1115 funcs += ' if (NULL != icd_surface->real_icd_surfaces) {\n'
1116 funcs += ' local_tag_info.object = (uint64_t)icd_surface->real_icd_surfaces[icd_index];\n'
1117 funcs += ' }\n'
1118 funcs += ' }\n'
1119 funcs += ' }\n'
1120 funcs += ' return icd_term->dispatch.'
1121 funcs += base_name
1122 funcs += '('
1126 funcs += ', '
1129 funcs += 'phys_dev_term->phys_dev'
1131 funcs += 'icd_surface->real_icd_surfaces[icd_index]'
1133 funcs += '&local_name_info'
1135 funcs += '&local_tag_info'
1137 funcs += param.name
1140 funcs += ');\n'
1141 funcs += ' } else {\n'
1142 funcs += ' return VK_SUCCESS;\n'
1143 funcs += ' }\n'
1146 funcs += '#error("Unknown error path!");\n'
1148 funcs += '}\n\n'
1150 funcs += tramp_header
1152 funcs += ' const VkLayerDispatchTable *disp = loader_get_dispatch('
1153 funcs += ext_cmd.params[0].name
1154 funcs += ');\n'
1156 funcs += return_prefix
1157 funcs += 'disp->'
1158 funcs += base_name
1159 funcs += '('
1163 funcs += ', '
1164 funcs += param.name
1166 funcs += ');\n'
1167 funcs += '}\n\n'
1170 funcs += '#endif // %s\n' % ext_cmd.protect
1172 return funcs