aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2016-06-24 14:41:20 -0600
committerTobin Ehlis <tobine@google.com>2016-06-28 07:40:04 -0600
commit72a4047d2dbbcfef42251914e1b534d306365ebd (patch)
tree9d69d0bf39ef8c31aaf35f95db782a6c2f2a6ca9 /layers/core_validation.cpp
parent07c81dc68a0ae134cf24a0b5365b318d13699359 (diff)
downloadusermoji-72a4047d2dbbcfef42251914e1b534d306365ebd.tar.xz
layers: Update cb_bindings to hold CB_NODE ptr
Store GLOBAL_CB_NODE ptr in cb_bindings to avoid additional look-ups.
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index 7e14c95b..6100e005 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -3777,7 +3777,7 @@ static void resetCB(layer_data *dev_data, const VkCommandBuffer cb) {
for (auto framebuffer : pCB->framebuffers) {
auto fb_node = getFramebuffer(dev_data, framebuffer);
if (fb_node)
- fb_node->cb_bindings.erase(pCB->commandBuffer);
+ fb_node->cb_bindings.erase(pCB);
}
pCB->framebuffers.clear();
pCB->activeFramebuffer = VK_NULL_HANDLE;
@@ -5529,13 +5529,10 @@ DestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocatio
std::unique_lock<std::mutex> lock(global_lock);
auto fb_node = getFramebuffer(dev_data, framebuffer);
if (fb_node) {
- for (auto cb : fb_node->cb_bindings) {
- auto cb_node = getCBNode(dev_data, cb);
- if (cb_node) {
- // Set CB as invalid and record destroyed framebuffer
- cb_node->state = CB_INVALID;
- cb_node->destroyedFramebuffers.insert(framebuffer);
- }
+ for (auto cb_node : fb_node->cb_bindings) {
+ // Set CB as invalid and record destroyed framebuffer
+ cb_node->state = CB_INVALID;
+ cb_node->destroyedFramebuffers.insert(framebuffer);
}
dev_data->frameBufferMap.erase(fb_node->framebuffer);
}
@@ -6232,7 +6229,7 @@ BeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo
(uint64_t)(pInfo->framebuffer), (uint64_t)(fbRP), errorString.c_str());
}
// Connect this framebuffer to this cmdBuffer
- framebuffer->cb_bindings.insert(pCB->commandBuffer);
+ framebuffer->cb_bindings.insert(pCB);
}
}
}
@@ -9211,7 +9208,7 @@ CmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo *p
pCB->activeSubpassContents = contents;
pCB->framebuffers.insert(pRenderPassBegin->framebuffer);
// Connect this framebuffer to this cmdBuffer
- framebuffer->cb_bindings.insert(pCB->commandBuffer);
+ framebuffer->cb_bindings.insert(pCB);
} else {
skipCall |=
log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__,