feat(srp): formalize scene recording and draw entrypoints
This commit is contained in:
@@ -110,17 +110,17 @@ namespace Gameplay
|
||||
switch (m_injectionKind)
|
||||
{
|
||||
case SceneInjectionKind.BeforeOpaque:
|
||||
return RecordBeforeOpaqueInjection(context);
|
||||
return context.RecordBeforeOpaqueInjection();
|
||||
case SceneInjectionKind.AfterOpaque:
|
||||
return RecordAfterOpaqueInjection(context);
|
||||
return context.RecordAfterOpaqueInjection();
|
||||
case SceneInjectionKind.BeforeSkybox:
|
||||
return RecordBeforeSkyboxInjection(context);
|
||||
return context.RecordBeforeSkyboxInjection();
|
||||
case SceneInjectionKind.AfterSkybox:
|
||||
return RecordAfterSkyboxInjection(context);
|
||||
return context.RecordAfterSkyboxInjection();
|
||||
case SceneInjectionKind.BeforeTransparent:
|
||||
return RecordBeforeTransparentInjection(context);
|
||||
return context.RecordBeforeTransparentInjection();
|
||||
case SceneInjectionKind.AfterTransparent:
|
||||
return RecordAfterTransparentInjection(context);
|
||||
return context.RecordAfterTransparentInjection();
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -164,11 +164,11 @@ namespace Gameplay
|
||||
switch (m_phaseKind)
|
||||
{
|
||||
case ScenePhaseKind.Opaque:
|
||||
return RecordOpaqueScenePhase(context);
|
||||
return context.RecordOpaqueScenePhase();
|
||||
case ScenePhaseKind.Skybox:
|
||||
return RecordSkyboxScenePhase(context);
|
||||
return context.RecordSkyboxScenePhase();
|
||||
case ScenePhaseKind.Transparent:
|
||||
return RecordTransparentScenePhase(context);
|
||||
return context.RecordTransparentScenePhase();
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@@ -847,7 +847,7 @@ namespace Gameplay
|
||||
finalColorData.requiresProcessing;
|
||||
}
|
||||
RecordCallCount++;
|
||||
return RecordScene(context);
|
||||
return context.RecordScene();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user