From 44ff42150603565ccb01147fbb40b49ae356a5ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Petit?= Date: Mon, 3 Jul 2023 09:26:02 +0100 Subject: [PATCH] Assert when a batchable command in built into a batch after being built as standalone (#568) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Assert when a batchable command in built into a batch after being built as standalone Catching the opposite would require adding state to cvk_command_batchable but it's a much harder mistake to make so probably not worth it. Change-Id: I2a010f1e157a4713ef6da907c9b45f4ff2defaf2 Signed-off-by: Kévin Petit * format fixes Change-Id: I0a59463a38f6b4c6a0ad7e22f48ec3d8a9798565 --------- Signed-off-by: Kévin Petit --- src/queue.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/queue.cpp b/src/queue.cpp index d2a6606b..29a8c9d9 100644 --- a/src/queue.cpp +++ b/src/queue.cpp @@ -998,6 +998,8 @@ cl_int cvk_command_batchable::build() { } cl_int cvk_command_batchable::build(cvk_command_buffer& command_buffer) { + CVK_ASSERT(m_command_buffer == nullptr || + (*m_command_buffer == command_buffer)); // Create query pool VkQueryPoolCreateInfo query_pool_create_info = { VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO,