diff options
| author | Mark Mueller <markm@lunarg.com> | 2016-08-24 10:42:17 -0600 |
|---|---|---|
| committer | Mark Mueller <markm@lunarg.com> | 2016-08-31 10:26:29 -0600 |
| commit | 67ceff4d766749ec40ba90071fe9f68a67ef3e87 (patch) | |
| tree | 67169fc833a8fe332a4fe7688e9d11e0a042e10a /layers | |
| parent | abdd2d4e8c917595cd752cb46d05dc3cf41272cf (diff) | |
| download | usermoji-67ceff4d766749ec40ba90071fe9f68a67ef3e87.tar.xz | |
layers: GH428 Adding skip_call to DestroySemaphore
Use skip_call return from log_msg callback to decide
whether or not to pass the call to lower layers.
Change-Id: I96090539e9001bbda32533055b143c872d88e4bf
Diffstat (limited to 'layers')
| -rw-r--r-- | layers/core_validation.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 46b1d616..16303868 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -5238,18 +5238,23 @@ VKAPI_ATTR void VKAPI_CALL DestroySemaphore(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks *pAllocator) { layer_data *dev_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); + bool skip_call = false; std::unique_lock<std::mutex> lock(global_lock); auto item = dev_data->semaphoreMap.find(semaphore); if (item != dev_data->semaphoreMap.end()) { if (item->second.in_use.load()) { - log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT, - reinterpret_cast<uint64_t &>(semaphore), __LINE__, DRAWSTATE_OBJECT_INUSE, "DS", - "Cannot delete semaphore 0x%" PRIx64 " which is in use.", reinterpret_cast<uint64_t &>(semaphore)); + skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT, + reinterpret_cast<uint64_t &>(semaphore), __LINE__, DRAWSTATE_OBJECT_INUSE, "DS", + "Cannot delete semaphore 0x%" PRIx64 " which is in use.", reinterpret_cast<uint64_t &>(semaphore)); + } + if (!skip_call) { + dev_data->semaphoreMap.erase(semaphore); } - dev_data->semaphoreMap.erase(semaphore); } lock.unlock(); - dev_data->device_dispatch_table->DestroySemaphore(device, semaphore, pAllocator); + if (!skip_call) { + dev_data->device_dispatch_table->DestroySemaphore(device, semaphore, pAllocator); + } } VKAPI_ATTR void VKAPI_CALL DestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks *pAllocator) { |
