aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2017-09-28 13:20:53 -0600
committerTobin Ehlis <tobine@google.com>2017-09-28 13:26:43 -0700
commit5f43e07378f620e533528f0abd0d3dc49a414a6d (patch)
tree9508da0a7f7b052349b4a4cb8cb71108a220ae90 /layers/core_validation.cpp
parent0bdbf3c2d36a556ab2aa9ccf27b62a6ef5d21016 (diff)
downloadusermoji-5f43e07378f620e533528f0abd0d3dc49a414a6d.tar.xz
layers:Fix renderPass<->cmdBuffer binding
At BeginRenderPass() time bind the active renderPass to the cmdBuffer. Don't bind the renderPass used to create the framebuffer. The renderPass lifetime rules allow the renderPass used in FB creation to be destroyed after FB creation.
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index 9671e5f7..5d1e7f51 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -4996,11 +4996,6 @@ static void AddFramebufferBinding(layer_data *dev_data, GLOBAL_CB_NODE *cb_state
if (view_state) {
AddCommandBufferBindingImageView(dev_data, cb_state, view_state);
}
- auto rp_state = GetRenderPassState(dev_data, fb_state->createInfo.renderPass);
- if (rp_state) {
- addCommandBufferBinding(&rp_state->cb_bindings, {HandleToUint64(rp_state->renderPass), kVulkanObjectTypeRenderPass},
- cb_state);
- }
}
}
@@ -8114,6 +8109,9 @@ VKAPI_ATTR void VKAPI_CALL CmdBeginRenderPass(VkCommandBuffer commandBuffer, con
cb_node->framebuffers.insert(pRenderPassBegin->framebuffer);
// Connect this framebuffer and its children to this cmdBuffer
AddFramebufferBinding(dev_data, cb_node, framebuffer);
+ // Connect this RP to cmdBuffer
+ addCommandBufferBinding(&render_pass_state->cb_bindings,
+ {HandleToUint64(render_pass_state->renderPass), kVulkanObjectTypeRenderPass}, cb_node);
// transition attachments to the correct layouts for beginning of renderPass and first subpass
TransitionBeginRenderPassLayouts(dev_data, cb_node, render_pass_state, framebuffer);
}