Formalize camera frame render-graph blackboard resources

This commit is contained in:
2026-04-14 21:34:34 +08:00
parent 1e189ff558
commit 5b0a1743d9
5 changed files with 95 additions and 43 deletions

View File

@@ -15,14 +15,32 @@ namespace Rendering {
class RenderGraphBuilder;
struct CameraFrameRenderGraphResources {
RenderGraphTextureHandle mainSceneColor = {};
RenderGraphTextureHandle mainSceneDepth = {};
RenderGraphTextureHandle postProcessColor = {};
RenderGraphTextureHandle mainDirectionalShadow = {};
RenderGraphTextureHandle objectIdColor = {};
struct CameraFrameRenderGraphSurfaceResources {
RenderGraphTextureHandle color = {};
RenderGraphTextureHandle depth = {};
};
struct CameraFrameRenderGraphResources {
CameraFrameRenderGraphSurfaceResources mainScene = {};
CameraFrameRenderGraphSurfaceResources postProcess = {};
CameraFrameRenderGraphSurfaceResources objectId = {};
RenderGraphTextureHandle mainDirectionalShadow = {};
};
inline CameraFrameRenderGraphResources* TryGetCameraFrameRenderGraphResources(
RenderGraphBlackboard* blackboard) {
return blackboard != nullptr
? blackboard->TryGet<CameraFrameRenderGraphResources>()
: nullptr;
}
inline const CameraFrameRenderGraphResources* TryGetCameraFrameRenderGraphResources(
const RenderGraphBlackboard* blackboard) {
return blackboard != nullptr
? blackboard->TryGet<CameraFrameRenderGraphResources>()
: nullptr;
}
struct RenderPipelineMainSceneRenderGraphContext {
RenderGraphBuilder& graphBuilder;
Containers::String passName = {};
@@ -34,7 +52,6 @@ struct RenderPipelineMainSceneRenderGraphContext {
RHI::ResourceStates sourceColorState = RHI::ResourceStates::Common;
std::vector<RenderGraphTextureHandle> colorTargets = {};
RenderGraphTextureHandle depthTarget = {};
RenderGraphTextureHandle mainDirectionalShadowTexture = {};
bool* executionSucceeded = nullptr;
RenderGraphBlackboard* blackboard = nullptr;
};