Force Memory Barrier at VkRenderPass Start

We depend on past commands to have completed execution in a renderpass, a subpass dependency on all graphics stages from `VK_SUBPASS_EXTERNAL` to subpass #0 is used to enforce this. Nvidia and Adreno proprietary drivers implicitly do this but Turnip or Mali drivers require this or they execute out of order.
This commit is contained in:
PixelyIon 2022-01-22 05:43:18 +05:30
parent 35fde2cd0b
commit 22ce531e6f
2 changed files with 15 additions and 1 deletions

View File

@ -4,6 +4,20 @@
#include "command_nodes.h"
namespace skyline::gpu::interconnect::node {
RenderPassNode::RenderPassNode(vk::Rect2D renderArea) : subpassDependencies(
{
// We assume all past commands have been executed when this RP starts
vk::SubpassDependency{
.srcSubpass = VK_SUBPASS_EXTERNAL,
.dstSubpass = 0,
.srcStageMask = vk::PipelineStageFlagBits::eAllGraphics,
.dstStageMask = vk::PipelineStageFlagBits::eAllGraphics,
.srcAccessMask = vk::AccessFlagBits::eMemoryRead | vk::AccessFlagBits::eMemoryWrite,
.dstAccessMask = vk::AccessFlagBits::eMemoryRead | vk::AccessFlagBits::eMemoryWrite,
}
}
), storage(std::make_shared<Storage>()), renderArea(renderArea) {}
RenderPassNode::Storage::~Storage() {
if (device) {
if (framebuffer)

View File

@ -64,7 +64,7 @@ namespace skyline::gpu::interconnect::node {
vk::Rect2D renderArea;
std::vector<vk::ClearValue> clearValues;
RenderPassNode(vk::Rect2D renderArea) : storage(std::make_shared<Storage>()), renderArea(renderArea) {}
RenderPassNode(vk::Rect2D renderArea);
/**
* @note Any preservation of attachments from previous subpasses is automatically handled by this