From 4c0c05ebdcac264ef4cae256ece81cf2d799421d Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Wed, 7 Oct 2015 09:38:40 -0600 Subject: 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. --- layers/device_limits.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'layers/device_limits.cpp') 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) -- cgit v1.2.3