Browse Source

Implemented resource cleanup upon domain reload

master
Nico de Poel 2 years ago
parent
commit
222b5d2e79
  1. 17
      com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Upscalers/UpscalerPlugin.cs

17
com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Upscalers/UpscalerPlugin.cs

@ -11,9 +11,6 @@ namespace UnityEngine.Rendering.HighDefinition.AMD
{
new FSR2.FSR2UpscalerPlugin(),
new FSR3.FSR3UpscalerPlugin(),
#if UNITY_STANDALONE_WIN && false
new FSR2Wrapper.FSR2WrapperUpscaler(),
#endif
};
private static UpscalerPlugin _activePlugin = AvailablePlugins[0];
@ -128,11 +125,25 @@ namespace UnityEngine.Rendering.HighDefinition.AMD
private bool Initialize()
{
#if UNITY_EDITOR
UnityEditor.AssemblyReloadEvents.beforeAssemblyReload += Shutdown;
#endif
return true;
}
private void Shutdown()
{
#if UNITY_EDITOR
UnityEditor.AssemblyReloadEvents.beforeAssemblyReload -= Shutdown;
#endif
foreach (FSR2Context context in _contexts)
{
context.Destroy(AMDUnityPlugin.ActivePlugin);
}
_contexts.Clear();
}
internal void RecreateFeatures(UpscalerPlugin oldPlugin, UpscalerPlugin newPlugin)

Loading…
Cancel
Save