Remove explicit feature-pass shadow graph handle
This commit is contained in:
@@ -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<CameraFrameRenderGraphResources>();
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user