using System.Reflection; using XCEngine; using XCEngine.Rendering; using XCEngine.Rendering.Universal; namespace Gameplay { public sealed class ScriptableRenderContextApiSurfaceProbe : MonoBehaviour { public bool HasPublicContextRecordScene; public bool HasPublicContextRecordScenePhase; public bool HasPublicContextRecordSceneInjectionPoint; public bool HasPublicContextDrawRenderersByType; public bool HasPublicContextDrawRenderersByDesc; 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; public bool HasPublicContextEnvironmentData; public bool HasPublicContextFinalColorData; public bool HasPublicContextStageColorData; public bool HasPublicRequestContextHasDirectionalShadow; public bool HasPublicRequestContextClearDirectionalShadow; public bool HasUniversalContextRecordSceneExtension; public bool HasUniversalContextRecordOpaqueScenePhaseExtension; public bool HasUniversalContextRecordBeforeOpaqueInjectionExtension; public bool HasUniversalContextRecordShaderVectorFullscreenPassExtension; public bool HasUniversalRequestContextHasDirectionalShadowExtension; public bool HasUniversalRequestContextClearDirectionalShadowExtension; public bool HasPublicPipelineAssetConfigureCameraFramePlan; public bool HasPipelineAssetSetDirty; public bool HasPipelineAssetGetRuntimeResourceVersion; public bool HasPlanningContextType; public bool HasRendererFeatureConfigureCameraFramePlan; public bool HasRendererRecordingContextType; public bool HasRendererCameraRequestContextType; public bool HasRendererBackedRenderPipelineAssetType; public bool HasRendererBackedRenderPipelineType; public bool HasRendererDrivenRenderPipelineType; public bool HasRendererDataSetupRenderer; public bool HasRendererDataSetDirty; public bool HasRendererDataIsInvalidated; public bool HasRendererSupportsRendererRecording; 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 bool HasRenderQueueRangeType; public bool HasRendererSortModeType; public bool HasFilteringSettingsType; public bool HasSortingSettingsType; public bool HasRendererListDescType; public void Start() { const BindingFlags PublicInstanceMethodFlags = BindingFlags.Instance | BindingFlags.Public; System.Type contextType = typeof(ScriptableRenderContext); System.Type requestContextType = typeof(CameraRenderRequestContext); System.Type pipelineAssetType = typeof(ScriptableRenderPipelineAsset); System.Type rasterPassBuilderType = typeof(RenderGraphRasterPassBuilder); System.Type rendererFeatureType = typeof(ScriptableRendererFeature); System.Type rendererDataType = typeof(ScriptableRendererData); System.Type rendererType = typeof(ScriptableRenderer); System.Type universalAssemblyType = typeof(ScriptableRendererFeature); System.Reflection.Assembly universalAssembly = universalAssemblyType.Assembly; System.Type renderContextExtensionsType = universalAssembly.GetType( "XCEngine.Rendering.Universal.ScriptableRenderContextExtensions"); System.Type requestContextExtensionsType = universalAssembly.GetType( "XCEngine.Rendering.Universal.CameraRenderRequestContextExtensions"); HasPublicContextRecordScene = contextType.GetMethod( "RecordScene", PublicInstanceMethodFlags) != null; HasPublicContextRecordScenePhase = contextType.GetMethod( "RecordScenePhase", PublicInstanceMethodFlags) != null; HasPublicContextRecordSceneInjectionPoint = contextType.GetMethod( "RecordSceneInjectionPoint", PublicInstanceMethodFlags) != null; HasPublicContextDrawRenderersByType = contextType.GetMethod( "DrawRenderers", PublicInstanceMethodFlags, null, new System.Type[] { typeof(SceneRenderPhase), typeof(RendererListType) }, null) != null; HasPublicContextDrawRenderersByDesc = contextType.GetMethod( "DrawRenderers", PublicInstanceMethodFlags, null, new System.Type[] { typeof(SceneRenderPhase), typeof(RendererListDesc) }, null) != null; HasPublicContextDrawOpaqueRenderers = contextType.GetMethod( "DrawOpaqueRenderers", PublicInstanceMethodFlags) != null; HasPublicContextDrawTransparentRenderers = contextType.GetMethod( "DrawTransparentRenderers", PublicInstanceMethodFlags) != null; HasPublicContextRecordOpaqueScenePhase = contextType.GetMethod( "RecordOpaqueScenePhase", PublicInstanceMethodFlags) != null; HasPublicContextRecordBeforeOpaqueInjection = contextType.GetMethod( "RecordBeforeOpaqueInjection", PublicInstanceMethodFlags) != null; HasPublicContextRecordShaderVectorFullscreenPass = 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", 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; HasPublicRequestContextHasDirectionalShadow = requestContextType.GetProperty( "hasDirectionalShadow", PublicInstanceMethodFlags) != null; HasPublicRequestContextClearDirectionalShadow = requestContextType.GetMethod( "ClearDirectionalShadow", PublicInstanceMethodFlags) != null; HasUniversalContextRecordSceneExtension = renderContextExtensionsType != null && renderContextExtensionsType.GetMethod( "RecordScene", BindingFlags.Static | BindingFlags.Public) != null; HasUniversalContextRecordOpaqueScenePhaseExtension = renderContextExtensionsType != null && renderContextExtensionsType.GetMethod( "RecordOpaqueScenePhase", BindingFlags.Static | BindingFlags.Public) != null; HasUniversalContextRecordBeforeOpaqueInjectionExtension = renderContextExtensionsType != null && renderContextExtensionsType.GetMethod( "RecordBeforeOpaqueInjection", BindingFlags.Static | BindingFlags.Public) != null; HasUniversalContextRecordShaderVectorFullscreenPassExtension = renderContextExtensionsType != null && renderContextExtensionsType.GetMethod( "RecordShaderVectorFullscreenPass", BindingFlags.Static | BindingFlags.Public) != null; HasUniversalRequestContextHasDirectionalShadowExtension = requestContextExtensionsType != null && requestContextExtensionsType.GetMethod( "HasDirectionalShadow", BindingFlags.Static | BindingFlags.Public) != null; HasUniversalRequestContextClearDirectionalShadowExtension = requestContextExtensionsType != null && requestContextExtensionsType.GetMethod( "ClearDirectionalShadow", BindingFlags.Static | BindingFlags.Public) != null; HasPublicPipelineAssetConfigureCameraFramePlan = pipelineAssetType.GetMethod( "ConfigureCameraFramePlan", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) != null; HasPipelineAssetSetDirty = pipelineAssetType.GetMethod( "SetDirty", BindingFlags.Instance | BindingFlags.NonPublic) != null; HasPipelineAssetGetRuntimeResourceVersion = pipelineAssetType.GetMethod( "GetRuntimeResourceVersionInstance", BindingFlags.Instance | BindingFlags.NonPublic) != null; HasPlanningContextType = contextType.Assembly.GetType( "XCEngine.Rendering.ScriptableRenderPipelinePlanningContext") != null; HasRendererFeatureConfigureCameraFramePlan = rendererFeatureType.GetMethod( "ConfigureCameraFramePlan", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) != null; HasRendererRecordingContextType = System.Type.GetType( "XCEngine.Rendering.Universal.RendererRecordingContext, XCEngine.RenderPipelines.Universal") != null; HasRendererCameraRequestContextType = System.Type.GetType( "XCEngine.Rendering.Universal.RendererCameraRequestContext, XCEngine.RenderPipelines.Universal") != null; HasRendererBackedRenderPipelineAssetType = System.Type.GetType( "XCEngine.Rendering.Universal.RendererBackedRenderPipelineAsset, XCEngine.RenderPipelines.Universal") != null; HasRendererBackedRenderPipelineType = System.Type.GetType( "XCEngine.Rendering.Universal.RendererBackedRenderPipeline, XCEngine.RenderPipelines.Universal") != null; HasRendererDrivenRenderPipelineType = System.Type.GetType( "XCEngine.Rendering.Universal.RendererDrivenRenderPipeline, XCEngine.RenderPipelines.Universal") != null; HasRendererDataSetupRenderer = rendererDataType.GetMethod( "SetupRenderer", BindingFlags.Instance | BindingFlags.NonPublic) != null; HasRendererDataSetDirty = rendererDataType.GetMethod( "SetDirty", BindingFlags.Instance | BindingFlags.NonPublic) != null; HasRendererDataIsInvalidated = rendererDataType.GetProperty( "isInvalidated", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public) != null; HasRendererSupportsRendererRecording = rendererType.GetMethod( "SupportsRendererRecording", BindingFlags.Instance | BindingFlags.NonPublic) != null; HasRendererRecordRenderer = rendererType.GetMethod( "RecordRenderer", BindingFlags.Instance | BindingFlags.NonPublic) != null; HasPublicRendererSupportsStageRenderGraph = rendererType.GetMethod( "SupportsStageRenderGraph", PublicInstanceMethodFlags) != null; HasPublicRendererRecordStageRenderGraph = 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; HasRenderQueueRangeType = contextType.Assembly.GetType( "XCEngine.Rendering.RenderQueueRange") != null; HasRendererSortModeType = contextType.Assembly.GetType( "XCEngine.Rendering.RendererSortMode") != null; HasFilteringSettingsType = contextType.Assembly.GetType( "XCEngine.Rendering.FilteringSettings") != null; HasSortingSettingsType = contextType.Assembly.GetType( "XCEngine.Rendering.SortingSettings") != null; HasRendererListDescType = contextType.Assembly.GetType( "XCEngine.Rendering.RendererListDesc") != null; } } }