diff options
author | Tobin Ehlis <tobine@google.com> | 2016-08-17 21:01:38 -0600 |
---|---|---|
committer | Tobin Ehlis <tobine@google.com> | 2016-09-08 09:21:49 -0600 |
commit | c2f1641edf568a0ad1383bc65d0239227dd1926c (patch) | |
tree | 0c5b1e97e81915be3b3065c0411d200b83b1fe0b /layers/core_validation.cpp | |
parent | 7dfc26bc43179b0aa7adfd74e97ef6353b7b9600 (diff) |
layers: Flag error on destroyed sampler in-use
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r-- | layers/core_validation.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index c5427963..8d4e492c 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -5759,10 +5759,14 @@ DestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, const Vk VKAPI_ATTR void VKAPI_CALL DestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks *pAllocator) { layer_data *dev_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); - // TODO : Add detection for in-flight sampler std::unique_lock<std::mutex> lock(global_lock); auto sampler_node = getSamplerNode(dev_data, sampler); if (sampler_node) { + if (sampler_node->in_use.load()) { + log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT, + reinterpret_cast<uint64_t &>(sampler), __LINE__, DRAWSTATE_OBJECT_INUSE, "DS", + "Sampler 0x%" PRIx64 " being destroyed while in use.", reinterpret_cast<uint64_t &>(sampler)); + } // Any bound cmd buffers are now invalid invalidateCommandBuffers(sampler_node->cb_bindings, {reinterpret_cast<uint64_t &>(sampler), VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT}); |