refactor(srp): align renderer api with unity contexts

This commit is contained in:
2026-04-19 13:05:57 +08:00
parent fe7e6dddf3
commit 0cea7b80e8
16 changed files with 59 additions and 230 deletions

View File

@@ -33,18 +33,18 @@ namespace Gameplay
internal sealed class SceneInjectionPass : ScriptableRenderPass
{
private readonly Func<RendererRecordingContext, bool> m_recordAction;
private readonly Func<ScriptableRenderContext, bool> m_recordAction;
public SceneInjectionPass(
RenderPassEvent passEvent,
Func<RendererRecordingContext, bool> recordAction)
Func<ScriptableRenderContext, bool> recordAction)
{
renderPassEvent = passEvent;
m_recordAction = recordAction;
}
protected override bool RecordRenderGraph(
RendererRecordingContext context,
ScriptableRenderContext context,
RenderingData renderingData)
{
return context != null &&
@@ -57,12 +57,12 @@ namespace Gameplay
internal sealed class ScenePhasePass : ScriptableRenderPass
{
private readonly Func<RendererRecordingContext, bool> m_recordAction;
private readonly Func<ScriptableRenderContext, bool> m_recordAction;
private readonly Action m_onRecorded;
public ScenePhasePass(
RenderPassEvent passEvent,
Func<RendererRecordingContext, bool> recordAction,
Func<ScriptableRenderContext, bool> recordAction,
Action onRecorded = null)
{
renderPassEvent = passEvent;
@@ -71,7 +71,7 @@ namespace Gameplay
}
protected override bool RecordRenderGraph(
RendererRecordingContext context,
ScriptableRenderContext context,
RenderingData renderingData)
{
bool recorded = context != null &&
@@ -90,18 +90,18 @@ namespace Gameplay
internal sealed class FullscreenPass : ScriptableRenderPass
{
private readonly Func<RendererRecordingContext, bool> m_recordAction;
private readonly Func<ScriptableRenderContext, bool> m_recordAction;
public FullscreenPass(
RenderPassEvent passEvent,
Func<RendererRecordingContext, bool> recordAction)
Func<ScriptableRenderContext, bool> recordAction)
{
renderPassEvent = passEvent;
m_recordAction = recordAction;
}
protected override bool RecordRenderGraph(
RendererRecordingContext context,
ScriptableRenderContext context,
RenderingData renderingData)
{
return context != null &&
@@ -429,7 +429,7 @@ namespace Gameplay
}
protected override bool RecordRenderGraph(
RendererRecordingContext context,
ScriptableRenderContext context,
RenderingData renderingData)
{
if (context == null ||
@@ -660,7 +660,7 @@ namespace Gameplay
}
protected override bool RecordRenderGraph(
RendererRecordingContext context,
ScriptableRenderContext context,
RenderingData renderingData)
{
if (context == null ||
@@ -809,7 +809,7 @@ namespace Gameplay
}
protected override void ConfigureCameraRenderRequest(
RendererCameraRequestContext context)
ScriptableRenderPipelineCameraRequestContext context)
{
if (context != null &&
context.hasDirectionalShadow)