VulkanRenderer: Fix VkRenderWindow subpass dependencies

This commit is contained in:
Jérôme Leclercq 2021-05-05 12:02:00 +02:00
parent 10aa7231b6
commit bfb93bc925
1 changed files with 13 additions and 21 deletions

View File

@ -435,28 +435,15 @@ namespace Nz
std::vector<RenderPass::SubpassDependency> subpassDependencies = {
{
{
RenderPass::ExternalSubpassIndex,
PipelineStage::ColorOutput,
{},
RenderPass::ExternalSubpassIndex,
PipelineStage::ColorOutput,
{},
0,
PipelineStage::ColorOutput,
MemoryAccess::ColorWrite,
0,
PipelineStage::ColorOutput,
MemoryAccess::ColorWrite,
true //< tilable
},
{
0,
PipelineStage::ColorOutput,
MemoryAccess::ColorWrite,
RenderPass::ExternalSubpassIndex,
PipelineStage::BottomOfPipe,
MemoryAccess::MemoryRead,
true //< tilable
}
true //< tilable
}
};
@ -477,12 +464,17 @@ namespace Nz
AttachmentStoreOp::Discard,
TextureLayout::Undefined,
TextureLayout::DepthStencilReadWrite
});
});
subpasses.front().depthStencilAttachment = RenderPass::AttachmentReference{
1,
TextureLayout::DepthStencilReadWrite
};
auto& subpassDependency = subpassDependencies.front();
subpassDependency.fromStages |= PipelineStage::FragmentTestsEarly;
subpassDependency.toStages |= PipelineStage::FragmentTestsEarly;
subpassDependency.toAccessFlags |= MemoryAccess::DepthStencilWrite;
}
m_renderPass.emplace(*m_device, std::move(attachments), std::move(subpasses), std::move(subpassDependencies));