Split render-graph main scene into forward segments

This commit is contained in:
2026-04-14 16:31:32 +08:00
parent 0060a348f6
commit a91df8b4cd
4 changed files with 246 additions and 26 deletions

View File

@@ -609,9 +609,19 @@ TEST(BuiltinForwardPipeline_Test, RecordsMainSceneGraphPassWithSampledShadowDepe
String errorMessage;
ASSERT_TRUE(RenderGraphCompiler::Compile(graph, compiledGraph, &errorMessage))
<< errorMessage.CStr();
EXPECT_EQ(compiledGraph.GetPassCount(), 1u);
EXPECT_STREQ(compiledGraph.GetPassName(0).CStr(), "MainScene");
EXPECT_EQ(compiledGraph.GetPassCount(), 3u);
EXPECT_STREQ(compiledGraph.GetPassName(0).CStr(), "MainScene.Opaque");
EXPECT_STREQ(compiledGraph.GetPassName(1).CStr(), "MainScene.Skybox");
EXPECT_STREQ(compiledGraph.GetPassName(2).CStr(), "MainScene.Transparent");
EXPECT_EQ(compiledGraph.GetPassType(0), RenderGraphPassType::Raster);
EXPECT_EQ(compiledGraph.GetPassType(1), RenderGraphPassType::Raster);
EXPECT_EQ(compiledGraph.GetPassType(2), RenderGraphPassType::Raster);
RenderGraphTextureLifetime shadowLifetime = {};
ASSERT_TRUE(compiledGraph.TryGetTextureLifetime(shadowTarget, shadowLifetime));
EXPECT_TRUE(shadowLifetime.used);
EXPECT_EQ(shadowLifetime.firstPassIndex, 0u);
EXPECT_EQ(shadowLifetime.lastPassIndex, 2u);
RenderGraphTextureTransitionPlan shadowPlan = {};
ASSERT_TRUE(compiledGraph.TryGetTextureTransitionPlan(shadowTarget, shadowPlan));