bool custom_allocator = pAllocator != nullptr;
if (!instance_data->object_map[object_type].count(object_handle)) {
- VkDebugReportObjectTypeEXT debug_object_type = GetDebugReportEnum(object_type);
+ VkDebugReportObjectTypeEXT debug_object_type = GetDebugReportEnum[object_type];
log_msg(instance_data->report_data, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, debug_object_type, object_handle, __LINE__,
OBJTRACK_NONE, LayerName, "OBJ[0x%" PRIxLEAST64 "] : CREATE %s object 0x%" PRIxLEAST64, object_track_index++,
object_string[object_type], object_handle);
auto object_handle = handle_value(object);
bool custom_allocator = pAllocator != nullptr;
- VkDebugReportObjectTypeEXT debug_object_type = GetDebugReportEnum(object_type);
+ VkDebugReportObjectTypeEXT debug_object_type = GetDebugReportEnum[object_type];
if (object_handle != VK_NULL_HANDLE) {
auto item = device_data->object_map[object_type].find(object_handle);
return false;
}
auto object_handle = handle_value(object);
- VkDebugReportObjectTypeEXT debug_object_type = GetDebugReportEnum(object_type);
+ VkDebugReportObjectTypeEXT debug_object_type = GetDebugReportEnum[object_type];
layer_data *device_data = GetLayerDataPtr(get_dispatch_key(dispatchable_object), layer_data_map);
// Look for object in device object map
layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
for (auto item = device_data->object_map[object_type].begin(); item != device_data->object_map[object_type].end();) {
OBJTRACK_NODE *object_info = item->second;
- log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, GetDebugReportEnum(object_type), object_info->handle,
+ log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, GetDebugReportEnum[object_type], object_info->handle,
__LINE__, error_code, LayerName,
"OBJ ERROR : For device 0x%" PRIxLEAST64 ", %s object 0x%" PRIxLEAST64 " has not been destroyed. %s",
reinterpret_cast<uint64_t>(device), object_string[object_type], object_info->handle,
OBJTRACK_NODE *pNode = iit->second;
VkDevice device = reinterpret_cast<VkDevice>(pNode->handle);
- VkDebugReportObjectTypeEXT debug_object_type = GetDebugReportEnum(pNode->object_type);
+ VkDebugReportObjectTypeEXT debug_object_type = GetDebugReportEnum[pNode->object_type];
log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, debug_object_type, pNode->handle, __LINE__,
OBJTRACK_OBJECT_LEAK, LayerName, "OBJ ERROR : %s object 0x%" PRIxLEAST64 " has not been destroyed.",
# Output a conversion routine from the layer object definitions to the debug report definitions
object_types_header += '\n'
- object_types_header += '// Helper function to get Official Vulkan object type enum from the internal layers version\n'
- object_types_header += 'VkDebugReportObjectTypeEXT GetDebugReportEnum(VulkanObjectType object_type) {\n\n'
- object_types_header += ' switch (object_type) {\n'
- object_types_header += ' case kVulkanObjectTypeUnknown:\n'
- object_types_header += ' return VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT;\n\n'
+ object_types_header += '// Helper array to get Official Vulkan object type enum from the internal layers version\n'
+ object_types_header += 'const VkDebugReportObjectTypeEXT GetDebugReportEnum[] = {\n'
for object_type in type_list:
done = False
- object_types_header += ' case %s:\n' % object_type
search_type = object_type.replace("kVulkanObjectType", "").lower()
for vk_object_type in self.debug_report_object_types:
target_type = vk_object_type.replace("VK_DEBUG_REPORT_OBJECT_TYPE_", "").lower()
target_type = target_type[:-4]
target_type = target_type.replace("_", "")
if search_type == target_type:
- object_types_header += ' return %s;\n\n' % vk_object_type
+ object_types_header += ' %s, // %s\n' % (vk_object_type, object_type)
done = True
break
if done == False:
if object_type == 'kVulkanObjectTypeDebugReportCallbackEXT':
- object_types_header += ' return VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT;\n\n'
+ object_types_header += ' VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT, // kVulkanObjectTypeDebugReportCallbackEXT\n'
else:
- object_types_header += ' return VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT;\n\n'
- object_types_header += ' default:\n'
- object_types_header += ' return VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT;\n\n'
- object_types_header += ' }\n'
- object_types_header += '}\n'
+ object_types_header += ' VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT; // No Match\n'
+ object_types_header += '};\n'
return object_types_header
#
# Determine if a structure needs a safe_struct helper function