refactor(srp): finalize universal package split and data-drive default scene passes

This commit is contained in:
2026-04-20 23:40:00 +08:00
parent 7fe922d1c9
commit 36c0614c14
36 changed files with 461 additions and 506 deletions

View File

@@ -0,0 +1,88 @@
using XCEngine;
using XCEngine.Rendering;
namespace XCEngine.Rendering.Universal
{
public abstract class ScriptableRendererFeature
{
private bool m_disposed;
private bool m_runtimeCreated;
protected ScriptableRendererFeature()
{
}
public bool isActive { get; set; } = true;
internal void CreateInstance()
{
if (m_runtimeCreated)
{
return;
}
m_disposed = false;
Create();
m_runtimeCreated = true;
}
internal void ReleaseRuntimeResourcesInstance()
{
if (m_disposed)
{
return;
}
ReleaseRuntimeResources();
m_disposed = true;
m_runtimeCreated = false;
}
public virtual void Create()
{
}
public virtual void ConfigureCameraRenderRequest(
CameraRenderRequestContext context)
{
}
public virtual void ConfigureCameraFramePlan(
ScriptableRenderPipelinePlanningContext context)
{
}
public virtual void AddRenderPasses(
ScriptableRenderer renderer,
RenderingData renderingData)
{
}
protected bool HasDirectionalShadow(
CameraRenderRequestContext context)
{
return context != null &&
InternalCalls
.Rendering_CameraRenderRequestContext_GetHasDirectionalShadow(
context.nativeHandle);
}
protected void ClearDirectionalShadow(
CameraRenderRequestContext context)
{
if (context == null)
{
return;
}
InternalCalls
.Rendering_CameraRenderRequestContext_ClearDirectionalShadow(
context.nativeHandle);
}
protected virtual void ReleaseRuntimeResources()
{
}
}
}