rendering: document managed srp v1 boundaries

This commit is contained in:
2026-04-26 02:12:06 +08:00
parent 8eb1f8c5a2
commit 97f3c3486a
9 changed files with 246 additions and 0 deletions

View File

@@ -1,5 +1,8 @@
namespace XCEngine.Rendering
{
// SRP v1 shadow hook only configures whether the native main directional
// shadow execution should run. It does not expose a custom managed shadow
// graph or scene backend.
public sealed class DirectionalShadowExecutionContext
{
private readonly ulong m_nativeHandle;

View File

@@ -1,5 +1,7 @@
namespace XCEngine.Rendering
{
// Managed hook for scene-setup policy only. Scene extraction, culling, and
// the actual scene draws still execute through the native backend.
public sealed class RenderSceneSetupContext
{
private readonly ulong m_nativeHandle;

View File

@@ -2,6 +2,9 @@ using XCEngine;
namespace XCEngine.Rendering
{
// SRP v1 managed recording surface. Scene recording still delegates to the
// native SceneDrawBackend, and raster-pass recording is limited to the
// fullscreen PostProcess / FinalOutput stages.
public sealed class ScriptableRenderContext
{
private readonly ulong m_nativeHandle;
@@ -38,6 +41,9 @@ namespace XCEngine.Rendering
.Rendering_ScriptableRenderContext_GetDepthTargetHandle(
m_nativeHandle));
// Records the default native scene sequence for MainScene or explicit
// scene-pass-request stages. This does not replace the native scene
// extraction / culling / draw backend.
public bool RecordScene()
{
return RecordBeforeOpaqueInjection() &&
@@ -241,6 +247,9 @@ namespace XCEngine.Rendering
name));
}
// SRP v1 wrapper over managed fullscreen raster requests. Commit only
// succeeds on fullscreen sequence stages and the execution kinds remain
// limited to the built-in fullscreen pass family.
public RenderGraphRasterPassBuilder AddRasterPass(
string passName)
{

View File

@@ -2,6 +2,9 @@ using XCEngine;
namespace XCEngine.Rendering
{
// SRP v1 planning surface. Managed planning can request fullscreen stages
// plus depth / shadow side stages, but main-scene backend ownership stays
// on the native pipeline and scene draw backend.
public sealed class ScriptableRenderPipelinePlanningContext
{
private readonly ulong m_nativeHandle;
@@ -49,6 +52,8 @@ namespace XCEngine.Rendering
CameraFrameColorSource source,
bool usesGraphManagedOutputColor = false)
{
// Only PostProcess / FinalOutput are valid fullscreen sequence
// stages here. Other stages return false and remain unchanged.
return InternalCalls
.Rendering_ScriptableRenderPipelinePlanningContext_RequestFullscreenStage(
m_nativeHandle,

View File

@@ -12,6 +12,9 @@ namespace XCEngine.Rendering
FinalColorFullscreen = 3
}
// Managed SRP v1 raster recording is intentionally narrow: this builder
// only describes fullscreen raster passes that map onto the built-in
// ColorScale / ShaderVector / FinalColor executions.
public sealed class RenderGraphRasterPassBuilder
{
private struct TextureBindingRequest
@@ -184,6 +187,8 @@ namespace XCEngine.Rendering
public bool Commit()
{
// Native bridge rejects raster pass recording outside the
// fullscreen sequence stages.
if (m_finalized ||
!HasExecutionConfigured() ||
!HasAnyColorAttachment())