refactor(srp): add managed lifecycle cleanup seams
Invoke managed pipeline disposal and asset runtime cleanup from the native bridge lifecycle. Add Universal renderer and feature cleanup hooks plus regression probes to verify runtime cache teardown semantics.
This commit is contained in:
@@ -38,6 +38,35 @@ namespace XCEngine.Rendering.Universal
|
||||
return GetPipelineRendererAssetKey();
|
||||
}
|
||||
|
||||
internal void ReleaseRuntimeResourcesInstance()
|
||||
{
|
||||
if (m_rendererInstance != null)
|
||||
{
|
||||
m_rendererInstance.ReleaseRuntimeResourcesInstance();
|
||||
m_rendererInstance = null;
|
||||
m_rendererFeatures = null;
|
||||
ReleaseRuntimeResources();
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_rendererFeatures != null)
|
||||
{
|
||||
for (int i = 0; i < m_rendererFeatures.Length; ++i)
|
||||
{
|
||||
ScriptableRendererFeature rendererFeature =
|
||||
m_rendererFeatures[i];
|
||||
if (rendererFeature != null)
|
||||
{
|
||||
rendererFeature.ReleaseRuntimeResourcesInstance();
|
||||
}
|
||||
}
|
||||
|
||||
m_rendererFeatures = null;
|
||||
}
|
||||
|
||||
ReleaseRuntimeResources();
|
||||
}
|
||||
|
||||
internal void ConfigureCameraRenderRequestInstance(
|
||||
CameraRenderRequestContext context)
|
||||
{
|
||||
@@ -80,6 +109,10 @@ namespace XCEngine.Rendering.Universal
|
||||
return Array.Empty<ScriptableRendererFeature>();
|
||||
}
|
||||
|
||||
protected virtual void ReleaseRuntimeResources()
|
||||
{
|
||||
}
|
||||
|
||||
protected bool HasDirectionalShadow(
|
||||
CameraRenderRequestContext context)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user