From 4c2ae7eea800099e872381423ba1406988d131ea Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Mon, 14 Dec 2015 13:46:38 -0700 Subject: layers: Add DrawState checks for correct CmdBuffer reset Can only reset individual CmdBuffers if they are allocated from a pool that included the VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT. Also need to intercept vkResetCommandPool() function and make sure that all individual CmdBuffers allocated from that pool are reset when called. Finally, updated naming of cmdBuffer states (RECORDING & RECORDED) to more closely match spec. --- layers/mem_tracker.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'layers/mem_tracker.cpp') diff --git a/layers/mem_tracker.cpp b/layers/mem_tracker.cpp index e7462f28..5ce7974f 100644 --- a/layers/mem_tracker.cpp +++ b/layers/mem_tracker.cpp @@ -2065,8 +2065,6 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandPool( VkBool32 skipCall = VK_FALSE; VkResult result = VK_ERROR_VALIDATION_FAILED; - // TODO: Check the commandPool's flags to see if reset is available for this pool. - auto it = my_data->commandPoolMap[commandPool].pCommandBuffers.begin(); // Verify that CB's in pool are complete (not in-flight) while (it != my_data->commandPoolMap[commandPool].pCommandBuffers.end()) { @@ -2081,6 +2079,7 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandPool( skipCall |= clear_cmd_buf_and_mem_references(my_data, (*it)); loader_platform_thread_unlock_mutex(&globalLock); } + ++it; } if (VK_FALSE == skipCall) { @@ -2137,8 +2136,6 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkResetCommandBuffer( VkBool32 commandBufferComplete = VK_FALSE; loader_platform_thread_lock_mutex(&globalLock); - // TODO: Validate that this cmdBuffer's command pool allows reset - // Verify that CB is complete (not in-flight) skipCall = checkCBCompleted(my_data, commandBuffer, &commandBufferComplete); if (VK_FALSE == commandBufferComplete) { -- cgit v1.2.3