refactor(srp): finalize universal package split and data-drive default scene passes
This commit is contained in:
@@ -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()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user