aboutsummaryrefslogtreecommitdiff
path: root/layers/draw_state.cpp
diff options
context:
space:
mode:
authorChris Forbes <chrisforbes@google.com>2016-02-02 15:45:40 +1300
committerTobin Ehlis <tobine@google.com>2016-02-04 11:17:40 -0700
commit96d359c52a540b9b3bc036c6e403a80703913590 (patch)
tree052e56a540b35c8d71a54f901d619d32863ae462 /layers/draw_state.cpp
parentcab375751113b1562ed1fe96b9a59a70bfcd1bb5 (diff)
downloadusermoji-96d359c52a540b9b3bc036c6e403a80703913590.tar.xz
layers: Fix issues with some command buffer tracking structures being left uninitialized
Signed-off-by: Chris Forbes <chrisforbes@google.com>
Diffstat (limited to 'layers/draw_state.cpp')
-rw-r--r--layers/draw_state.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp
index 5171109b..b7d69539 100644
--- a/layers/draw_state.cpp
+++ b/layers/draw_state.cpp
@@ -2733,6 +2733,8 @@ static void resetCB(layer_data* my_data, const VkCommandBuffer cb)
pCB->submitCount = 0;
pCB->status = 0;
pCB->lastBoundPipeline = 0;
+ pCB->lastVtxBinding = 0;
+ pCB->boundVtxBuffers.clear();
pCB->viewports.clear();
pCB->scissors.clear();
pCB->lineWidth = 0;
@@ -2746,8 +2748,11 @@ static void resetCB(layer_data* my_data, const VkCommandBuffer cb)
memset(&pCB->back, 0, sizeof(stencil_data));
pCB->lastBoundDescriptorSet = 0;
pCB->lastBoundPipelineLayout = 0;
+ memset(&pCB->activeRenderPassBeginInfo, 0, sizeof(pCB->activeRenderPassBeginInfo));
pCB->activeRenderPass = 0;
+ pCB->activeSubpassContents = VK_SUBPASS_CONTENTS_INLINE;
pCB->activeSubpass = 0;
+ pCB->framebuffer = 0;
// Before clearing uniqueBoundSets, remove this CB off of its boundCBs
for (auto set : pCB->uniqueBoundSets) {
auto set_node = my_data->setMap.find(set);
@@ -2756,16 +2761,18 @@ static void resetCB(layer_data* my_data, const VkCommandBuffer cb)
}
}
pCB->uniqueBoundSets.clear();
- pCB->framebuffer = 0;
+ pCB->destroyedSets.clear();
+ pCB->updatedSets.clear();
pCB->boundDescriptorSets.clear();
- pCB->drawData.clear();
- pCB->currentDrawData.buffers.clear();
- pCB->imageLayoutMap.clear();
pCB->waitedEvents.clear();
pCB->waitedEventsBeforeQueryReset.clear();
pCB->queryToStateMap.clear();
pCB->activeQueries.clear();
+ pCB->imageLayoutMap.clear();
+ pCB->drawData.clear();
+ pCB->currentDrawData.buffers.clear();
pCB->secondaryCommandBuffers.clear();
+ pCB->dynamicOffsets.clear();
}
}
@@ -4327,7 +4334,6 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkAllocateCommandBuffers(VkDevice
// Add command buffer to map
dev_data->commandBufferMap[pCommandBuffer[i]] = pCB;
resetCB(dev_data, pCommandBuffer[i]);
- pCB->commandBuffer = pCommandBuffer[i];
pCB->createInfo = *pCreateInfo;
pCB->device = device;
loader_platform_thread_unlock_mutex(&globalLock);