78 lines
3.5 KiB
C#
78 lines
3.5 KiB
C#
|
|
using System.Reflection;
|
||
|
|
using XCEngine;
|
||
|
|
using XCEngine.Rendering;
|
||
|
|
using XCEngine.Rendering.Renderer;
|
||
|
|
|
||
|
|
namespace Gameplay
|
||
|
|
{
|
||
|
|
public sealed class ScriptableRenderContextApiSurfaceProbe
|
||
|
|
: MonoBehaviour
|
||
|
|
{
|
||
|
|
public bool HasPublicContextRecordScene;
|
||
|
|
public bool HasPublicContextRecordOpaqueScenePhase;
|
||
|
|
public bool HasPublicContextRecordBeforeOpaqueInjection;
|
||
|
|
public bool HasPublicContextRecordShaderVectorFullscreenPass;
|
||
|
|
public bool HasPublicRendererRecordOpaqueScenePhase;
|
||
|
|
public bool HasPublicRendererRecordShaderVectorFullscreenPass;
|
||
|
|
public bool HasPublicCameraRequestContextHasDirectionalShadow;
|
||
|
|
public bool HasPublicCameraRequestContextClearDirectionalShadow;
|
||
|
|
public bool HasPublicRendererCameraRequestContextHasDirectionalShadow;
|
||
|
|
public bool HasPublicRendererCameraRequestContextClearDirectionalShadow;
|
||
|
|
|
||
|
|
public void Start()
|
||
|
|
{
|
||
|
|
const BindingFlags PublicInstanceMethodFlags =
|
||
|
|
BindingFlags.Instance | BindingFlags.Public;
|
||
|
|
System.Type contextType =
|
||
|
|
typeof(ScriptableRenderContext);
|
||
|
|
System.Type rendererContextType =
|
||
|
|
typeof(RendererRecordingContext);
|
||
|
|
System.Type cameraRequestContextType =
|
||
|
|
typeof(ScriptableRenderPipelineCameraRequestContext);
|
||
|
|
System.Type rendererCameraRequestContextType =
|
||
|
|
typeof(RendererCameraRequestContext);
|
||
|
|
|
||
|
|
HasPublicContextRecordScene =
|
||
|
|
contextType.GetMethod(
|
||
|
|
"RecordScene",
|
||
|
|
PublicInstanceMethodFlags) != null;
|
||
|
|
HasPublicContextRecordOpaqueScenePhase =
|
||
|
|
contextType.GetMethod(
|
||
|
|
"RecordOpaqueScenePhase",
|
||
|
|
PublicInstanceMethodFlags) != null;
|
||
|
|
HasPublicContextRecordBeforeOpaqueInjection =
|
||
|
|
contextType.GetMethod(
|
||
|
|
"RecordBeforeOpaqueInjection",
|
||
|
|
PublicInstanceMethodFlags) != null;
|
||
|
|
HasPublicContextRecordShaderVectorFullscreenPass =
|
||
|
|
contextType.GetMethod(
|
||
|
|
"RecordShaderVectorFullscreenPass",
|
||
|
|
PublicInstanceMethodFlags) != null;
|
||
|
|
HasPublicRendererRecordOpaqueScenePhase =
|
||
|
|
rendererContextType.GetMethod(
|
||
|
|
"RecordOpaqueScenePhase",
|
||
|
|
PublicInstanceMethodFlags) != null;
|
||
|
|
HasPublicRendererRecordShaderVectorFullscreenPass =
|
||
|
|
rendererContextType.GetMethod(
|
||
|
|
"RecordShaderVectorFullscreenPass",
|
||
|
|
PublicInstanceMethodFlags) != null;
|
||
|
|
HasPublicCameraRequestContextHasDirectionalShadow =
|
||
|
|
cameraRequestContextType.GetProperty(
|
||
|
|
"hasDirectionalShadow",
|
||
|
|
PublicInstanceMethodFlags) != null;
|
||
|
|
HasPublicCameraRequestContextClearDirectionalShadow =
|
||
|
|
cameraRequestContextType.GetMethod(
|
||
|
|
"ClearDirectionalShadow",
|
||
|
|
PublicInstanceMethodFlags) != null;
|
||
|
|
HasPublicRendererCameraRequestContextHasDirectionalShadow =
|
||
|
|
rendererCameraRequestContextType.GetProperty(
|
||
|
|
"hasDirectionalShadow",
|
||
|
|
PublicInstanceMethodFlags) != null;
|
||
|
|
HasPublicRendererCameraRequestContextClearDirectionalShadow =
|
||
|
|
rendererCameraRequestContextType.GetMethod(
|
||
|
|
"ClearDirectionalShadow",
|
||
|
|
PublicInstanceMethodFlags) != null;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|