refactor(rendering): shrink render pass graph compatibility helpers
This commit is contained in:
@@ -92,6 +92,18 @@ bool ExecuteCameraFrameStandaloneStagePass(
|
||||
});
|
||||
}
|
||||
|
||||
bool RecordCameraFrameFallbackCompatibleRenderPass(
|
||||
RenderPass& pass,
|
||||
const RenderPassRenderGraphContext& renderGraphContext,
|
||||
const RenderPassGraphIO& fallbackIo) {
|
||||
return pass.SupportsRenderGraph()
|
||||
? pass.RecordRenderGraph(renderGraphContext)
|
||||
: RecordRasterRenderPass(
|
||||
pass,
|
||||
renderGraphContext,
|
||||
fallbackIo);
|
||||
}
|
||||
|
||||
std::vector<RenderGraphTextureHandle> BuildCameraFrameStageGraphDefaultColorTargets(
|
||||
const CameraFrameStageGraphBuildState& stageState) {
|
||||
if (stageState.outputColor.IsValid()) {
|
||||
@@ -335,8 +347,7 @@ bool RecordCameraFrameRegularSequenceStageRenderGraphPass(
|
||||
const RenderGraphImportedSurface& outputSurface,
|
||||
const RenderPassGraphBeginCallback& beginPassCallback,
|
||||
RenderPass& pass) {
|
||||
return RecordCompatibleDeclaredRasterPass(
|
||||
pass,
|
||||
const RenderPassRenderGraphContext renderGraphContext =
|
||||
BuildRenderPassRenderGraphContext(
|
||||
BuildCameraFrameStageGraphRecordingContext(
|
||||
context,
|
||||
@@ -346,7 +357,11 @@ bool RecordCameraFrameRegularSequenceStageRenderGraphPass(
|
||||
BuildCameraFrameStageGraphSourceBinding(stageState),
|
||||
outputSurface.colorTextures,
|
||||
outputSurface.depthTexture),
|
||||
beginPassCallback));
|
||||
beginPassCallback);
|
||||
return RecordCameraFrameFallbackCompatibleRenderPass(
|
||||
pass,
|
||||
renderGraphContext,
|
||||
BuildDeclaredRasterPassGraphIO(renderGraphContext));
|
||||
}
|
||||
|
||||
CameraFrameRenderGraphSourceBinding ResolveCameraFrameFullscreenStageGraphSourceBinding(
|
||||
@@ -494,19 +509,22 @@ bool RecordCameraFrameFullscreenSequenceStageGraphPass(
|
||||
: RHI::ResourceStates::PixelShaderResource,
|
||||
currentSourceColor
|
||||
};
|
||||
const RenderPassRenderGraphContext renderGraphContext =
|
||||
BuildRenderPassRenderGraphContext(
|
||||
BuildCameraFrameStageGraphRecordingContext(
|
||||
context,
|
||||
stageState,
|
||||
passName,
|
||||
context.sceneData,
|
||||
passSourceBinding,
|
||||
std::vector<RenderGraphTextureHandle>{ passOutputColor },
|
||||
{}),
|
||||
beginPassCallback);
|
||||
const bool recordSucceeded =
|
||||
RecordCompatibleSourceColorFullscreenRasterPass(
|
||||
RecordCameraFrameFallbackCompatibleRenderPass(
|
||||
pass,
|
||||
BuildRenderPassRenderGraphContext(
|
||||
BuildCameraFrameStageGraphRecordingContext(
|
||||
context,
|
||||
stageState,
|
||||
passName,
|
||||
context.sceneData,
|
||||
passSourceBinding,
|
||||
std::vector<RenderGraphTextureHandle>{ passOutputColor },
|
||||
{}),
|
||||
beginPassCallback));
|
||||
renderGraphContext,
|
||||
BuildSourceColorFullscreenRasterPassGraphIO());
|
||||
if (recordSucceeded) {
|
||||
currentSourceColor = passOutputColor;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user