mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-25 21:54:17 +01:00
Apply RP barrier masks for every draw, rather than the 1st in RP
I missed that addSubpass was only called once-per-subpass, meaning that if a new barrier req was discovered several draws into the RP it wouldn't be applied. Split out barriers into a seperate function to avoid this.
This commit is contained in:
parent
bb20b145a8
commit
ee68facc5d
@ -281,7 +281,7 @@ namespace skyline::gpu::interconnect {
|
||||
|
||||
bool CommandExecutor::CreateRenderPassWithSubpass(vk::Rect2D renderArea, span<TextureView *> sampledImages, span<TextureView *> inputAttachments, span<TextureView *> colorAttachments, TextureView *depthStencilAttachment, bool noSubpassCreation, vk::PipelineStageFlags srcStageMask, vk::PipelineStageFlags dstStageMask) {
|
||||
auto addSubpass{[&] {
|
||||
renderPass->AddSubpass(inputAttachments, colorAttachments, depthStencilAttachment, gpu, srcStageMask, dstStageMask);
|
||||
renderPass->AddSubpass(inputAttachments, colorAttachments, depthStencilAttachment, gpu);
|
||||
lastSubpassColorAttachments.clear();
|
||||
lastSubpassInputAttachments.clear();
|
||||
|
||||
@ -317,6 +317,8 @@ namespace skyline::gpu::interconnect {
|
||||
gotoNext = true;
|
||||
}
|
||||
|
||||
renderPass->UpdateDependency(srcStageMask, dstStageMask);
|
||||
|
||||
for (auto view : outputAttachmentViews)
|
||||
if (view)
|
||||
view->texture->UpdateRenderPassUsage(renderPassIndex, texture::RenderPassUsage::RenderTarget);
|
||||
|
@ -126,10 +126,7 @@ namespace skyline::gpu::interconnect::node {
|
||||
}
|
||||
}
|
||||
|
||||
void RenderPassNode::AddSubpass(span<TextureView *> inputAttachments, span<TextureView *> colorAttachments, TextureView *depthStencilAttachment, GPU &gpu, vk::PipelineStageFlags srcStageMask, vk::PipelineStageFlags dstStageMask) {
|
||||
externalDependency.srcStageMask |= srcStageMask;
|
||||
externalDependency.dstStageMask |= dstStageMask;
|
||||
|
||||
void RenderPassNode::AddSubpass(span<TextureView *> inputAttachments, span<TextureView *> colorAttachments, TextureView *depthStencilAttachment, GPU &gpu) {
|
||||
attachmentReferences.reserve(attachmentReferences.size() + inputAttachments.size() + colorAttachments.size() + (depthStencilAttachment ? 1 : 0));
|
||||
|
||||
auto inputAttachmentsOffset{attachmentReferences.size() * sizeof(vk::AttachmentReference)};
|
||||
@ -175,6 +172,11 @@ namespace skyline::gpu::interconnect::node {
|
||||
});
|
||||
}
|
||||
|
||||
void RenderPassNode::UpdateDependency(vk::PipelineStageFlags srcStageMask, vk::PipelineStageFlags dstStageMask) {
|
||||
externalDependency.srcStageMask |= srcStageMask;
|
||||
externalDependency.dstStageMask |= dstStageMask;
|
||||
}
|
||||
|
||||
bool RenderPassNode::ClearColorAttachment(u32 colorAttachment, const vk::ClearColorValue &value, GPU& gpu) {
|
||||
auto attachmentReference{RebasePointer(attachmentReferences, subpassDescriptions.back().pColorAttachments) + colorAttachment};
|
||||
auto attachmentIndex{attachmentReference->attachment};
|
||||
|
Loading…
Reference in New Issue
Block a user