mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-08-25 07:36:45 +00:00
Version query for enabler
This commit is contained in:
@@ -1,6 +1,37 @@
|
||||
#include "pch.h"
|
||||
#include "Nvngx_Arturs.h"
|
||||
|
||||
void Nvngx_Arturs::QueryVersions()
|
||||
{
|
||||
if (!_DLSSG_D3D12_GetCapabilityParameters)
|
||||
return;
|
||||
|
||||
// Main version
|
||||
HMODULE hModule;
|
||||
GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
|
||||
(LPCSTR) _DLSSG_D3D12_GetCapabilityParameters, &hModule);
|
||||
|
||||
wchar_t dllPath[MAX_PATH] = { 0 };
|
||||
GetModuleFileNameW(hModule, dllPath, MAX_PATH);
|
||||
|
||||
Util::GetFileVersion(dllPath, &enablerVersion);
|
||||
|
||||
// Antighosting version
|
||||
NVSDK_NGX_Parameter* tempParams {};
|
||||
_DLSSG_D3D12_GetCapabilityParameters(&tempParams);
|
||||
if (tempParams)
|
||||
{
|
||||
auto result = tempParams->Get("FrameInterpolation.GhostbusterVersionMajor", &ghostbusterVersion.major);
|
||||
tempParams->Get("FrameInterpolation.GhostbusterVersionMinor", &ghostbusterVersion.minor);
|
||||
|
||||
if (result != NVSDK_NGX_Result_Success)
|
||||
LOG_WARN("Couldn't query version");
|
||||
}
|
||||
|
||||
LOG_INFO("DE Ver: {}.{}.{}.{}, GB Ver: {}.{}", enablerVersion.major, enablerVersion.minor, enablerVersion.patch,
|
||||
enablerVersion.reserved, ghostbusterVersion.major, ghostbusterVersion.minor);
|
||||
}
|
||||
|
||||
void Nvngx_Arturs::LoadLibraries()
|
||||
{
|
||||
HMODULE memModule = nullptr;
|
||||
@@ -29,6 +60,11 @@ void Nvngx_Arturs::LoadLibraries()
|
||||
_DLSSG_D3D12_PopulateParameters_Impl =
|
||||
(PFN_D3D12_PopulateParameters_Impl) GetProcAddress(dll, "DLSSG_NVSDK_NGX_D3D12_PopulateParameters_Impl");
|
||||
|
||||
_DLSSG_D3D12_GetCapabilityParameters =
|
||||
(PFN_D3D12_GetCapabilityParameters) GetProcAddress(dll, "NVSDK_NGX_D3D12_GetCapabilityParameters");
|
||||
|
||||
QueryVersions();
|
||||
|
||||
LOG_INFO("Artur's initialized");
|
||||
}
|
||||
else
|
||||
|
||||
@@ -3,6 +3,12 @@
|
||||
|
||||
class Nvngx_Arturs : public Nvngx_DllProxy
|
||||
{
|
||||
PFN_D3D12_GetCapabilityParameters _DLSSG_D3D12_GetCapabilityParameters = nullptr;
|
||||
Util::version_t enablerVersion {};
|
||||
feature_version ghostbusterVersion {};
|
||||
|
||||
void QueryVersions();
|
||||
|
||||
protected:
|
||||
void LoadLibraries() override final;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user