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:
@@ -10,11 +10,35 @@ namespace XCEngine.Rendering.Universal
|
||||
new List<ScriptableRendererFeature>();
|
||||
private readonly List<ScriptableRenderPass> m_activePassQueue =
|
||||
new List<ScriptableRenderPass>();
|
||||
private bool m_disposed;
|
||||
|
||||
protected ScriptableRenderer()
|
||||
{
|
||||
}
|
||||
|
||||
internal void ReleaseRuntimeResourcesInstance()
|
||||
{
|
||||
if (m_disposed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ReleaseRuntimeResources();
|
||||
|
||||
for (int i = 0; i < m_features.Count; ++i)
|
||||
{
|
||||
ScriptableRendererFeature feature = m_features[i];
|
||||
if (feature != null)
|
||||
{
|
||||
feature.ReleaseRuntimeResourcesInstance();
|
||||
}
|
||||
}
|
||||
|
||||
m_features.Clear();
|
||||
m_activePassQueue.Clear();
|
||||
m_disposed = true;
|
||||
}
|
||||
|
||||
public void EnqueuePass(
|
||||
ScriptableRenderPass renderPass)
|
||||
{
|
||||
@@ -126,6 +150,10 @@ namespace XCEngine.Rendering.Universal
|
||||
|
||||
AddRenderPasses(renderingData);
|
||||
}
|
||||
|
||||
protected virtual void ReleaseRuntimeResources()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user