Add URP renderer API compatibility shims
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
using System;
|
||||
using XCEngine;
|
||||
using XCEngine.Rendering;
|
||||
|
||||
namespace XCEngine.Rendering.Universal
|
||||
{
|
||||
public abstract class ScriptableRendererFeature
|
||||
: ScriptableObject
|
||||
: ScriptableObject,
|
||||
IDisposable
|
||||
{
|
||||
private bool m_disposed;
|
||||
private bool m_runtimeCreated;
|
||||
@@ -24,16 +26,6 @@ namespace XCEngine.Rendering.Universal
|
||||
{
|
||||
return m_isActive;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (m_isActive == value)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_isActive = value;
|
||||
SetDirty();
|
||||
}
|
||||
}
|
||||
|
||||
internal void BindOwnerInstance(
|
||||
@@ -68,7 +60,7 @@ namespace XCEngine.Rendering.Universal
|
||||
return;
|
||||
}
|
||||
|
||||
ReleaseRuntimeResources();
|
||||
Dispose(true);
|
||||
m_disposed = true;
|
||||
m_runtimeCreated = false;
|
||||
}
|
||||
@@ -103,6 +95,52 @@ namespace XCEngine.Rendering.Universal
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void AddRenderPasses(
|
||||
ScriptableRenderer renderer,
|
||||
ref RenderingData renderingData)
|
||||
{
|
||||
AddRenderPasses(
|
||||
renderer,
|
||||
renderingData);
|
||||
}
|
||||
|
||||
public virtual void SetupRenderPasses(
|
||||
ScriptableRenderer renderer,
|
||||
in RenderingData renderingData)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void OnCameraPreCull(
|
||||
ScriptableRenderer renderer,
|
||||
in CameraData cameraData)
|
||||
{
|
||||
}
|
||||
|
||||
public void SetActive(
|
||||
bool active)
|
||||
{
|
||||
if (m_isActive == active)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_isActive = active;
|
||||
SetDirty();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (m_disposed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Dispose(true);
|
||||
m_disposed = true;
|
||||
m_runtimeCreated = false;
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
protected bool HasDirectionalShadow(
|
||||
CameraRenderRequestContext context)
|
||||
{
|
||||
@@ -129,6 +167,15 @@ namespace XCEngine.Rendering.Universal
|
||||
{
|
||||
}
|
||||
|
||||
protected virtual void Dispose(
|
||||
bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
ReleaseRuntimeResources();
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual int ComputeRuntimeStateHash()
|
||||
{
|
||||
int hash = 17;
|
||||
@@ -173,7 +220,7 @@ namespace XCEngine.Rendering.Universal
|
||||
if (m_runtimeCreated &&
|
||||
!m_disposed)
|
||||
{
|
||||
ReleaseRuntimeResources();
|
||||
Dispose(true);
|
||||
}
|
||||
|
||||
m_disposed = false;
|
||||
|
||||
Reference in New Issue
Block a user