Version: Unity 6.1 (6000.1)
LanguageEnglish
  • C#

AMDUnityPlugin.IsLoaded

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static bool IsLoaded();

Returns

bool Returns true if the plugin has been loaded. Otherwise, returns false.

Description

Checks whether the AMDUnityPlugin in the AMD native module has been loaded or not.

using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.HighDefinition;
using UnityEngine.AMD;

// Example HDRP custom pass public 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 }