layers:Remove invalid renderPass binding
authorTobin Ehlis <tobine@google.com>
Thu, 28 Sep 2017 18:46:58 +0000 (12:46 -0600)
committerTobin Ehlis <tobine@google.com>
Thu, 28 Sep 2017 20:26:43 +0000 (13:26 -0700)
There's no reason to create a binding between RP used in pipeline
creation and the cmd buffer that pipeline is bound to. This can lead
to a bug where CB is incorrectly invalidated if that RP is destroyed
after pipeline is bound to CB.

layers/core_validation.cpp

index 31e090f..9671e5f 100644 (file)
@@ -5198,14 +5198,6 @@ VKAPI_ATTR void VKAPI_CALL CmdBindPipeline(VkCommandBuffer commandBuffer, VkPipe
         set_pipeline_state(pipe_state);
         skip |= validate_dual_src_blend_feature(dev_data, pipe_state);
         addCommandBufferBinding(&pipe_state->cb_bindings, {HandleToUint64(pipeline), kVulkanObjectTypePipeline}, cb_state);
-        if (VK_PIPELINE_BIND_POINT_GRAPHICS == pipelineBindPoint) {
-            // Add binding for child renderpass
-            auto rp_state = GetRenderPassState(dev_data, pipe_state->rp_state->renderPass);
-            if (rp_state) {
-                addCommandBufferBinding(&rp_state->cb_bindings, {HandleToUint64(rp_state->renderPass), kVulkanObjectTypeRenderPass},
-                                        cb_state);
-            }
-        }
     }
     lock.unlock();
     if (!skip) dev_data->dispatch_table.CmdBindPipeline(commandBuffer, pipelineBindPoint, pipeline);