2026-04-19 05:34:43 +08:00
|
|
|
using System.Reflection;
|
|
|
|
|
using XCEngine;
|
|
|
|
|
using XCEngine.Rendering;
|
|
|
|
|
|
|
|
|
|
namespace Gameplay
|
|
|
|
|
{
|
|
|
|
|
public sealed class ScriptableRenderContextApiSurfaceProbe
|
|
|
|
|
: MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
public bool HasPublicContextRecordScene;
|
|
|
|
|
public bool HasPublicContextRecordOpaqueScenePhase;
|
|
|
|
|
public bool HasPublicContextRecordBeforeOpaqueInjection;
|
|
|
|
|
public bool HasPublicContextRecordShaderVectorFullscreenPass;
|
|
|
|
|
public bool HasPublicCameraRequestContextHasDirectionalShadow;
|
|
|
|
|
public bool HasPublicCameraRequestContextClearDirectionalShadow;
|
2026-04-19 13:05:57 +08:00
|
|
|
public bool HasRendererRecordingContextType;
|
|
|
|
|
public bool HasRendererCameraRequestContextType;
|
2026-04-19 05:34:43 +08:00
|
|
|
|
|
|
|
|
public void Start()
|
|
|
|
|
{
|
|
|
|
|
const BindingFlags PublicInstanceMethodFlags =
|
|
|
|
|
BindingFlags.Instance | BindingFlags.Public;
|
|
|
|
|
System.Type contextType =
|
|
|
|
|
typeof(ScriptableRenderContext);
|
|
|
|
|
System.Type cameraRequestContextType =
|
|
|
|
|
typeof(ScriptableRenderPipelineCameraRequestContext);
|
|
|
|
|
|
|
|
|
|
HasPublicContextRecordScene =
|
|
|
|
|
contextType.GetMethod(
|
|
|
|
|
"RecordScene",
|
|
|
|
|
PublicInstanceMethodFlags) != null;
|
|
|
|
|
HasPublicContextRecordOpaqueScenePhase =
|
|
|
|
|
contextType.GetMethod(
|
|
|
|
|
"RecordOpaqueScenePhase",
|
|
|
|
|
PublicInstanceMethodFlags) != null;
|
|
|
|
|
HasPublicContextRecordBeforeOpaqueInjection =
|
|
|
|
|
contextType.GetMethod(
|
|
|
|
|
"RecordBeforeOpaqueInjection",
|
|
|
|
|
PublicInstanceMethodFlags) != null;
|
|
|
|
|
HasPublicContextRecordShaderVectorFullscreenPass =
|
|
|
|
|
contextType.GetMethod(
|
|
|
|
|
"RecordShaderVectorFullscreenPass",
|
|
|
|
|
PublicInstanceMethodFlags) != null;
|
|
|
|
|
HasPublicCameraRequestContextHasDirectionalShadow =
|
|
|
|
|
cameraRequestContextType.GetProperty(
|
|
|
|
|
"hasDirectionalShadow",
|
|
|
|
|
PublicInstanceMethodFlags) != null;
|
|
|
|
|
HasPublicCameraRequestContextClearDirectionalShadow =
|
|
|
|
|
cameraRequestContextType.GetMethod(
|
|
|
|
|
"ClearDirectionalShadow",
|
|
|
|
|
PublicInstanceMethodFlags) != null;
|
2026-04-19 13:05:57 +08:00
|
|
|
HasRendererRecordingContextType =
|
|
|
|
|
System.Type.GetType(
|
|
|
|
|
"XCEngine.Rendering.Renderer.RendererRecordingContext, XCEngine.RenderPipelines.Universal") != null;
|
|
|
|
|
HasRendererCameraRequestContextType =
|
|
|
|
|
System.Type.GetType(
|
|
|
|
|
"XCEngine.Rendering.Renderer.RendererCameraRequestContext, XCEngine.RenderPipelines.Universal") != null;
|
2026-04-19 05:34:43 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|