feat(rendering): add managed fullscreen stage planning seam

This commit is contained in:
2026-04-17 23:39:08 +08:00
parent 4a4e921eb1
commit 6838b00d97
16 changed files with 935 additions and 18 deletions

View File

@@ -0,0 +1,68 @@
using System;
namespace XCEngine
{
public sealed class ScriptableRenderPipelinePlanningContext
{
private readonly ulong m_nativeHandle;
internal ScriptableRenderPipelinePlanningContext(ulong nativeHandle)
{
m_nativeHandle = nativeHandle;
}
public void ClearPostProcessStage()
{
InternalCalls.Rendering_ScriptableRenderPipelinePlanningContext_ClearPostProcessStage(
m_nativeHandle);
}
public void RequestPostProcessStage(
CameraFrameColorSource source,
bool usesGraphManagedOutputColor)
{
if (source == CameraFrameColorSource.ExplicitSurface)
{
throw new ArgumentException(
"Managed planning currently requires a graph-managed source for post-process stages.",
nameof(source));
}
if (!InternalCalls
.Rendering_ScriptableRenderPipelinePlanningContext_RequestPostProcessStage(
m_nativeHandle,
(int)source,
usesGraphManagedOutputColor))
{
throw new InvalidOperationException(
"Failed to request the managed post-process stage.");
}
}
public void ClearFinalOutputStage()
{
InternalCalls.Rendering_ScriptableRenderPipelinePlanningContext_ClearFinalOutputStage(
m_nativeHandle);
}
public void RequestFinalOutputStage(
CameraFrameColorSource source)
{
if (source == CameraFrameColorSource.ExplicitSurface)
{
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.");
}
}
}
}