aboutsummaryrefslogtreecommitdiff
path: root/layers/object_tracker.cpp
diff options
context:
space:
mode:
authorMark Lobodzinski <mark@lunarg.com>2017-04-13 08:36:18 -0600
committerMark Lobodzinski <mark@lunarg.com>2017-04-13 09:46:17 -0600
commit32cd102c36c6fca2679904aa9e59fdffc64ded59 (patch)
tree6bb3f6eb169d7758ebee1ba601f1d58183dd443f /layers/object_tracker.cpp
parent0b0be96ac2cf958866c0a26daf11b7ff86c6936b (diff)
downloadusermoji-32cd102c36c6fca2679904aa9e59fdffc64ded59.tar.xz
scripts: Convert ugly case statment to nice array
Since this was codegen'd, we can just create a static array for the object type conversion and do away with all of the switch statement mess. Change-Id: I5fb20778d64f0675afa9c1563e2d44d22d5b4a02
Diffstat (limited to 'layers/object_tracker.cpp')
-rw-r--r--layers/object_tracker.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/layers/object_tracker.cpp b/layers/object_tracker.cpp
index 9c9f74a4..967b87af 100644
--- a/layers/object_tracker.cpp
+++ b/layers/object_tracker.cpp
@@ -261,7 +261,7 @@ static void CreateObject(T1 dispatchable_object, T2 object, VulkanObjectType obj
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);
@@ -285,7 +285,7 @@ static void DestroyObject(T1 dispatchable_object, T2 object, VulkanObjectType ob
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);
@@ -337,7 +337,7 @@ static bool ValidateObject(T1 dispatchable_object, T2 object, VulkanObjectType o
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
@@ -379,7 +379,7 @@ static void DeviceReportUndestroyedObjects(VkDevice device, VulkanObjectType obj
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,
@@ -414,7 +414,7 @@ VKAPI_ATTR void VKAPI_CALL DestroyInstance(VkInstance instance, const VkAllocati
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.",