refactor(rendering): unify managed fullscreen planning stage api

replace post-process and final-output specific planning calls with a single fullscreen stage bridge

align managed planning with the native CameraFrameStage fullscreen seam
This commit is contained in:
2026-04-18 15:12:41 +08:00
parent eb39f87cdd
commit 2b6d62a127
4 changed files with 58 additions and 88 deletions

View File

@@ -11,57 +11,56 @@ namespace XCEngine
m_nativeHandle = nativeHandle;
}
public void ClearPostProcessStage()
public void ClearFullscreenStage(
CameraFrameStage stage)
{
InternalCalls.Rendering_ScriptableRenderPipelinePlanningContext_ClearPostProcessStage(
m_nativeHandle);
ValidateFullscreenStage(stage);
InternalCalls.Rendering_ScriptableRenderPipelinePlanningContext_ClearFullscreenStage(
m_nativeHandle,
(int)stage);
}
public void RequestPostProcessStage(
public void RequestFullscreenStage(
CameraFrameStage stage,
CameraFrameColorSource source,
bool usesGraphManagedOutputColor)
bool usesGraphManagedOutputColor = false)
{
ValidateFullscreenStage(stage);
if (source == CameraFrameColorSource.ExplicitSurface)
{
throw new ArgumentException(
"Managed planning currently requires a graph-managed source for post-process stages.",
"Managed planning currently requires a graph-managed color source for fullscreen stages.",
nameof(source));
}
if (stage == CameraFrameStage.FinalOutput && usesGraphManagedOutputColor)
{
throw new ArgumentException(
"FinalOutput fullscreen stages cannot publish a graph-managed output color.",
nameof(usesGraphManagedOutputColor));
}
if (!InternalCalls
.Rendering_ScriptableRenderPipelinePlanningContext_RequestPostProcessStage(
.Rendering_ScriptableRenderPipelinePlanningContext_RequestFullscreenStage(
m_nativeHandle,
(int)stage,
(int)source,
usesGraphManagedOutputColor))
{
throw new InvalidOperationException(
"Failed to request the managed post-process stage.");
$"Failed to request the managed fullscreen stage '{stage}'.");
}
}
public void ClearFinalOutputStage()
private static void ValidateFullscreenStage(
CameraFrameStage stage)
{
InternalCalls.Rendering_ScriptableRenderPipelinePlanningContext_ClearFinalOutputStage(
m_nativeHandle);
}
public void RequestFinalOutputStage(
CameraFrameColorSource source)
{
if (source == CameraFrameColorSource.ExplicitSurface)
if (stage != CameraFrameStage.PostProcess &&
stage != CameraFrameStage.FinalOutput)
{
throw new ArgumentException(
"Managed planning currently requires a graph-managed source for final-output stages.",
nameof(source));
}
if (!InternalCalls
.Rendering_ScriptableRenderPipelinePlanningContext_RequestFinalOutputStage(
m_nativeHandle,
(int)source))
{
throw new InvalidOperationException(
"Failed to request the managed final-output stage.");
"Managed planning currently supports only fullscreen sequence stages.",
nameof(stage));
}
}
}