diff options
| author | Mark Mueller <markm@lunarg.com> | 2016-05-03 13:17:29 -0600 |
|---|---|---|
| committer | Mark Mueller <markm@lunarg.com> | 2016-05-11 09:00:24 -0600 |
| commit | db6a8d55264aa3eaf2a6ecf14734263fb74c6a80 (patch) | |
| tree | f2eaec728a4dec617901a07cc30e2b5b7c7e4a48 /layers/vk_layer_table.cpp | |
| parent | 26ae872195bd882dfb6766608d0a91f7273546fb (diff) | |
| download | usermoji-db6a8d55264aa3eaf2a6ecf14734263fb74c6a80.tar.xz | |
layers:LX#470 Fix poor use of hex vs dec output
1) Introduce convention of explicitly placing "0x" before hex
format requests for clarity (don't use "%#")
2) All lower case in hex output (except w/stringstream which refuses
to do anything but uppercase, possibly only on windows).
3) Decorated pointers are printed for all Vulkan structure types.
3) Some intelligence in generators based on Vulkan variable name:
if the Vulkan variable name contains ("flag", "bit", "offset",
"handle", "buffer", "object", "mask") it will be output in
hexadecimal format
4) Remove "using namespace std;" from global scope of vk_struct_string_helper_cpp.h
Change-Id: Idbae73bfdaa3bc059543d43b209373cd0bcbc099
Diffstat (limited to 'layers/vk_layer_table.cpp')
| -rw-r--r-- | layers/vk_layer_table.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/layers/vk_layer_table.cpp b/layers/vk_layer_table.cpp index 8664a891..05e51659 100644 --- a/layers/vk_layer_table.cpp +++ b/layers/vk_layer_table.cpp @@ -40,10 +40,10 @@ VkLayerInstanceDispatchTable *instance_dispatch_table(void *object) { instance_table_map::const_iterator it = tableInstanceMap.find((void *)key); #if DISPATCH_MAP_DEBUG if (it != tableInstanceMap.end()) { - fprintf(stderr, "instance_dispatch_table: map: %p, object: %p, key: %p, table: %p\n", &tableInstanceMap, object, key, + fprintf(stderr, "instance_dispatch_table: map: 0x%p, object: 0x%p, key: 0x%p, table: 0x%p\n", &tableInstanceMap, object, key, it->second); } else { - fprintf(stderr, "instance_dispatch_table: map: %p, object: %p, key: %p, table: UNKNOWN\n", &tableInstanceMap, object, key); + fprintf(stderr, "instance_dispatch_table: map: 0x%p, object: 0x%p, key: 0x%p, table: UNKNOWN\n", &tableInstanceMap, object, key); } #endif assert(it != tableInstanceMap.end() && "Not able to find instance dispatch entry"); @@ -54,9 +54,9 @@ void destroy_dispatch_table(device_table_map &map, dispatch_key key) { #if DISPATCH_MAP_DEBUG device_table_map::const_iterator it = map.find((void *)key); if (it != map.end()) { - fprintf(stderr, "destroy device dispatch_table: map: %p, key: %p, table: %p\n", &map, key, it->second); + fprintf(stderr, "destroy device dispatch_table: map: 0x%p, key: 0x%p, table: 0x%p\n", &map, key, it->second); } else { - fprintf(stderr, "destroy device dispatch table: map: %p, key: %p, table: UNKNOWN\n", &map, key); + fprintf(stderr, "destroy device dispatch table: map: 0x%p, key: 0x%p, table: UNKNOWN\n", &map, key); assert(it != map.end()); } #endif @@ -67,9 +67,9 @@ void destroy_dispatch_table(instance_table_map &map, dispatch_key key) { #if DISPATCH_MAP_DEBUG instance_table_map::const_iterator it = map.find((void *)key); if (it != map.end()) { - fprintf(stderr, "destroy instance dispatch_table: map: %p, key: %p, table: %p\n", &map, key, it->second); + fprintf(stderr, "destroy instance dispatch_table: map: 0x%p, key: 0x%p, table: 0x%p\n", &map, key, it->second); } else { - fprintf(stderr, "destroy instance dispatch table: map: %p, key: %p, table: UNKNOWN\n", &map, key); + fprintf(stderr, "destroy instance dispatch table: map: 0x%p, key: 0x%p, table: UNKNOWN\n", &map, key); assert(it != map.end()); } #endif @@ -85,10 +85,10 @@ VkLayerDispatchTable *get_dispatch_table(device_table_map &map, void *object) { device_table_map::const_iterator it = map.find((void *)key); #if DISPATCH_MAP_DEBUG if (it != map.end()) { - fprintf(stderr, "device_dispatch_table: map: %p, object: %p, key: %p, table: %p\n", &tableInstanceMap, object, key, + fprintf(stderr, "device_dispatch_table: map: 0x%p, object: 0x%p, key: 0x%p, table: 0x%p\n", &tableInstanceMap, object, key, it->second); } else { - fprintf(stderr, "device_dispatch_table: map: %p, object: %p, key: %p, table: UNKNOWN\n", &tableInstanceMap, object, key); + fprintf(stderr, "device_dispatch_table: map: 0x%p, object: 0x%p, key: 0x%p, table: UNKNOWN\n", &tableInstanceMap, object, key); } #endif assert(it != map.end() && "Not able to find device dispatch entry"); @@ -101,10 +101,10 @@ VkLayerInstanceDispatchTable *get_dispatch_table(instance_table_map &map, void * instance_table_map::const_iterator it = map.find((void *)key); #if DISPATCH_MAP_DEBUG if (it != map.end()) { - fprintf(stderr, "instance_dispatch_table: map: %p, object: %p, key: %p, table: %p\n", &tableInstanceMap, object, key, + fprintf(stderr, "instance_dispatch_table: map: 0x%p, object: 0x%p, key: 0x%p, table: 0x%p\n", &tableInstanceMap, object, key, it->second); } else { - fprintf(stderr, "instance_dispatch_table: map: %p, object: %p, key: %p, table: UNKNOWN\n", &tableInstanceMap, object, key); + fprintf(stderr, "instance_dispatch_table: map: 0x%p, object: 0x%p, key: 0x%p, table: UNKNOWN\n", &tableInstanceMap, object, key); } #endif assert(it != map.end() && "Not able to find instance dispatch entry"); @@ -145,11 +145,11 @@ VkLayerInstanceDispatchTable *initInstanceTable(VkInstance instance, const PFN_v pTable = new VkLayerInstanceDispatchTable; map[(void *)key] = pTable; #if DISPATCH_MAP_DEBUG - fprintf(stderr, "New, Instance: map: %p, key: %p, table: %p\n", &map, key, pTable); + fprintf(stderr, "New, Instance: map: 0x%p, key: 0x%p, table: 0x%p\n", &map, key, pTable); #endif } else { #if DISPATCH_MAP_DEBUG - fprintf(stderr, "Instance: map: %p, key: %p, table: %p\n", &map, key, it->second); + fprintf(stderr, "Instance: map: 0x%p, key: 0x%p, table: 0x%p\n", &map, key, it->second); #endif return it->second; } @@ -172,11 +172,11 @@ VkLayerDispatchTable *initDeviceTable(VkDevice device, const PFN_vkGetDeviceProc pTable = new VkLayerDispatchTable; map[(void *)key] = pTable; #if DISPATCH_MAP_DEBUG - fprintf(stderr, "New, Device: map: %p, key: %p, table: %p\n", &map, key, pTable); + fprintf(stderr, "New, Device: map: 0x%p, key: 0x%p, table: 0x%p\n", &map, key, pTable); #endif } else { #if DISPATCH_MAP_DEBUG - fprintf(stderr, "Device: map: %p, key: %p, table: %p\n", &map, key, it->second); + fprintf(stderr, "Device: map: 0x%p, key: 0x%p, table: 0x%p\n", &map, key, it->second); #endif return it->second; } |
