Add URP RenderGraph API compatibility surface

This commit is contained in:
2026-04-25 15:51:05 +08:00
parent c0c0bbdfa3
commit 5f73b35c0f
8 changed files with 246 additions and 20 deletions

View File

@@ -1,6 +1,7 @@
using System.Reflection;
using XCEngine;
using XCEngine.Rendering;
using XCEngine.Rendering.RenderGraphModule;
using XCEngine.Rendering.Universal;
namespace Gameplay
@@ -98,6 +99,12 @@ namespace Gameplay
public bool HasRenderPassOnCameraSetup;
public bool HasRenderPassOnCameraCleanup;
public bool HasRenderPassOnFinishCameraStackRendering;
public bool HasContextItemType;
public bool HasContextContainerType;
public bool HasContextContainerGetOrCreate;
public bool HasRenderGraphType;
public bool HasRenderGraphAddRasterPass;
public bool HasRenderPassPublicRecordRenderGraph;
public bool HasRenderPassComparisonOperators;
public bool HasRenderPassEventUnityNumericOrder;
public bool HasRenderPassEventEngineExtensionOrder;
@@ -129,6 +136,12 @@ namespace Gameplay
typeof(CommandBuffer);
System.Type profilingSamplerType =
typeof(ProfilingSampler);
System.Type contextItemType =
typeof(ContextItem);
System.Type contextContainerType =
typeof(ContextContainer);
System.Type renderGraphType =
typeof(RenderGraph);
System.Type renderPassInputType =
typeof(ScriptableRenderPassInput);
System.Type universalAssemblyType =
@@ -541,6 +554,39 @@ namespace Gameplay
typeof(CommandBuffer)
},
null) != null;
HasContextItemType =
contextItemType != null;
HasContextContainerType =
contextContainerType != null &&
typeof(System.IDisposable).IsAssignableFrom(
contextContainerType);
HasContextContainerGetOrCreate =
contextContainerType.GetMethod(
"GetOrCreate",
PublicInstanceMethodFlags) != null;
HasRenderGraphType =
renderGraphType != null;
HasRenderGraphAddRasterPass =
renderGraphType.GetMethod(
"AddRasterPass",
PublicInstanceMethodFlags,
null,
new System.Type[]
{
typeof(string)
},
null) != null;
HasRenderPassPublicRecordRenderGraph =
renderPassType.GetMethod(
"RecordRenderGraph",
PublicInstanceMethodFlags,
null,
new System.Type[]
{
typeof(RenderGraph),
typeof(ContextContainer)
},
null) != null;
HasRenderPassComparisonOperators =
renderPassType.GetMethod(
"op_GreaterThan",