diff options
Diffstat (limited to 'layers/screenshot.cpp')
| -rw-r--r-- | layers/screenshot.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/layers/screenshot.cpp b/layers/screenshot.cpp index 19b1d4aa..90d5c037 100644 --- a/layers/screenshot.cpp +++ b/layers/screenshot.cpp @@ -288,6 +288,18 @@ VkResult VKAPI vkCreateInstance( return result; } +// hook DestroyInstance to remove tableInstanceMap entry +VK_LAYER_EXPORT VkResult VKAPI vkDestroyInstance(VkInstance instance) +{ + // Grab the key before the instance is destroyed. + dispatch_key key = get_dispatch_key(instance); + VkLayerInstanceDispatchTable *pTable = get_dispatch_table(screenshot_instance_table_map, instance); + VkResult res = pTable->DestroyInstance(instance); + + screenshot_instance_table_map.erase(key); + return res; +} + static void createDeviceRegisterExtensions(const VkDeviceCreateInfo* pCreateInfo, VkDevice device) { uint32_t i, ext_idx; |
