} else {
skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
object_handle, __LINE__, VALIDATION_ERROR_00097, LayerName, "Invalid %s Object 0x%" PRIxLEAST64 ". %s",
- object_name[VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT], object_handle,
- validation_error_map[VALIDATION_ERROR_00097]);
+ object_string[kVulkanObjectTypeCommandBuffer], object_handle, validation_error_map[VALIDATION_ERROR_00097]);
}
return skip;
}
} else {
skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT,
object_handle, __LINE__, VALIDATION_ERROR_00920, LayerName, "Invalid %s Object 0x%" PRIxLEAST64 ". %s",
- object_name[VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT], object_handle,
- validation_error_map[VALIDATION_ERROR_00920]);
+ object_string[kVulkanObjectTypeDescriptorSet], object_handle, validation_error_map[VALIDATION_ERROR_00920]);
}
return skip;
}
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_name[debug_object_type], object_handle);
+ object_string[object_type], object_handle);
OBJTRACK_NODE *pNewObjNode = new OBJTRACK_NODE;
pNewObjNode->object_type = object_type;
log_msg(device_data->report_data, VK_DEBUG_REPORT_INFORMATION_BIT_EXT, debug_object_type, object_handle, __LINE__,
OBJTRACK_NONE, LayerName,
"OBJ_STAT Destroy %s obj 0x%" PRIxLEAST64 " (%" PRIu64 " total objs remain & %" PRIu64 " %s objs).",
- object_name[debug_object_type], reinterpret_cast<uint64_t &>(object), device_data->num_total_objects,
- device_data->num_objects[pNode->object_type], object_name[debug_object_type]);
+ object_string[object_type], reinterpret_cast<uint64_t &>(object), device_data->num_total_objects,
+ device_data->num_objects[pNode->object_type], object_string[object_type]);
auto allocated_with_custom = (pNode->status & OBJSTATUS_CUSTOM_ALLOCATOR) ? true : false;
if (allocated_with_custom && !custom_allocator && expected_custom_allocator_code != VALIDATION_ERROR_UNDEFINED) {
log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, debug_object_type, object_handle, __LINE__,
expected_custom_allocator_code, LayerName,
"Custom allocator not specified while destroying %s obj 0x%" PRIxLEAST64 " but specified at creation. %s",
- object_name[debug_object_type], object_handle, validation_error_map[expected_custom_allocator_code]);
+ object_string[object_type], object_handle, validation_error_map[expected_custom_allocator_code]);
} else if (!allocated_with_custom && custom_allocator &&
expected_default_allocator_code != VALIDATION_ERROR_UNDEFINED) {
log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, debug_object_type, object_handle, __LINE__,
expected_default_allocator_code, LayerName,
"Custom allocator specified while destroying %s obj 0x%" PRIxLEAST64 " but not specified at creation. %s",
- object_name[debug_object_type], object_handle, validation_error_map[expected_default_allocator_code]);
+ object_string[object_type], object_handle, validation_error_map[expected_default_allocator_code]);
}
delete pNode;
log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, object_handle,
__LINE__, OBJTRACK_UNKNOWN_OBJECT, LayerName,
"Unable to remove %s obj 0x%" PRIxLEAST64 ". Was it created? Has it already been destroyed?",
- object_name[debug_object_type], object_handle);
+ object_string[object_type], object_handle);
}
}
}
// Report an error if object was not found anywhere
return log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, debug_object_type, object_handle, __LINE__,
invalid_handle_code, LayerName, "Invalid %s Object 0x%" PRIxLEAST64 ". %s",
- object_name[debug_object_type], object_handle, validation_error_map[invalid_handle_code]);
+ object_string[object_type], object_handle, validation_error_map[invalid_handle_code]);
}
}
return false;
static void DeviceReportUndestroyedObjects(VkDevice device, VulkanObjectType object_type,
enum UNIQUE_VALIDATION_ERROR_CODE error_code) {
layer_data *device_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
- VkDebugReportObjectTypeEXT debug_object_type = GetDebugReportEnum(object_type);
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, debug_object_type, object_info->handle, __LINE__,
- error_code, LayerName,
+ 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_name[debug_object_type], object_info->handle,
+ reinterpret_cast<uint64_t>(device), object_string[object_type], object_info->handle,
validation_error_map[error_code]);
item = device_data->object_map[object_type].erase(item);
}
static std::mutex global_lock;
static uint64_t object_track_index = 0;
-// Array of object name strings for OBJECT_TYPE enum conversion
-static const char *object_name[VK_DEBUG_REPORT_OBJECT_TYPE_RANGE_SIZE_EXT] = {
- "Unknown", // VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN
- "Instance", // VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT
- "Physical Device", // VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT
- "Device", // VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT
- "Queue", // VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT
- "Semaphore", // VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT
- "Command Buffer", // VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT
- "Fence", // VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT
- "Device Memory", // VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT
- "Buffer", // VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT
- "Image", // VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT
- "Event", // VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT
- "Query Pool", // VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT
- "Buffer View", // VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT
- "Image View", // VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT
- "Shader Module", // VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT
- "Pipeline Cache", // VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT
- "Pipeline Layout", // VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT
- "Render Pass", // VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT
- "Pipeline", // VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT
- "Descriptor Set Layout", // VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT
- "Sampler", // VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT
- "Descriptor Pool", // VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT
- "Descriptor Set", // VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT
- "Framebuffer", // VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT
- "Command Pool", // VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT
- "SurfaceKHR", // VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT
- "SwapchainKHR", // VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT
- "Debug Report"}; // VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT
-
#include "vk_dispatch_table_helper.h"
} // namespace object_tracker