Fix attachment reuse within the same subpass

Certain titles such as BOTW trigger behavior to reuse an attachment within the same subpass, this caused an exception inside `RenderPassNode::AddAttachment` as it cannot find corresponding subpass for attachment. To fix this issue, we now assume that when it cannot find a subpass for an existing attachment, it is attached to the latest subpass and return the attachment.
This commit is contained in:
PixelyIon 2022-05-08 18:26:40 +05:30
parent e027555796
commit b307fca115

View File

@ -71,8 +71,8 @@ namespace skyline::gpu::interconnect::node {
}
if (it == subpassDescriptions.end())
// We should never have a case where an attachment is bound to the render pass but not utilized by any subpass
throw exception("Cannot find corresponding subpass for attachment #{}", attachmentIndex);
// We assume an attachment is used by the latest subpass if it is not utilized by any past subpasses
return attachmentIndex;
// We want to preserve the attachment for all subpasses till the current subpass
auto lastUsageIt{it}; //!< The last subpass that the attachment has been used in for creating a dependency