diff --git a/include/rendering/amd_fsr3_runtime.hpp b/include/rendering/amd_fsr3_runtime.hpp index 9044bbbc..44bd20b3 100644 --- a/include/rendering/amd_fsr3_runtime.hpp +++ b/include/rendering/amd_fsr3_runtime.hpp @@ -77,6 +77,8 @@ public: const std::string& loadedLibraryPath() const { return loadedLibraryPath_; } LoadPathKind loadPathKind() const { return loadPathKind_; } const std::string& wrapperBackendName() const { return wrapperBackendName_; } + uint32_t wrapperCapabilities() const { return wrapperCapabilities_; } + bool hasWrapperExternalInterop() const; const std::string& lastError() const { return lastError_; } private: @@ -94,6 +96,7 @@ private: bool frameGenerationReady_ = false; LoadPathKind loadPathKind_ = LoadPathKind::None; std::string wrapperBackendName_; + uint32_t wrapperCapabilities_ = 0; std::string lastError_; struct RuntimeFns; diff --git a/src/rendering/amd_fsr3_runtime.cpp b/src/rendering/amd_fsr3_runtime.cpp index 6796b5bb..49b716c5 100644 --- a/src/rendering/amd_fsr3_runtime.cpp +++ b/src/rendering/amd_fsr3_runtime.cpp @@ -57,6 +57,11 @@ AmdFsr3Runtime::~AmdFsr3Runtime() { shutdown(); } +bool AmdFsr3Runtime::hasWrapperExternalInterop() const { + if (loadPathKind_ != LoadPathKind::Wrapper) return false; + return (wrapperCapabilities_ & WOWEE_FSR3_WRAPPER_CAP_EXTERNAL_INTEROP) != 0u; +} + #if WOWEE_HAS_AMD_FSR3_FRAMEGEN namespace { FfxErrorCode vkSwapchainConfigureNoop(const FfxFrameGenerationConfig*) { @@ -161,6 +166,7 @@ bool AmdFsr3Runtime::initialize(const AmdFsr3RuntimeInitDesc& desc) { lastError_.clear(); loadPathKind_ = LoadPathKind::None; wrapperBackendName_.clear(); + wrapperCapabilities_ = 0; backend_ = RuntimeBackend::None; #if !WOWEE_HAS_AMD_FSR3_FRAMEGEN @@ -307,6 +313,7 @@ bool AmdFsr3Runtime::initialize(const AmdFsr3RuntimeInitDesc& desc) { wrapperCaps |= WOWEE_FSR3_WRAPPER_CAP_FRAME_GENERATION; } } + wrapperCapabilities_ = wrapperCaps; frameGenerationReady_ = desc.enableFrameGeneration && ((wrapperCaps & WOWEE_FSR3_WRAPPER_CAP_FRAME_GENERATION) != 0u); if (fns_->wrapperGetBackend) { @@ -705,6 +712,7 @@ void AmdFsr3Runtime::shutdown() { loadedLibraryPath_.clear(); loadPathKind_ = LoadPathKind::None; wrapperBackendName_.clear(); + wrapperCapabilities_ = 0; backend_ = RuntimeBackend::None; } diff --git a/src/rendering/renderer.cpp b/src/rendering/renderer.cpp index b7e4c97e..9319b18d 100644 --- a/src/rendering/renderer.cpp +++ b/src/rendering/renderer.cpp @@ -4620,9 +4620,7 @@ void Renderer::dispatchAmdFsr3Framegen() { using ExportHandle = int; #endif bool exportInteropHandles = false; - if (fsr2_.amdFsr3Runtime && - fsr2_.amdFsr3Runtime->loadPathKind() == AmdFsr3Runtime::LoadPathKind::Wrapper && - fsr2_.amdFsr3Runtime->wrapperBackendName() == "dx12_bridge") { + if (fsr2_.amdFsr3Runtime && fsr2_.amdFsr3Runtime->hasWrapperExternalInterop()) { exportInteropHandles = true; }