From ff71cd1a856257c607bf933d436f0b5fd94568f9 Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Thu, 18 Aug 2016 07:58:33 -0600 Subject: layers: Flag error on destroyed pipeline in-use --- layers/core_validation.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'layers/core_validation.cpp') diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 8d4e492c..b8c61a39 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -5733,10 +5733,14 @@ DestroyShaderModule(VkDevice device, VkShaderModule shaderModule, const VkAlloca VKAPI_ATTR void VKAPI_CALL DestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks *pAllocator) { layer_data *dev_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); - // TODO : Add detection for in-flight pipeline std::unique_lock lock(global_lock); auto pipe_node = getPipeline(dev_data, pipeline); if (pipe_node) { + if (pipe_node->in_use.load()) { + log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, + reinterpret_cast(pipeline), __LINE__, DRAWSTATE_OBJECT_INUSE, "DS", + "Pipeline 0x%" PRIx64 " being destroyed while in use.", reinterpret_cast(pipeline)); + } // Any bound cmd buffers are now invalid invalidateCommandBuffers(pipe_node->cb_bindings, {reinterpret_cast(pipeline), VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT}); -- cgit v1.2.3