feat(srp): formalize scene recording and draw entrypoints

This commit is contained in:
2026-04-20 18:54:04 +08:00
parent b521616e27
commit 3df87e941c
20 changed files with 1054 additions and 181 deletions

View File

@@ -9,9 +9,21 @@ namespace Gameplay
: MonoBehaviour
{
public bool HasPublicContextRecordScene;
public bool HasPublicContextRecordScenePhase;
public bool HasPublicContextRecordSceneInjectionPoint;
public bool HasPublicContextDrawRenderers;
public bool HasPublicContextDrawOpaqueRenderers;
public bool HasPublicContextDrawTransparentRenderers;
public bool HasPublicContextRecordOpaqueScenePhase;
public bool HasPublicContextRecordBeforeOpaqueInjection;
public bool HasPublicContextRecordShaderVectorFullscreenPass;
public bool HasPublicContextSourceColorTexture;
public bool HasPublicContextPrimaryColorTarget;
public bool HasPublicContextDepthTarget;
public bool HasPublicContextCreateTransientTexture;
public bool HasPublicContextCreateFullscreenTransientColorTexture;
public bool HasPublicContextCreateFullscreenTransientDepthTexture;
public bool HasPublicContextAddRasterPass;
public bool HasPublicContextCameraData;
public bool HasPublicContextLightingData;
public bool HasPublicContextShadowData;
@@ -43,6 +55,16 @@ namespace Gameplay
public bool HasRendererRecordRenderer;
public bool HasPublicRendererSupportsStageRenderGraph;
public bool HasPublicRendererRecordStageRenderGraph;
public bool HasRenderGraphTextureHandleType;
public bool HasRenderGraphRasterPassBuilderType;
public bool HasRenderGraphRasterPassBuilderUseColorSource;
public bool HasRenderGraphRasterPassBuilderUseTexture;
public bool HasRenderGraphRasterPassBuilderSetColorAttachment;
public bool HasRenderGraphRasterPassBuilderSetColorScaleFullscreenExecution;
public bool HasRenderGraphRasterPassBuilderCommit;
public bool HasSceneRenderPhaseType;
public bool HasSceneRenderInjectionPointType;
public bool HasRendererListType;
public void Start()
{
@@ -54,6 +76,8 @@ namespace Gameplay
typeof(CameraRenderRequestContext);
System.Type pipelineAssetType =
typeof(ScriptableRenderPipelineAsset);
System.Type rasterPassBuilderType =
typeof(RenderGraphRasterPassBuilder);
System.Type rendererFeatureType =
typeof(ScriptableRendererFeature);
System.Type rendererDataType =
@@ -75,6 +99,26 @@ namespace Gameplay
contextType.GetMethod(
"RecordScene",
PublicInstanceMethodFlags) != null;
HasPublicContextRecordScenePhase =
contextType.GetMethod(
"RecordScenePhase",
PublicInstanceMethodFlags) != null;
HasPublicContextRecordSceneInjectionPoint =
contextType.GetMethod(
"RecordSceneInjectionPoint",
PublicInstanceMethodFlags) != null;
HasPublicContextDrawRenderers =
contextType.GetMethod(
"DrawRenderers",
PublicInstanceMethodFlags) != null;
HasPublicContextDrawOpaqueRenderers =
contextType.GetMethod(
"DrawOpaqueRenderers",
PublicInstanceMethodFlags) != null;
HasPublicContextDrawTransparentRenderers =
contextType.GetMethod(
"DrawTransparentRenderers",
PublicInstanceMethodFlags) != null;
HasPublicContextRecordOpaqueScenePhase =
contextType.GetMethod(
"RecordOpaqueScenePhase",
@@ -87,6 +131,34 @@ namespace Gameplay
contextType.GetMethod(
"RecordShaderVectorFullscreenPass",
PublicInstanceMethodFlags) != null;
HasPublicContextSourceColorTexture =
contextType.GetProperty(
"sourceColorTexture",
PublicInstanceMethodFlags) != null;
HasPublicContextPrimaryColorTarget =
contextType.GetProperty(
"primaryColorTarget",
PublicInstanceMethodFlags) != null;
HasPublicContextDepthTarget =
contextType.GetProperty(
"depthTarget",
PublicInstanceMethodFlags) != null;
HasPublicContextCreateTransientTexture =
contextType.GetMethod(
"CreateTransientTexture",
PublicInstanceMethodFlags) != null;
HasPublicContextCreateFullscreenTransientColorTexture =
contextType.GetMethod(
"CreateFullscreenTransientColorTexture",
PublicInstanceMethodFlags) != null;
HasPublicContextCreateFullscreenTransientDepthTexture =
contextType.GetMethod(
"CreateFullscreenTransientDepthTexture",
PublicInstanceMethodFlags) != null;
HasPublicContextAddRasterPass =
contextType.GetMethod(
"AddRasterPass",
PublicInstanceMethodFlags) != null;
HasPublicContextCameraData =
contextType.GetProperty(
"cameraData",
@@ -223,6 +295,40 @@ namespace Gameplay
rendererType.GetMethod(
"RecordStageRenderGraph",
PublicInstanceMethodFlags) != null;
HasRenderGraphTextureHandleType =
contextType.Assembly.GetType(
"XCEngine.Rendering.RenderGraphTextureHandle") != null;
HasRenderGraphRasterPassBuilderType =
rasterPassBuilderType != null;
HasRenderGraphRasterPassBuilderUseColorSource =
rasterPassBuilderType.GetMethod(
"UseColorSource",
PublicInstanceMethodFlags) != null;
HasRenderGraphRasterPassBuilderUseTexture =
rasterPassBuilderType.GetMethod(
"UseTexture",
PublicInstanceMethodFlags) != null;
HasRenderGraphRasterPassBuilderSetColorAttachment =
rasterPassBuilderType.GetMethod(
"SetColorAttachment",
PublicInstanceMethodFlags) != null;
HasRenderGraphRasterPassBuilderSetColorScaleFullscreenExecution =
rasterPassBuilderType.GetMethod(
"SetColorScaleFullscreenExecution",
PublicInstanceMethodFlags) != null;
HasRenderGraphRasterPassBuilderCommit =
rasterPassBuilderType.GetMethod(
"Commit",
PublicInstanceMethodFlags) != null;
HasSceneRenderPhaseType =
contextType.Assembly.GetType(
"XCEngine.Rendering.SceneRenderPhase") != null;
HasSceneRenderInjectionPointType =
contextType.Assembly.GetType(
"XCEngine.Rendering.SceneRenderInjectionPoint") != null;
HasRendererListType =
contextType.Assembly.GetType(
"XCEngine.Rendering.RendererListType") != null;
}
}
}