From 92d20e9c602e6cbb968989d82e8bc677daa1d61c Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Mon, 21 Nov 2016 08:31:01 -0700 Subject: layers:Warn on cmd buffer invalidate From Mikko Strandborg When a resource gets deleted, any command buffer that references it gets invalidated, and an error gets thrown whenever that command buffer is submitted. However, for a developer, it's quite hard to deduce what exactly caused that to happen. This patch emits a warning whenever a command buffer that's in CB_RECORDING state (meaning that it has had its vkBeginCommandBuffer called but not End). This way the developer can set a breakpoint on that to see exactly what causes the buffer to be invalidated. Destroying a resource that's being used in an open command buffer is almost certainly a bug, but there might still be cases where it might be valid behavior (for example, when the application decides to abort an operation), therefore it's not an error but a warning instead. --- layers/descriptor_sets.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'layers/descriptor_sets.cpp') diff --git a/layers/descriptor_sets.cpp b/layers/descriptor_sets.cpp index f2326dcb..2a6b73e1 100644 --- a/layers/descriptor_sets.cpp +++ b/layers/descriptor_sets.cpp @@ -541,7 +541,7 @@ uint32_t cvdescriptorset::DescriptorSet::GetStorageUpdates(const std::map(set_), VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT}); } // Perform write update in given update struct -- cgit v1.2.3