diff options
| author | Tobin Ehlis <tobine@google.com> | 2016-09-19 14:20:37 -0600 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2016-09-22 07:21:24 -0600 |
| commit | 0a6e9077b94674b59d0e31bb9e50bbec8f150c5a (patch) | |
| tree | 132d8de873eb6d4c7bbb0fb4f5db65902aedcbfa | |
| parent | 758a96f329c1f7dcc1ec6bd289022545c3a7981c (diff) | |
| download | usermoji-0a6e9077b94674b59d0e31bb9e50bbec8f150c5a.tar.xz | |
layers: Add in-use check for renderPass
At DestroyRenderPass() time verify that renderPass is not in-use.
| -rw-r--r-- | layers/core_validation.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 485ccc53..a541958d 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -6124,11 +6124,21 @@ DestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocatio VKAPI_ATTR void VKAPI_CALL DestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks *pAllocator) { layer_data *dev_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); + bool skip = false; std::unique_lock<std::mutex> lock(global_lock); - dev_data->renderPassMap.erase(renderPass); - // TODO: leaking all the guts of the renderpass node here! - lock.unlock(); - dev_data->device_dispatch_table->DestroyRenderPass(device, renderPass, pAllocator); + auto rp_state = getRenderPass(dev_data, renderPass); + if (rp_state) { + VK_OBJECT obj_struct = {reinterpret_cast<uint64_t &>(renderPass), VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT}; + skip |= ValidateObjectNotInUse(dev_data, rp_state, obj_struct); + // Any bound cmd buffers are now invalid + invalidateCommandBuffers(rp_state->cb_bindings, obj_struct); + } + if (!skip) { + // TODO: leaking all the guts of the renderpass node here! + dev_data->renderPassMap.erase(renderPass); + lock.unlock(); + dev_data->device_dispatch_table->DestroyRenderPass(device, renderPass, pAllocator); + } } VKAPI_ATTR VkResult VKAPI_CALL CreateBuffer(VkDevice device, const VkBufferCreateInfo *pCreateInfo, |
