#include #include #include #include #include namespace XCEngine { namespace Rendering { namespace { RenderGraphRecordingContext BuildCommonContext( const RenderPipelineMainSceneRenderGraphContext& context, Containers::String passName) { return { context.graphBuilder, passName, context.renderContext, context.sceneData, context.surfaceTemplate, context.sourceSurface, context.sourceColorView, context.sourceColorState, context.sourceColorTexture, context.colorTargets, context.depthTarget, context.executionSucceeded, context.blackboard }; } } // namespace Containers::String BuildRenderPipelineMainScenePhasePassName( const Containers::String& baseName, ScenePhase scenePhase) { std::string name = baseName.CStr(); if (!name.empty()) { name += '.'; } name += ToString(scenePhase); return Containers::String(name.c_str()); } bool RecordRenderPipelineMainSceneFeaturePasses( const RenderPipelineMainSceneRenderGraphContext& context, SceneRenderFeatureHost& featureHost, SceneRenderInjectionPoint injectionPoint, bool clearAttachments, SceneRenderFeaturePassBeginCallback beginPassCallback, SceneRenderFeaturePassEndCallback endPassCallback, bool* recordedAnyPass) { const SceneRenderFeaturePassRenderGraphContext featureContext = BuildSceneRenderFeaturePassRenderGraphContext( BuildCommonContext(context, context.passName), clearAttachments, beginPassCallback, endPassCallback); return featureHost.Record( featureContext, injectionPoint, recordedAnyPass); } bool RecordRenderPipelineMainScenePhasePass( const RenderPipelineMainSceneRenderGraphContext& context, ScenePhase scenePhase, RenderPassGraphExecutePassCallback executePassCallback, RenderPassGraphBeginCallback beginPassCallback, RenderPassGraphEndCallback endPassCallback, std::vector additionalReadTextures) { const RenderPassRenderGraphContext passContext = BuildRenderPassRenderGraphContext( BuildCommonContext( context, BuildRenderPipelineMainScenePhasePassName( context.passName, scenePhase)), beginPassCallback, endPassCallback); return RecordCallbackRasterRenderPass( passContext, { false, true, context.depthTarget.IsValid() }, std::move(executePassCallback), std::move(additionalReadTextures)); } } // namespace Rendering } // namespace XCEngine