diff --git a/engine/include/XCEngine/Rendering/SceneRenderFeaturePass.h b/engine/include/XCEngine/Rendering/SceneRenderFeaturePass.h index 767ca73c..591684fc 100644 --- a/engine/include/XCEngine/Rendering/SceneRenderFeaturePass.h +++ b/engine/include/XCEngine/Rendering/SceneRenderFeaturePass.h @@ -29,7 +29,6 @@ struct SceneRenderFeaturePassRenderGraphContext { RenderGraphTextureHandle sourceColorTexture = {}; std::vector colorTargets = {}; RenderGraphTextureHandle depthTarget = {}; - RenderGraphTextureHandle mainDirectionalShadowTexture = {}; bool clearAttachments = false; bool* executionSucceeded = nullptr; SceneRenderFeaturePassBeginCallback beginPassCallback = {}; diff --git a/engine/src/Rendering/Pipelines/Internal/BuiltinForwardPipelineFrame.cpp b/engine/src/Rendering/Pipelines/Internal/BuiltinForwardPipelineFrame.cpp index 2050c875..4178af9c 100644 --- a/engine/src/Rendering/Pipelines/Internal/BuiltinForwardPipelineFrame.cpp +++ b/engine/src/Rendering/Pipelines/Internal/BuiltinForwardPipelineFrame.cpp @@ -195,7 +195,6 @@ bool BuiltinForwardPipeline::RecordMainSceneRenderGraph( {}, colorTargets, depthTarget, - mainDirectionalShadowTexture, clearAttachments, executionSucceeded, beginRecordedPass, diff --git a/engine/src/Rendering/SceneRenderFeatureHost.cpp b/engine/src/Rendering/SceneRenderFeatureHost.cpp index 7e70c016..4dd82588 100644 --- a/engine/src/Rendering/SceneRenderFeatureHost.cpp +++ b/engine/src/Rendering/SceneRenderFeatureHost.cpp @@ -134,7 +134,6 @@ bool SceneRenderFeatureHost::Record( context.sourceColorTexture, context.colorTargets, context.depthTarget, - context.mainDirectionalShadowTexture, clearAttachments, context.executionSucceeded, context.beginPassCallback, diff --git a/tests/Rendering/unit/test_builtin_forward_pipeline.cpp b/tests/Rendering/unit/test_builtin_forward_pipeline.cpp index 238d8f6d..33e8412b 100644 --- a/tests/Rendering/unit/test_builtin_forward_pipeline.cpp +++ b/tests/Rendering/unit/test_builtin_forward_pipeline.cpp @@ -474,6 +474,14 @@ public: const SceneRenderFeaturePassRenderGraphContext& context) override { ++recordGraphCallCount; lastReceivedSourceColorTextureValid = context.sourceColorTexture.IsValid(); + lastReceivedRenderGraphBlackboard = context.blackboard != nullptr; + if (const CameraFrameRenderGraphResources* frameResources = + TryGetCameraFrameRenderGraphResources(context.blackboard)) { + lastReceivedMainDirectionalShadowValid = + frameResources->mainDirectionalShadow.IsValid(); + } else { + lastReceivedMainDirectionalShadowValid = false; + } RecordEvent("RecordGraph"); return SceneRenderFeaturePass::RecordRenderGraph(context); } @@ -492,6 +500,8 @@ public: bool lastSourceSurfaceAutoTransitionEnabled = true; XCEngine::RHI::RHIResourceView* lastSourceColorView = nullptr; bool lastReceivedSourceColorTextureValid = false; + bool lastReceivedRenderGraphBlackboard = false; + bool lastReceivedMainDirectionalShadowValid = false; private: void RecordEvent(const char* suffix) { @@ -749,7 +759,6 @@ TEST(SceneRenderFeaturePass_Test, RecordsDefaultGraphPassAndExecutesWrappedCallb {}, { colorTarget }, depthTarget, - {}, false, &executionSucceeded, [&beginPassCalls](const RenderPassContext&, bool) { @@ -849,7 +858,6 @@ TEST(SceneRenderFeaturePass_Test, ReadsSourceColorTextureAndCopiesSourceSurfaceT sourceColor, { outputColor }, {}, - {}, false, &executionSucceeded, {}, @@ -1031,6 +1039,8 @@ TEST(SceneRenderFeatureHost_Test, RecordsActiveInjectionPointFeaturesIntoRenderG graphBuilder.ImportTexture("Color", colorDesc, &colorView, graphManagedImport); const RenderGraphTextureHandle depthTarget = graphBuilder.ImportTexture("Depth", depthDesc, &depthView, graphManagedImport); + const RenderGraphTextureHandle shadowTarget = + graphBuilder.ImportTexture("Shadow", depthDesc, &depthView, graphManagedImport); RenderContext renderContext = {}; RenderSceneData sceneData = {}; @@ -1038,6 +1048,10 @@ TEST(SceneRenderFeatureHost_Test, RecordsActiveInjectionPointFeaturesIntoRenderG surface.SetColorAttachment(&colorView); surface.SetDepthAttachment(&depthView); surface.SetAutoTransitionEnabled(false); + RenderGraphBlackboard blackboard = {}; + CameraFrameRenderGraphResources& frameResources = + blackboard.Emplace(); + frameResources.mainDirectionalShadow = shadowTarget; bool executionSucceeded = true; const SceneRenderFeaturePassRenderGraphContext context = { @@ -1052,14 +1066,14 @@ TEST(SceneRenderFeatureHost_Test, RecordsActiveInjectionPointFeaturesIntoRenderG {}, { colorTarget }, depthTarget, - {}, true, &executionSucceeded, [](const RenderPassContext&, bool) { return true; }, [](const RenderPassContext&) { - } + }, + &blackboard }; bool recordedAnyPass = false; @@ -1081,6 +1095,10 @@ TEST(SceneRenderFeatureHost_Test, RecordsActiveInjectionPointFeaturesIntoRenderG EXPECT_EQ(secondRaw->recordGraphCallCount, 1u); EXPECT_EQ(otherPointRaw->recordGraphCallCount, 0u); EXPECT_EQ(inactiveRaw->recordGraphCallCount, 0u); + EXPECT_TRUE(firstRaw->lastReceivedRenderGraphBlackboard); + EXPECT_TRUE(secondRaw->lastReceivedRenderGraphBlackboard); + EXPECT_TRUE(firstRaw->lastReceivedMainDirectionalShadowValid); + EXPECT_TRUE(secondRaw->lastReceivedMainDirectionalShadowValid); } TEST(BuiltinForwardPipeline_Test, RegistersAdditionalForwardSceneFeaturePasses) {