Unity 6.3
0 онлайн 21 гостей 3 в системе
Вход

AMDUnityPlugin.IsLoaded

Declaration

public static bool IsLoaded();

Возвращаемое значение

логическое Возвращает true, если плагин загружен. В противном случае возвращает false.

Описание

Проверяет, был ли загружен AMDUnityPlugin в основном модуле AMD или нет.

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 }