aboutsummaryrefslogtreecommitdiff
path: root/layers/mem_tracker.cpp
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2015-12-14 13:46:38 -0700
committerMark Lobodzinski <mark@lunarg.com>2015-12-14 15:35:53 -0700
commit4c2ae7eea800099e872381423ba1406988d131ea (patch)
treeb08da4363505659a51339681d0256278d767c387 /layers/mem_tracker.cpp
parent271e523f3aafe5ce01613ef5d3b117bc3b4546eb (diff)
downloadusermoji-4c2ae7eea800099e872381423ba1406988d131ea.tar.xz
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.
Diffstat (limited to 'layers/mem_tracker.cpp')
-rw-r--r--layers/mem_tracker.cpp5
1 files changed, 1 insertions, 4 deletions
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) {