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.
diff --git a/layers/mem_tracker.cpp b/layers/mem_tracker.cpp
index e7462f2..5ce7974 100644
--- a/layers/mem_tracker.cpp
+++ b/layers/mem_tracker.cpp
@@ -2065,8 +2065,6 @@
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 @@
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 @@
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) {