diff options
| author | Chris Forbes <chrisforbes@google.com> | 2017-04-24 18:40:57 -0700 |
|---|---|---|
| committer | Chris Forbes <chrisf@ijw.co.nz> | 2017-04-26 07:55:08 +1200 |
| commit | 0325e202efb5154706c0f6848e9ab79f1cb4033c (patch) | |
| tree | 3ca45727b2729cecdf383b455bba1e1ea2c0741f /layers/core_validation.cpp | |
| parent | dfcf2383eda567e4e3d48c57af0902a1fa6a8b81 (diff) | |
| download | usermoji-0325e202efb5154706c0f6848e9ab79f1cb4033c.tar.xz | |
layers: Inline deleteCommandBuffers into sole caller
Diffstat (limited to 'layers/core_validation.cpp')
| -rw-r--r-- | layers/core_validation.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index e8d07ff4..4c4c6afa 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -3221,17 +3221,6 @@ GLOBAL_CB_NODE *GetCBNode(layer_data const *dev_data, const VkCommandBuffer cb) } return it->second; } -// Free all CB Nodes -// NOTE : Calls to this function should be wrapped in mutex -static void deleteCommandBuffers(layer_data *dev_data) { - if (dev_data->commandBufferMap.empty()) { - return; - } - for (auto ii = dev_data->commandBufferMap.begin(); ii != dev_data->commandBufferMap.end(); ++ii) { - delete (*ii).second; - } - dev_data->commandBufferMap.clear(); -} // If a renderpass is active, verify that the given command type is appropriate for current subpass state bool ValidateCmdSubpassState(const layer_data *dev_data, const GLOBAL_CB_NODE *pCB, const CMD_TYPE cmd_type) { @@ -3820,7 +3809,10 @@ VKAPI_ATTR void VKAPI_CALL DestroyDevice(VkDevice device, const VkAllocationCall std::unique_lock<std::mutex> lock(global_lock); deletePipelines(dev_data); dev_data->renderPassMap.clear(); - deleteCommandBuffers(dev_data); + for (auto ii = dev_data->commandBufferMap.begin(); ii != dev_data->commandBufferMap.end(); ++ii) { + delete (*ii).second; + } + dev_data->commandBufferMap.clear(); // This will also delete all sets in the pool & remove them from setMap deletePools(dev_data); // All sets should be removed |
