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;
|
2026-04-19 13:12:26 +08:00
|
|
|
public bool HasPublicContextCameraData;
|
|
|
|
|
public bool HasPublicContextLightingData;
|
|
|
|
|
public bool HasPublicContextShadowData;
|
|
|
|
|
public bool HasPublicContextEnvironmentData;
|
|
|
|
|
public bool HasPublicContextFinalColorData;
|
|
|
|
|
public bool HasPublicContextStageColorData;
|
2026-04-19 05:34:43 +08:00
|
|
|
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;
|
2026-04-19 13:12:26 +08:00
|
|
|
HasPublicContextCameraData =
|
|
|
|
|
contextType.GetProperty(
|
|
|
|
|
"cameraData",
|
|
|
|
|
PublicInstanceMethodFlags) != null;
|
|
|
|
|
HasPublicContextLightingData =
|
|
|
|
|
contextType.GetProperty(
|
|
|
|
|
"lightingData",
|
|
|
|
|
PublicInstanceMethodFlags) != null;
|
|
|
|
|
HasPublicContextShadowData =
|
|
|
|
|
contextType.GetProperty(
|
|
|
|
|
"shadowData",
|
|
|
|
|
PublicInstanceMethodFlags) != null;
|
|
|
|
|
HasPublicContextEnvironmentData =
|
|
|
|
|
contextType.GetProperty(
|
|
|
|
|
"environmentData",
|
|
|
|
|
PublicInstanceMethodFlags) != null;
|
|
|
|
|
HasPublicContextFinalColorData =
|
|
|
|
|
contextType.GetProperty(
|
|
|
|
|
"finalColorData",
|
|
|
|
|
PublicInstanceMethodFlags) != null;
|
|
|
|
|
HasPublicContextStageColorData =
|
|
|
|
|
contextType.GetProperty(
|
|
|
|
|
"stageColorData",
|
|
|
|
|
PublicInstanceMethodFlags) != null;
|
2026-04-19 05:34:43 +08:00
|
|
|
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
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|