Add render-graph blackboard for camera frame resources
This commit is contained in:
@@ -771,7 +771,10 @@ bool ExecuteRenderGraphPlan(
|
||||
CameraFrameExecutionState& executionState) {
|
||||
RenderGraph graph = {};
|
||||
RenderGraphBuilder graphBuilder(graph);
|
||||
RenderGraphBlackboard blackboard = {};
|
||||
RenderGraphImportedTextureRegistry importedTextures = {};
|
||||
CameraFrameRenderGraphResources& frameResources =
|
||||
blackboard.Emplace<CameraFrameRenderGraphResources>();
|
||||
|
||||
bool stageExecutionSucceeded = true;
|
||||
RenderGraphTextureHandle mainDirectionalShadowTexture = {};
|
||||
@@ -896,6 +899,14 @@ bool ExecuteRenderGraphPlan(
|
||||
shadowState.HasShadowSampling() &&
|
||||
outputSurface.depthTexture.IsValid()) {
|
||||
mainDirectionalShadowTexture = outputSurface.depthTexture;
|
||||
frameResources.mainDirectionalShadow = outputSurface.depthTexture;
|
||||
}
|
||||
if (stage == CameraFrameStage::MainScene) {
|
||||
frameResources.mainSceneColor = GetPrimaryColorTexture(outputSurface);
|
||||
frameResources.mainSceneDepth = outputSurface.depthTexture;
|
||||
}
|
||||
if (stage == CameraFrameStage::ObjectId) {
|
||||
frameResources.objectIdColor = GetPrimaryColorTexture(outputSurface);
|
||||
}
|
||||
const RenderSurface stageSurfaceTemplate = stagePassContext.surface;
|
||||
const bool hasStageSourceSurface = stagePassContext.sourceSurface != nullptr;
|
||||
@@ -921,7 +932,8 @@ bool ExecuteRenderGraphPlan(
|
||||
outputSurface.colorTextures,
|
||||
outputSurface.depthTexture,
|
||||
mainDirectionalShadowTexture,
|
||||
&stageExecutionSucceeded
|
||||
&stageExecutionSucceeded,
|
||||
&blackboard
|
||||
};
|
||||
if (!executionState.pipeline->RecordMainSceneRenderGraph(mainSceneContext)) {
|
||||
Debug::Logger::Get().Error(
|
||||
|
||||
Reference in New Issue
Block a user