summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Forbes <chrisforbes@google.com>2017-04-24 18:40:57 -0700
committerChris Forbes <chrisf@ijw.co.nz>2017-04-26 07:55:08 +1200
commit9b36ac77fbf55bd7ffdeb9020f2277fff3a5a807 (patch)
treea67fd85f1e5fcab8560edbcb68830f5767934869
parent59e12b842592a05706886ab852b767ba251d9467 (diff)
layers: Inline deleteCommandBuffers into sole caller
-rw-r--r--layers/core_validation.cpp16
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