aboutsummaryrefslogtreecommitdiff
path: root/layers/device_limits.cpp
diff options
context:
space:
mode:
authorTobin Ehlis <tobin@lunarg.com>2015-10-07 09:38:40 -0600
committerTobin Ehlis <tobin@lunarg.com>2015-10-08 11:02:54 -0600
commit4c0c05ebdcac264ef4cae256ece81cf2d799421d (patch)
tree7cd7caba969d32bd95783ee3606d2f42df6e739b /layers/device_limits.cpp
parent5b1a068c2145c91fb1439cd6f64d7251203021b4 (diff)
downloadusermoji-4c0c05ebdcac264ef4cae256ece81cf2d799421d.tar.xz
layers: DrawState migrate device and instance dispatch tables into layer data struct
This is first part of cleaning up DrawState. Need to migrate its global maps into the layer data struct as well so they are per device/instance and then single map look-up with get both layer data and dispatch tables.
Diffstat (limited to 'layers/device_limits.cpp')
-rw-r--r--layers/device_limits.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/layers/device_limits.cpp b/layers/device_limits.cpp
index 5b1cf575..b991a86a 100644
--- a/layers/device_limits.cpp
+++ b/layers/device_limits.cpp
@@ -190,6 +190,11 @@ VK_LAYER_EXPORT void VKAPI vkDestroyInstance(VkInstance instance)
layer_debug_report_destroy_instance(my_data->report_data);
delete my_data->instance_dispatch_table;
layer_data_map.erase(key);
+ if (layer_data_map.empty()) {
+ // Release mutex when destroying last instance.
+ loader_platform_thread_delete_mutex(&globalLock);
+ globalLockInitialized = 0;
+ }
}
VK_LAYER_EXPORT VkResult VKAPI vkEnumeratePhysicalDevices(VkInstance instance, uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices)