Add URP render pass API parity shims
This commit is contained in:
@@ -310,6 +310,55 @@ namespace Gameplay
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class RenderPassLifecycleApiProbePass
|
||||
: ScriptableRenderPass
|
||||
{
|
||||
public RenderPassLifecycleApiProbePass()
|
||||
{
|
||||
renderPassEvent =
|
||||
RenderPassEvent.AfterRenderingGbuffer;
|
||||
ConfigureInput(
|
||||
ScriptableRenderPassInput.Depth |
|
||||
ScriptableRenderPassInput.Color);
|
||||
profilingSampler =
|
||||
new ProfilingSampler(
|
||||
"RenderPassLifecycleApiProbePass");
|
||||
}
|
||||
|
||||
public override void OnCameraSetup(
|
||||
CommandBuffer cmd,
|
||||
ref RenderingData renderingData)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnCameraCleanup(
|
||||
CommandBuffer cmd)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnFinishCameraStackRendering(
|
||||
CommandBuffer cmd)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Execute(
|
||||
ScriptableRenderContext context,
|
||||
ref RenderingData renderingData)
|
||||
{
|
||||
}
|
||||
|
||||
protected override bool RecordRenderGraph(
|
||||
ScriptableRenderContext context,
|
||||
RenderingData renderingData)
|
||||
{
|
||||
return input ==
|
||||
(ScriptableRenderPassInput.Depth |
|
||||
ScriptableRenderPassInput.Color) &&
|
||||
requiresIntermediateTexture &&
|
||||
profilingSampler != null;
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class DefaultSceneFeature : ScriptableRendererFeature
|
||||
{
|
||||
private readonly SceneInjectionPass m_beforeOpaquePass;
|
||||
|
||||
@@ -87,6 +87,20 @@ namespace Gameplay
|
||||
public bool HasFilteringSettingsType;
|
||||
public bool HasSortingSettingsType;
|
||||
public bool HasRendererListDescType;
|
||||
public bool HasCommandBufferType;
|
||||
public bool HasProfilingSamplerType;
|
||||
public bool HasScriptableRenderPassInputType;
|
||||
public bool HasRenderPassInputProperty;
|
||||
public bool HasRenderPassConfigureInput;
|
||||
public bool HasRenderPassRequiresIntermediateTexture;
|
||||
public bool HasRenderPassProfilingSampler;
|
||||
public bool HasRenderPassExecute;
|
||||
public bool HasRenderPassOnCameraSetup;
|
||||
public bool HasRenderPassOnCameraCleanup;
|
||||
public bool HasRenderPassOnFinishCameraStackRendering;
|
||||
public bool HasRenderPassComparisonOperators;
|
||||
public bool HasRenderPassEventUnityNumericOrder;
|
||||
public bool HasRenderPassEventEngineExtensionOrder;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
@@ -109,6 +123,14 @@ namespace Gameplay
|
||||
typeof(ScriptableRendererData);
|
||||
System.Type rendererType =
|
||||
typeof(ScriptableRenderer);
|
||||
System.Type renderPassType =
|
||||
typeof(ScriptableRenderPass);
|
||||
System.Type commandBufferType =
|
||||
typeof(CommandBuffer);
|
||||
System.Type profilingSamplerType =
|
||||
typeof(ProfilingSampler);
|
||||
System.Type renderPassInputType =
|
||||
typeof(ScriptableRenderPassInput);
|
||||
System.Type universalAssemblyType =
|
||||
typeof(ScriptableRendererFeature);
|
||||
System.Reflection.Assembly universalAssembly =
|
||||
@@ -448,6 +470,124 @@ namespace Gameplay
|
||||
HasRendererListDescType =
|
||||
contextType.Assembly.GetType(
|
||||
"XCEngine.Rendering.RendererListDesc") != null;
|
||||
HasCommandBufferType =
|
||||
commandBufferType != null;
|
||||
HasProfilingSamplerType =
|
||||
profilingSamplerType != null;
|
||||
HasScriptableRenderPassInputType =
|
||||
renderPassInputType != null;
|
||||
HasRenderPassInputProperty =
|
||||
renderPassType.GetProperty(
|
||||
"input",
|
||||
PublicInstanceMethodFlags) != null;
|
||||
HasRenderPassConfigureInput =
|
||||
renderPassType.GetMethod(
|
||||
"ConfigureInput",
|
||||
PublicInstanceMethodFlags,
|
||||
null,
|
||||
new System.Type[]
|
||||
{
|
||||
typeof(ScriptableRenderPassInput)
|
||||
},
|
||||
null) != null;
|
||||
HasRenderPassRequiresIntermediateTexture =
|
||||
renderPassType.GetProperty(
|
||||
"requiresIntermediateTexture",
|
||||
PublicInstanceMethodFlags) != null;
|
||||
HasRenderPassProfilingSampler =
|
||||
renderPassType.GetProperty(
|
||||
"profilingSampler",
|
||||
BindingFlags.Instance |
|
||||
BindingFlags.NonPublic) != null;
|
||||
HasRenderPassExecute =
|
||||
renderPassType.GetMethod(
|
||||
"Execute",
|
||||
PublicInstanceMethodFlags,
|
||||
null,
|
||||
new System.Type[]
|
||||
{
|
||||
typeof(ScriptableRenderContext),
|
||||
typeof(RenderingData).MakeByRefType()
|
||||
},
|
||||
null) != null;
|
||||
HasRenderPassOnCameraSetup =
|
||||
renderPassType.GetMethod(
|
||||
"OnCameraSetup",
|
||||
PublicInstanceMethodFlags,
|
||||
null,
|
||||
new System.Type[]
|
||||
{
|
||||
typeof(CommandBuffer),
|
||||
typeof(RenderingData).MakeByRefType()
|
||||
},
|
||||
null) != null;
|
||||
HasRenderPassOnCameraCleanup =
|
||||
renderPassType.GetMethod(
|
||||
"OnCameraCleanup",
|
||||
PublicInstanceMethodFlags,
|
||||
null,
|
||||
new System.Type[]
|
||||
{
|
||||
typeof(CommandBuffer)
|
||||
},
|
||||
null) != null;
|
||||
HasRenderPassOnFinishCameraStackRendering =
|
||||
renderPassType.GetMethod(
|
||||
"OnFinishCameraStackRendering",
|
||||
PublicInstanceMethodFlags,
|
||||
null,
|
||||
new System.Type[]
|
||||
{
|
||||
typeof(CommandBuffer)
|
||||
},
|
||||
null) != null;
|
||||
HasRenderPassComparisonOperators =
|
||||
renderPassType.GetMethod(
|
||||
"op_GreaterThan",
|
||||
BindingFlags.Static |
|
||||
BindingFlags.Public) != null &&
|
||||
renderPassType.GetMethod(
|
||||
"op_LessThan",
|
||||
BindingFlags.Static |
|
||||
BindingFlags.Public) != null;
|
||||
HasRenderPassEventUnityNumericOrder =
|
||||
(int)RenderPassEvent.BeforeRendering == 0 &&
|
||||
(int)RenderPassEvent.BeforeRenderingShadows == 50 &&
|
||||
(int)RenderPassEvent.AfterRenderingShadows == 100 &&
|
||||
(int)RenderPassEvent.BeforeRenderingPrePasses == 150 &&
|
||||
(int)RenderPassEvent.AfterRenderingPrePasses == 200 &&
|
||||
(int)RenderPassEvent.BeforeRenderingGbuffer == 210 &&
|
||||
(int)RenderPassEvent.AfterRenderingGbuffer == 220 &&
|
||||
(int)RenderPassEvent.BeforeRenderingDeferredLights == 230 &&
|
||||
(int)RenderPassEvent.AfterRenderingDeferredLights == 240 &&
|
||||
(int)RenderPassEvent.BeforeRenderingOpaques == 250 &&
|
||||
(int)RenderPassEvent.AfterRenderingOpaques == 300 &&
|
||||
(int)RenderPassEvent.BeforeRenderingSkybox == 350 &&
|
||||
(int)RenderPassEvent.AfterRenderingSkybox == 400 &&
|
||||
(int)RenderPassEvent.BeforeRenderingTransparents == 450 &&
|
||||
(int)RenderPassEvent.AfterRenderingTransparents == 500 &&
|
||||
(int)RenderPassEvent.BeforeRenderingPostProcessing == 550 &&
|
||||
(int)RenderPassEvent.AfterRenderingPostProcessing == 600 &&
|
||||
(int)RenderPassEvent.AfterRendering == 1000;
|
||||
HasRenderPassEventEngineExtensionOrder =
|
||||
(int)RenderPassEvent.BeforeRenderingOpaques <
|
||||
(int)RenderPassEvent.RenderOpaques &&
|
||||
(int)RenderPassEvent.RenderOpaques <
|
||||
(int)RenderPassEvent.AfterRenderingOpaques &&
|
||||
(int)RenderPassEvent.BeforeRenderingSkybox <
|
||||
(int)RenderPassEvent.RenderSkybox &&
|
||||
(int)RenderPassEvent.RenderSkybox <
|
||||
(int)RenderPassEvent.AfterRenderingSkybox &&
|
||||
(int)RenderPassEvent.BeforeRenderingTransparents <
|
||||
(int)RenderPassEvent.RenderTransparents &&
|
||||
(int)RenderPassEvent.RenderTransparents <
|
||||
(int)RenderPassEvent.AfterRenderingTransparents &&
|
||||
(int)RenderPassEvent.AfterRenderingPostProcessing <
|
||||
(int)RenderPassEvent.BeforeRenderingFinalOutput &&
|
||||
(int)RenderPassEvent.BeforeRenderingFinalOutput <
|
||||
(int)RenderPassEvent.AfterRendering &&
|
||||
(int)RenderPassEvent.AfterRendering <
|
||||
(int)RenderPassEvent.AfterRenderingFinalOutput;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user