|
|
|
@ -1,5 +1,6 @@ |
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#include <sstream>
|
|
|
|
#include <vector>
|
|
|
|
#include <queue>
|
|
|
|
#include <mutex>
|
|
|
|
@ -198,6 +199,33 @@ static bool LoadFidelityFXLibrary(_In_ LPCWSTR lpLibFileName) |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
// Check that we can actually create an upscaler with this library
|
|
|
|
ffx::QueryDescGetVersions versionQuery{}; |
|
|
|
versionQuery.createDescType = FFX_API_CREATE_CONTEXT_DESC_TYPE_UPSCALE; |
|
|
|
versionQuery.device = s_DX12BackendDesc.device; |
|
|
|
uint64_t versionCount = 0; |
|
|
|
versionQuery.outputCount = &versionCount; |
|
|
|
s_ffxFunctions.Query(nullptr, &versionQuery.header); |
|
|
|
|
|
|
|
if (versionCount == 0) |
|
|
|
{ |
|
|
|
UNITY_LOG_ERROR(s_Log, "Failed to load FidelityFX upscaler versions!"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
// Obtain the default upscaler version and log its name
|
|
|
|
std::vector<const char*> versionNames; |
|
|
|
std::vector<uint64_t> versionIds; |
|
|
|
versionIds.resize(versionCount); |
|
|
|
versionNames.resize(versionCount); |
|
|
|
versionQuery.versionIds = versionIds.data(); |
|
|
|
versionQuery.versionNames = versionNames.data(); |
|
|
|
s_ffxFunctions.Query(nullptr, &versionQuery.header); |
|
|
|
|
|
|
|
std::stringstream ss; |
|
|
|
ss << "Loaded FidelityFX upscaler: FSR " << versionNames[0]; |
|
|
|
UNITY_LOG(s_Log, ss.str().c_str()); |
|
|
|
|
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
|