@@ -412,6 +412,15 @@ struct RenderGraphVisitor : boost::dfs_visitor<> {
412412 get<0 >(iter->second ));
413413 }
414414 }
415+ void tryBindUIOverwritePerPassDescriptorSet (RenderGraph::vertex_descriptor sceneID) const {
416+ auto iter = ctx.uiDescriptorSet .find (sceneID);
417+ if (iter != ctx.uiDescriptorSet .end ()) {
418+ CC_EXPECTS (iter->second );
419+ ctx.cmdBuff ->bindDescriptorSet (
420+ static_cast <uint32_t >(pipeline::SetIndex::GLOBAL ),
421+ iter->second );
422+ }
423+ }
415424 void begin (const RasterPass& pass, RenderGraph::vertex_descriptor vertID) const {
416425 const auto & renderData = get (RenderGraph::DataTag{}, ctx.g , vertID);
417426 if (!renderData.custom .empty ()) {
@@ -692,6 +701,7 @@ struct RenderGraphVisitor : boost::dfs_visitor<> {
692701 if (queueData.passLayoutID != LayoutGraphData::null_vertex ()) {
693702 const auto phaseLayoutID = locate (queueData.passLayoutID , " default" , ctx.lg );
694703 if (phaseLayoutID != LayoutGraphData::null_vertex ()) {
704+ tryBindUIOverwritePerPassDescriptorSet (sceneID);
695705 submitUICommands (ctx.currentPass , phaseLayoutID, camera, ctx.cmdBuff );
696706 }
697707 } else {
@@ -704,6 +714,7 @@ struct RenderGraphVisitor : boost::dfs_visitor<> {
704714 CC_ENSURES (passLayoutID != LayoutGraphData::null_vertex ());
705715 const auto phaseLayoutID = locate (passLayoutID, " default" , ctx.lg );
706716 if (phaseLayoutID != LayoutGraphData::null_vertex ()) {
717+ tryBindUIOverwritePerPassDescriptorSet (sceneID);
707718 submitUICommands (ctx.currentPass , phaseLayoutID, camera, ctx.cmdBuff );
708719 }
709720 } else { // Subpass
@@ -721,6 +732,7 @@ struct RenderGraphVisitor : boost::dfs_visitor<> {
721732 CC_ENSURES (subpassLayoutID != LayoutGraphData::null_vertex ());
722733 const auto phaseLayoutID = locate (subpassLayoutID, " default" , ctx.lg );
723734 if (phaseLayoutID != LayoutGraphData::null_vertex ()) {
735+ tryBindUIOverwritePerPassDescriptorSet (sceneID);
724736 submitUICommands (ctx.currentPass , phaseLayoutID, camera, ctx.cmdBuff );
725737 }
726738 }
@@ -1320,6 +1332,10 @@ void NativePipeline::executeRenderGraph(const RenderGraph& rg) {
13201332 std::tuple<gfx::DescriptorSet*, gfx::DescriptorSet*>>
13211333 renderGraphDescriptorSet (scratch);
13221334
1335+ ccstd::pmr::unordered_map<
1336+ RenderGraph::vertex_descriptor, gfx::DescriptorSet*>
1337+ uiDescriptorSet (scratch);
1338+
13231339 ccstd::pmr::unordered_map<
13241340 RenderGraph::vertex_descriptor,
13251341 gfx::DescriptorSet*>
@@ -1340,6 +1356,7 @@ void NativePipeline::executeRenderGraph(const RenderGraph& rg) {
13401356 &ppl,
13411357 perPassResourceIndex,
13421358 renderGraphDescriptorSet,
1359+ uiDescriptorSet,
13431360 profilerPerPassDescriptorSets,
13441361 perInstanceDescriptorSets,
13451362 programLibrary,
0 commit comments