diff --git a/native/cocos/renderer/pipeline/custom/FrameGraphDispatcher.cpp b/native/cocos/renderer/pipeline/custom/FrameGraphDispatcher.cpp index 4d0f5afe176..0ac2474e733 100644 --- a/native/cocos/renderer/pipeline/custom/FrameGraphDispatcher.cpp +++ b/native/cocos/renderer/pipeline/custom/FrameGraphDispatcher.cpp @@ -791,12 +791,15 @@ struct AttachmentSortKey { gfx::SampleCount samples; AccessType accessType; uint32_t attachmentWeight; - const ccstd::pmr::string name; + uint32_t slotID; + const ccstd::pmr::string &slotName; + const ccstd::pmr::string &name; }; struct AttachmentComparator { bool operator()(const AttachmentSortKey &lhs, const AttachmentSortKey &rhs) const { - return std::tie(rhs.samples, lhs.accessType, lhs.attachmentWeight, lhs.name) < std::tie(lhs.samples, rhs.accessType, rhs.attachmentWeight, rhs.name); + return std::tie(rhs.samples, lhs.accessType, lhs.attachmentWeight, lhs.slotID, lhs.slotName, lhs.name) < + std::tie(lhs.samples, rhs.accessType, rhs.attachmentWeight, rhs.slotID, rhs.slotName, rhs.name); } }; @@ -956,6 +959,8 @@ auto checkRasterViews(const Graphs &graphs, colorMap.emplace(AttachmentSortKey{desc.sampleCount, rasterView.accessType, ATTACHMENT_TYPE_WEIGHT[static_cast(rasterView.attachmentType)], + rasterView.slotID, + rasterView.slotName1.empty() ? rasterView.slotName : rasterView.slotName1, resName}, ViewInfo{desc.format, LayoutAccess{lastAccess, accessFlag}, @@ -1051,6 +1056,8 @@ bool checkResolveResource(const Graphs &graphs, colorMap.emplace(AttachmentSortKey{desc.sampleCount, AccessType::WRITE, ATTACHMENT_TYPE_WEIGHT[static_cast(attachmentType)], + INVALID_ID, + "", resolveTargetName}, ViewInfo{desc.format, LayoutAccess{lastAccess, accessFlag}, diff --git a/native/cocos/renderer/pipeline/custom/NativeRenderGraph.cpp b/native/cocos/renderer/pipeline/custom/NativeRenderGraph.cpp index 960cb08d0d4..44054563cd6 100644 --- a/native/cocos/renderer/pipeline/custom/NativeRenderGraph.cpp +++ b/native/cocos/renderer/pipeline/custom/NativeRenderGraph.cpp @@ -296,7 +296,7 @@ void addRasterViewImpl( auto &pass = get(RasterPassTag{}, passID, renderGraph); CC_EXPECTS(subpass.subpassID < num_vertices(pass.subpassGraph)); auto &subpassData = get(SubpassGraph::SubpassTag{}, pass.subpassGraph, subpass.subpassID); - const auto slotID = getSlotID(pass, name, attachmentType); + const auto slotID = static_cast(subpass.rasterViews.size()); CC_EXPECTS(subpass.rasterViews.size() == subpassData.rasterViews.size()); auto nameIter = subpassData.rasterViews.find(name);