Respect the original subpass contents when replaying renderpasses

* We also need to take care to patch this now, when replaying a single draw that
  was originally in a secondary but we replay in a primary.
This commit is contained in:
baldurk
2022-02-09 12:58:23 +00:00
parent 53b507c44b
commit b05830d668
2 changed files with 13 additions and 2 deletions
+10
View File
@@ -3717,6 +3717,13 @@ void WrappedVulkan::ReplayLog(uint32_t startEventID, uint32_t endEventID, Replay
vkr = ObjDisp(cmd)->BeginCommandBuffer(Unwrap(cmd), &beginInfo);
CheckVkResult(vkr);
// we're replaying a single item inline, even if it was previously in a secondary command
// buffer execution.
VkSubpassContents subpassContents = m_RenderState.subpassContents;
VkRenderingFlags dynamicFlags = m_RenderState.dynamicRendering.flags;
m_RenderState.subpassContents = VK_SUBPASS_CONTENTS_INLINE;
m_RenderState.dynamicRendering.flags &= VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT;
rpWasActive = m_Partial[Primary].renderPassActive;
if(m_Partial[Primary].renderPassActive)
@@ -3761,6 +3768,9 @@ void WrappedVulkan::ReplayLog(uint32_t startEventID, uint32_t endEventID, Replay
// even outside of render passes, we need to restore the state
m_RenderState.BindPipeline(this, cmd, VulkanRenderState::BindInitial, false);
}
m_RenderState.subpassContents = subpassContents;
m_RenderState.dynamicRendering.flags = dynamicFlags;
}
ReplayStatus status = ReplayStatus::Succeeded;
+3 -2
View File
@@ -141,10 +141,11 @@ void VulkanRenderState::BeginRenderPassAndApplyState(WrappedVulkan *vk, VkComman
imagelessAttachments.pAttachments = imagelessViews.data();
}
ObjDisp(cmd)->CmdBeginRenderPass(Unwrap(cmd), &rpbegin, VK_SUBPASS_CONTENTS_INLINE);
ObjDisp(cmd)->CmdBeginRenderPass(Unwrap(cmd), &rpbegin, subpassContents);
}
BindPipeline(vk, cmd, binding, true);
if(subpassContents != VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS)
BindPipeline(vk, cmd, binding, true);
if(IsConditionalRenderingEnabled())
{