Close URP stage planning authority

This commit is contained in:
2026-04-28 00:38:52 +08:00
parent 43a71bd09c
commit 2d91085567
4 changed files with 59 additions and 72 deletions

View File

@@ -4444,6 +4444,49 @@ TEST(RenderPipelineHost_Test, PlansFullscreenStagesFromPipelineAssetPolicy) {
EXPECT_TRUE(plan.IsFinalOutputStageValid());
}
TEST(RenderPipelineHost_Test, DoesNotPromoteFullscreenPassRequestFieldsAfterAssetPlanning) {
RenderPassSequence postProcessPasses;
auto assetState = std::make_shared<MockPipelineAssetState>();
assetState->configureCameraFramePlan = [&postProcessPasses](
CameraFramePlan& plan) {
plan.postProcess.passes = &postProcessPasses;
};
auto allocationState = std::make_shared<MockShadowAllocationState>();
MockShadowView colorView(
allocationState,
XCEngine::RHI::ResourceViewType::RenderTarget,
XCEngine::RHI::Format::R8G8B8A8_UNorm,
XCEngine::RHI::ResourceViewDimension::Texture2D);
MockShadowView depthView(
allocationState,
XCEngine::RHI::ResourceViewType::DepthStencil,
XCEngine::RHI::Format::D24_UNorm_S8_UInt,
XCEngine::RHI::ResourceViewDimension::Texture2D);
CameraRenderRequest request = {};
request.context = CreateValidContext();
request.surface = RenderSurface(320, 180);
request.surface.SetColorAttachment(&colorView);
request.surface.SetDepthAttachment(&depthView);
RenderPipelineHost host(std::make_shared<MockPipelineAsset>(assetState));
const std::vector<CameraFramePlan> plans =
host.BuildFramePlans({ request });
ASSERT_EQ(plans.size(), 1u);
const CameraFramePlan& plan = plans[0];
EXPECT_EQ(plan.postProcess.passes, &postProcessPasses);
EXPECT_FALSE(
plan.IsFullscreenStageRequested(
CameraFrameStage::PostProcess));
EXPECT_FALSE(plan.UsesGraphManagedSceneColor());
EXPECT_EQ(
plan.ResolveStageColorSource(CameraFrameStage::PostProcess),
CameraFrameColorSource::ExplicitSurface);
}
TEST(RenderPipelineHost_Test, ForwardsPipelineAssetLifetimeAndRenderCallsToCameraRenderer) {
Scene scene("RenderPipelineHostScene");