mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-29 14:54:16 +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) {
|
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{[&] {
|
auto addSubpass{[&] {
|
||||||
renderPass->AddSubpass(inputAttachments, colorAttachments, depthStencilAttachment, gpu, srcStageMask, dstStageMask);
|
renderPass->AddSubpass(inputAttachments, colorAttachments, depthStencilAttachment, gpu);
|
||||||
lastSubpassColorAttachments.clear();
|
lastSubpassColorAttachments.clear();
|
||||||
lastSubpassInputAttachments.clear();
|
lastSubpassInputAttachments.clear();
|
||||||
|
|
||||||
@ -317,6 +317,8 @@ namespace skyline::gpu::interconnect {
|
|||||||
gotoNext = true;
|
gotoNext = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
renderPass->UpdateDependency(srcStageMask, dstStageMask);
|
||||||
|
|
||||||
for (auto view : outputAttachmentViews)
|
for (auto view : outputAttachmentViews)
|
||||||
if (view)
|
if (view)
|
||||||
view->texture->UpdateRenderPassUsage(renderPassIndex, texture::RenderPassUsage::RenderTarget);
|
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) {
|
void RenderPassNode::AddSubpass(span<TextureView *> inputAttachments, span<TextureView *> colorAttachments, TextureView *depthStencilAttachment, GPU &gpu) {
|
||||||
externalDependency.srcStageMask |= srcStageMask;
|
|
||||||
externalDependency.dstStageMask |= dstStageMask;
|
|
||||||
|
|
||||||
attachmentReferences.reserve(attachmentReferences.size() + inputAttachments.size() + colorAttachments.size() + (depthStencilAttachment ? 1 : 0));
|
attachmentReferences.reserve(attachmentReferences.size() + inputAttachments.size() + colorAttachments.size() + (depthStencilAttachment ? 1 : 0));
|
||||||
|
|
||||||
auto inputAttachmentsOffset{attachmentReferences.size() * sizeof(vk::AttachmentReference)};
|
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) {
|
bool RenderPassNode::ClearColorAttachment(u32 colorAttachment, const vk::ClearColorValue &value, GPU& gpu) {
|
||||||
auto attachmentReference{RebasePointer(attachmentReferences, subpassDescriptions.back().pColorAttachments) + colorAttachment};
|
auto attachmentReference{RebasePointer(attachmentReferences, subpassDescriptions.back().pColorAttachments) + colorAttachment};
|
||||||
auto attachmentIndex{attachmentReference->attachment};
|
auto attachmentIndex{attachmentReference->attachment};
|
||||||
|
Loading…
Reference in New Issue
Block a user