Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


AMDUnityPlugin

Provides methods to manage loading and unloading AMD module plugins.
Read time 2 minutesLast updated 3 days ago

Definition

public static class AMDUnityPlugin

Remarks

AMDUnityPlugin
contains the implementations for AMD's temporal upscaling technologies:
To access this API, follow these steps:
  1. Open the Package Manager window
  2. Go to Built-in packages.
  3. Enable the AMD package.
Once enabled, the plugin is automatically loaded by Unity and becomes available for both built-in and custom FSR integration workflows.
Note: You don't need to use this API to enable FSR in a Unity project. For more information, refer to Upscaling Framework or HDRP Dynamic Resolution.
AMDUnityPlugin
enables advanced users to access and integrate AMD's FSR functionality directly in custom rendering workflows. It's primarily intended for users who want to bypass Upscaler Framework or the built-in engine integration available in the High Definition Render Pipeline (HDRP), to implement their own FSR logic, such as through a
CustomPass
or other Scriptable Render Pipeline (SRP) extensions.
When using this API manually, it's good practice to verify that the plugin is available using AMDUnityPlugin.IsLoaded. In case the plugin fails to load automatically (for example, the end user isn't using the native AMD package), you can load it manually using AMDUnityPlugin.Load.

Examples

using UnityEngine;using UnityEngine.Rendering;using UnityEngine.Rendering.HighDefinition;using UnityEngine.AMD; // Example HDRP custom passpublic class CustomFSRPass : CustomPass{ public static bool EnsureAMDPluginLoaded() { if (!AMDUnityPlugin.IsLoaded()) { Debug.Log("AMDUnityPlugin is not loaded!"); if (!AMDUnityPlugin.Load()) { Debug.LogError("Unable to load AMDUnityPlugin"); return false; } } Debug.Log("AMDUnityPlugin is successfully loaded!"); return true; } void InitializeAMDDevice() { if (!EnsureAMDPluginLoaded()) return; // device initialization code } protected override void Setup(ScriptableRenderContext renderContext, CommandBuffer cmd) { if (amdDevice == null) { InitializeAMDDevice(); } // other pass setup code } protected override void Execute(CustomPassContext ctx) { // pass execution code } protected override void Cleanup() { // pass cleanup code } private GraphicsDevice amdDevice = null; // other member variables}

Static Methods

Method

Description

IsLoadedChecks whether the
AMDUnityPlugin
in the AMD native module has been loaded or not.
LoadAttempts to dynamically load the AMDUnityPlugin.