aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2016-08-26 17:09:24 -0600
committerTobin Ehlis <tobine@google.com>2016-09-08 09:21:49 -0600
commit930232f7a96a50495682c2d539a44c01fa7fd45b (patch)
treef482b3b06d83b52cbe6296bc777dc73e38717514 /layers/core_validation.cpp
parent07fddef52621195b52af8a13b62207aca4b737fa (diff)
downloadusermoji-930232f7a96a50495682c2d539a44c01fa7fd45b.tar.xz
layers: Improve map cleanup on object deletion
If object deletion is skipped due to validation error, don't remove object from map.
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp28
1 files changed, 16 insertions, 12 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index e3e921e2..87eb690c 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -5289,11 +5289,12 @@ VKAPI_ATTR void VKAPI_CALL DestroyEvent(VkDevice device, VkEvent event, const Vk
skip |= ValidateObjectNotInUse(dev_data, event_node, obj_struct);
// Any bound cmd buffers are now invalid
invalidateCommandBuffers(event_node->cb_bindings, obj_struct);
- dev_data->eventMap.erase(event);
}
- lock.unlock();
- if (!skip)
+ if (!skip) {
+ dev_data->eventMap.erase(event);
+ lock.unlock();
dev_data->device_dispatch_table->DestroyEvent(device, event, pAllocator);
+ }
}
VKAPI_ATTR void VKAPI_CALL
@@ -5307,11 +5308,12 @@ DestroyQueryPool(VkDevice device, VkQueryPool queryPool, const VkAllocationCallb
skip |= ValidateObjectNotInUse(dev_data, qp_node, obj_struct);
// Any bound cmd buffers are now invalid
invalidateCommandBuffers(qp_node->cb_bindings, obj_struct);
- dev_data->queryPoolMap.erase(queryPool);
}
- lock.unlock();
- if (!skip)
+ if (!skip) {
+ dev_data->queryPoolMap.erase(queryPool);
+ lock.unlock();
dev_data->device_dispatch_table->DestroyQueryPool(device, queryPool, pAllocator);
+ }
}
VKAPI_ATTR VkResult VKAPI_CALL GetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery,
@@ -5745,11 +5747,12 @@ DestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallback
skip |= ValidateObjectNotInUse(dev_data, pipe_node, obj_struct);
// Any bound cmd buffers are now invalid
invalidateCommandBuffers(pipe_node->cb_bindings, obj_struct);
- dev_data->pipelineMap.erase(pipeline);
}
- lock.unlock();
- if (!skip)
+ if (!skip) {
+ dev_data->pipelineMap.erase(pipeline);
+ lock.unlock();
dev_data->device_dispatch_table->DestroyPipeline(device, pipeline, pAllocator);
+ }
}
VKAPI_ATTR void VKAPI_CALL
@@ -5773,11 +5776,12 @@ DestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks *
skip |= ValidateObjectNotInUse(dev_data, sampler_node, obj_struct);
// Any bound cmd buffers are now invalid
invalidateCommandBuffers(sampler_node->cb_bindings, obj_struct);
- dev_data->samplerMap.erase(sampler);
}
- lock.unlock();
- if (!skip)
+ if (!skip) {
+ dev_data->samplerMap.erase(sampler);
+ lock.unlock();
dev_data->device_dispatch_table->DestroySampler(device, sampler, pAllocator);
+ }
}
VKAPI_ATTR void VKAPI_CALL