From b307fca1155a956c83e8109caa80a05ecaf352fb Mon Sep 17 00:00:00 2001 From: PixelyIon Date: Sun, 8 May 2022 18:26:40 +0530 Subject: [PATCH] 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. --- app/src/main/cpp/skyline/gpu/interconnect/command_nodes.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/cpp/skyline/gpu/interconnect/command_nodes.cpp b/app/src/main/cpp/skyline/gpu/interconnect/command_nodes.cpp index 1ee64fef..ee914916 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/command_nodes.cpp +++ b/app/src/main/cpp/skyline/gpu/interconnect/command_nodes.cpp @@ -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