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 | 413b1280a450439be3fad4bafce0d685369dc257 (patch) | |
| tree | db93e76ccfbe6b57cee2911e96f95328d4524d5b /layers/core_validation.cpp | |
| parent | b8fb2e353e69fd1c4293a0336e3efba0fb16563e (diff) | |
| download | usermoji-413b1280a450439be3fad4bafce0d685369dc257.tar.xz | |
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}); |
