Browse Source

Load upscaler plugin upon first access of the main class. Makes the whole Load/IsLoaded situation a lot simpler.

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

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

@ -19,10 +19,14 @@ namespace UnityEngine.Rendering.HighDefinition.AMD
private static UpscalerPlugin _activePlugin = AvailablePlugins[0]; private static UpscalerPlugin _activePlugin = AvailablePlugins[0];
public static UpscalerPlugin ActivePlugin => _activePlugin; public static UpscalerPlugin ActivePlugin => _activePlugin;
static AMDUnityPlugin()
{
_ = Load();
}
public static bool Load() => ActivePlugin.Load(); public static bool Load() => ActivePlugin.Load();
// HDRP never calls Load() on startup, so we reinterpret IsLoaded() here to mean: is loaded, or possible to be loaded lazily.
public static bool IsLoaded() => ActivePlugin.IsLoaded() || ActivePlugin.isSupported;
public static bool IsLoaded() => ActivePlugin.IsLoaded();
/// <summary> /// <summary>
/// Get the list of available upscaler plugins, as a read-only list. /// Get the list of available upscaler plugins, as a read-only list.

Loading…
Cancel
Save