layers: MR129, Remove incorrect asserts from param_checker and object_tracker
authorTobin Ehlis <tobine@google.com>
Wed, 13 Jan 2016 21:45:14 +0000 (14:45 -0700)
committerMark Lobodzinski <mark@lunarg.com>
Thu, 14 Jan 2016 17:03:15 +0000 (10:03 -0700)
For apps that run with multiple instances, it's perfectly valid to have instances
remaining at DestroyInstace() time so removing that assert from param_checker.
Also, the assert appears to have been cut-and-pasted into DestroyDevice of both
param_checker and object_tracker. The same logic applies for apps that use
multiple devices. Running vulkancts with layers enabled found these issues.

layers/param_checker.cpp
vk-layer-generate.py

index 58999ac..0684290 100644 (file)
@@ -1795,7 +1795,6 @@ VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyInstance(
     layer_data_map.erase(pTable);
 
     pc_instance_table_map.erase(key);
-    assert(pc_instance_table_map.size() == 0 && "Should not have any instance mappings hanging around");
 }
 
 bool PostEnumeratePhysicalDevices(
@@ -2067,7 +2066,6 @@ VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkDestroyDevice(
 
     get_dispatch_table(pc_device_table_map, device)->DestroyDevice(device, pAllocator);
     pc_device_table_map.erase(key);
-    assert(pc_device_table_map.size() == 0 && "Should not have any instance mappings hanging around");
 }
 
 bool PostGetDeviceQueue(
index b12b474..ef9aff8 100755 (executable)
@@ -1657,7 +1657,6 @@ class ObjectTrackerSubcommand(Subcommand):
         gedd_txt.append('    VkLayerDispatchTable *pDisp = get_dispatch_table(object_tracker_device_table_map, device);')
         gedd_txt.append('    pDisp->DestroyDevice(device, pAllocator);')
         gedd_txt.append('    object_tracker_device_table_map.erase(key);')
-        gedd_txt.append('    assert(object_tracker_device_table_map.size() == 0 && "Should not have any instance mappings hanging around");')
         gedd_txt.append('')
         gedd_txt.append('}')
         gedd_txt.append('')