refactor(rendering): add override helpers for shared recording contexts
This commit is contained in:
@@ -37,15 +37,19 @@ bool ScenePhaseSamplesMainDirectionalShadow(ScenePhase scenePhase) {
|
||||
bool BuiltinForwardMainSceneGraphBuilder::Record(
|
||||
BuiltinForwardPipeline& pipeline,
|
||||
const RenderPipelineMainSceneRenderGraphContext& context) {
|
||||
RenderGraphRecordingContext recordingContext =
|
||||
BuildRenderGraphRecordingContext(context);
|
||||
recordingContext.surface =
|
||||
const RenderSurface graphManagedSurface =
|
||||
BuildGraphManagedForwardSceneSurface(context.surfaceTemplate);
|
||||
|
||||
const bool hasSourceSurface = recordingContext.sourceSurface != nullptr;
|
||||
const bool hasSourceSurface = context.sourceSurface != nullptr;
|
||||
const RenderSurface sourceSurface =
|
||||
hasSourceSurface ? *recordingContext.sourceSurface : RenderSurface();
|
||||
recordingContext.sourceSurface = hasSourceSurface ? &sourceSurface : nullptr;
|
||||
hasSourceSurface ? *context.sourceSurface : RenderSurface();
|
||||
RenderGraphRecordingContextOverrides overrides = {};
|
||||
overrides.surface = &graphManagedSurface;
|
||||
overrides.overrideSourceSurface = true;
|
||||
overrides.sourceSurface = hasSourceSurface ? &sourceSurface : nullptr;
|
||||
RenderGraphRecordingContext recordingContext =
|
||||
CloneRenderGraphRecordingContext(
|
||||
BuildRenderGraphRecordingContext(context),
|
||||
overrides);
|
||||
|
||||
const CameraFrameRenderGraphResources* const frameResources =
|
||||
TryGetCameraFrameRenderGraphResources(recordingContext.blackboard);
|
||||
|
||||
Reference in New Issue
Block a user