Rendering: formalize main-scene graph contract

This commit is contained in:
2026-04-15 07:56:00 +08:00
parent 8b156dd112
commit 2cda9fd24a
9 changed files with 276 additions and 59 deletions

View File

@@ -81,6 +81,7 @@ inline RenderPipelineMainSceneRenderGraphContext BuildRenderPipelineMainSceneRen
common.sourceSurface,
common.sourceColorView,
common.sourceColorState,
common.sourceColorTexture,
common.colorTargets,
common.depthTarget,
common.executionSucceeded,

View File

@@ -24,6 +24,7 @@ struct RenderPipelineMainSceneRenderGraphContext {
const RenderSurface* sourceSurface = nullptr;
RHI::RHIResourceView* sourceColorView = nullptr;
RHI::ResourceStates sourceColorState = RHI::ResourceStates::Common;
RenderGraphTextureHandle sourceColorTexture = {};
std::vector<RenderGraphTextureHandle> colorTargets = {};
RenderGraphTextureHandle depthTarget = {};
bool* executionSucceeded = nullptr;

View File

@@ -0,0 +1,38 @@
#pragma once
#include <XCEngine/Rendering/Execution/ScenePhase.h>
#include <XCEngine/Rendering/Execution/SceneRenderInjectionPoint.h>
#include <XCEngine/Rendering/RenderPassGraphContract.h>
#include <XCEngine/Rendering/RenderPipeline.h>
#include <XCEngine/Rendering/SceneRenderFeaturePass.h>
#include <vector>
namespace XCEngine {
namespace Rendering {
class SceneRenderFeatureHost;
Containers::String BuildRenderPipelineMainScenePhasePassName(
const Containers::String& baseName,
ScenePhase scenePhase);
bool RecordRenderPipelineMainSceneFeaturePasses(
const RenderPipelineMainSceneRenderGraphContext& context,
SceneRenderFeatureHost& featureHost,
SceneRenderInjectionPoint injectionPoint,
bool clearAttachments,
SceneRenderFeaturePassBeginCallback beginPassCallback = {},
SceneRenderFeaturePassEndCallback endPassCallback = {},
bool* recordedAnyPass = nullptr);
bool RecordRenderPipelineMainScenePhasePass(
const RenderPipelineMainSceneRenderGraphContext& context,
ScenePhase scenePhase,
RenderPassGraphExecutePassCallback executePassCallback,
RenderPassGraphBeginCallback beginPassCallback = {},
RenderPassGraphEndCallback endPassCallback = {},
std::vector<RenderGraphTextureHandle> additionalReadTextures = {});
} // namespace Rendering
} // namespace XCEngine