mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-09-25 23:07:09 +00:00
updatefeature always returns fail
This commit is contained in:
+17
-20
@@ -87,20 +87,21 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_UpdateFeature(const NVSDK_NGX_Applicati
|
||||
{
|
||||
spdlog::debug("NVSDK_NGX_UpdateFeature");
|
||||
|
||||
if (FeatureID != NVSDK_NGX_Feature_SuperSampling)
|
||||
{
|
||||
if (NVNGXProxy::UpdateFeature() != nullptr)
|
||||
{
|
||||
auto result = NVNGXProxy::UpdateFeature()(ApplicationId, FeatureID);
|
||||
spdlog::error("NVSDK_NGX_UpdateFeature NVNGXProxy result for feature ({0}): {1:X}", (int)FeatureID, (UINT)result);
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
spdlog::error("NVSDK_NGX_UpdateFeature Can't update this feature ({0})!", (int)FeatureID);
|
||||
return NVSDK_NGX_Result_FAIL_FeatureNotSupported;
|
||||
}
|
||||
}
|
||||
// To test with puredark mods
|
||||
//if (FeatureID != NVSDK_NGX_Feature_SuperSampling)
|
||||
//{
|
||||
// if (NVNGXProxy::UpdateFeature() != nullptr)
|
||||
// {
|
||||
// auto result = NVNGXProxy::UpdateFeature()(ApplicationId, FeatureID);
|
||||
// spdlog::error("NVSDK_NGX_UpdateFeature NVNGXProxy result for feature ({0}): {1:X}", (int)FeatureID, (UINT)result);
|
||||
// return result;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// spdlog::error("NVSDK_NGX_UpdateFeature Can't update this feature ({0})!", (int)FeatureID);
|
||||
// return NVSDK_NGX_Result_Fail;
|
||||
// }
|
||||
//}
|
||||
|
||||
if (ApplicationId != nullptr)
|
||||
{
|
||||
@@ -115,11 +116,6 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_UpdateFeature(const NVSDK_NGX_Applicati
|
||||
Config::Instance()->NVNGX_Engine = ApplicationId->v.ProjectDesc.EngineType;
|
||||
Config::Instance()->NVNGX_EngineVersion = std::string(ApplicationId->v.ProjectDesc.EngineVersion);
|
||||
|
||||
if (Config::Instance()->NVNGX_Engine == NVSDK_NGX_ENGINE_TYPE_UNREAL && ApplicationId->v.ProjectDesc.EngineVersion)
|
||||
Config::Instance()->NVNGX_EngineVersion5 = ApplicationId->v.ProjectDesc.EngineVersion[0] == '5';
|
||||
else
|
||||
Config::Instance()->NVNGX_EngineVersion5 = false;
|
||||
|
||||
spdlog::info("NVSDK_NGX_UpdateFeature Update InProjectId: {0}", Config::Instance()->NVNGX_ProjectId);
|
||||
spdlog::info("NVSDK_NGX_UpdateFeature Update InEngineType: {0}", (int)Config::Instance()->NVNGX_Engine);
|
||||
spdlog::info("NVSDK_NGX_UpdateFeature Update InEngineVersion: {0}", Config::Instance()->NVNGX_EngineVersion);
|
||||
@@ -130,5 +126,6 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_UpdateFeature(const NVSDK_NGX_Applicati
|
||||
}
|
||||
}
|
||||
|
||||
return NVSDK_NGX_Result_Success;
|
||||
// To test with puredark mods
|
||||
return NVSDK_NGX_Result_Fail;
|
||||
}
|
||||
@@ -114,7 +114,7 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_Init(unsigned long long InApplica
|
||||
return result;
|
||||
}
|
||||
|
||||
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_Init_ProjectID(const char* InProjectId, NVSDK_NGX_EngineType InEngineType, const char* InEngineVersion, const wchar_t* InApplicationDataPath, ID3D11Device* InDevice, const NVSDK_NGX_FeatureCommonInfo* InFeatureInfo, NVSDK_NGX_Version InSDKVersion)
|
||||
NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_Init_ProjectID(const char* InProjectId, NVSDK_NGX_EngineType InEngineType, const char* InEngineVersion, const wchar_t* InApplicationDataPath, ID3D11Device* InDevice, NVSDK_NGX_Version InSDKVersion, const NVSDK_NGX_FeatureCommonInfo* InFeatureInfo)
|
||||
{
|
||||
if (Config::Instance()->DLSSEnabled.value_or(true) && !NVNGXProxy::IsDx11Inited())
|
||||
{
|
||||
@@ -144,11 +144,6 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_Init_ProjectID(const char* InProj
|
||||
Config::Instance()->NVNGX_Engine = InEngineType;
|
||||
Config::Instance()->NVNGX_EngineVersion = std::string(InEngineVersion);
|
||||
|
||||
if (Config::Instance()->NVNGX_Engine == NVSDK_NGX_ENGINE_TYPE_UNREAL && InEngineVersion)
|
||||
Config::Instance()->NVNGX_EngineVersion5 = InEngineVersion[0] == '5';
|
||||
else
|
||||
Config::Instance()->NVNGX_EngineVersion5 = false;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -165,11 +160,6 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_Init_with_ProjectID(const char* I
|
||||
Config::Instance()->NVNGX_Engine = InEngineType;
|
||||
Config::Instance()->NVNGX_EngineVersion = std::string(InEngineVersion);
|
||||
|
||||
if (Config::Instance()->NVNGX_Engine == NVSDK_NGX_ENGINE_TYPE_UNREAL && InEngineVersion)
|
||||
Config::Instance()->NVNGX_EngineVersion5 = InEngineVersion[0] == '5';
|
||||
else
|
||||
Config::Instance()->NVNGX_EngineVersion5 = false;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -182,7 +172,10 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_Shutdown()
|
||||
spdlog::info("NVSDK_NGX_D3D11_Shutdown");
|
||||
|
||||
for (auto const& [key, val] : Dx11Contexts)
|
||||
NVSDK_NGX_D3D11_ReleaseFeature(val->Handle());
|
||||
{
|
||||
if (val)
|
||||
NVSDK_NGX_D3D11_ReleaseFeature(val->Handle());
|
||||
}
|
||||
|
||||
Dx11Contexts.clear();
|
||||
D3D11Device = nullptr;
|
||||
@@ -351,7 +344,13 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_CreateFeature(ID3D11DeviceContext
|
||||
|
||||
if (InFeatureID == NVSDK_NGX_Feature_SuperSampling)
|
||||
{
|
||||
if (Config::Instance()->Dx11Upscaler.value_or("fsr22") == "xess")
|
||||
std::string defaultUpscaler = "fsr22";
|
||||
|
||||
// If original NVNGX available use DLSS as base upscaler
|
||||
if(NVNGXProxy::IsDx11Inited())
|
||||
defaultUpscaler = "dlss";
|
||||
|
||||
if (Config::Instance()->Dx11Upscaler.value_or(defaultUpscaler) == "xess")
|
||||
{
|
||||
Dx11Contexts[handleId] = std::make_unique<XeSSFeatureDx11>(handleId, InParameters);
|
||||
|
||||
@@ -372,7 +371,7 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_CreateFeature(ID3D11DeviceContext
|
||||
}
|
||||
}
|
||||
|
||||
if (Config::Instance()->Dx11Upscaler.value_or("fsr22") == "dlss")
|
||||
if (Config::Instance()->Dx11Upscaler.value_or(defaultUpscaler) == "dlss")
|
||||
{
|
||||
if (Config::Instance()->DLSSEnabled.value_or(true))
|
||||
{
|
||||
@@ -399,17 +398,17 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_CreateFeature(ID3D11DeviceContext
|
||||
}
|
||||
}
|
||||
|
||||
if (Config::Instance()->Dx11Upscaler.value_or("fsr22") == "fsr22_12")
|
||||
if (Config::Instance()->Dx11Upscaler.value_or(defaultUpscaler) == "fsr22_12")
|
||||
{
|
||||
spdlog::info("NVSDK_NGX_D3D11_CreateFeature creating new FSR 2.2.1 with Dx12 feature");
|
||||
Dx11Contexts[handleId] = std::make_unique<FSR2FeatureDx11on12>(handleId, InParameters);
|
||||
}
|
||||
else if (Config::Instance()->Dx11Upscaler.value_or("fsr22") == "fsr21_12")
|
||||
else if (Config::Instance()->Dx11Upscaler.value_or(defaultUpscaler) == "fsr21_12")
|
||||
{
|
||||
spdlog::info("NVSDK_NGX_D3D11_CreateFeature creating new FSR 2.1.2 with Dx12 feature");
|
||||
Dx11Contexts[handleId] = std::make_unique<FSR2FeatureDx11on12_212>(handleId, InParameters);
|
||||
}
|
||||
else if (Config::Instance()->Dx11Upscaler.value_or("fsr22") == "fsr22")
|
||||
else if (Config::Instance()->Dx11Upscaler.value_or(defaultUpscaler) == "fsr22")
|
||||
{
|
||||
spdlog::info("NVSDK_NGX_D3D11_CreateFeature creating new native FSR 2.2.1 feature");
|
||||
Dx11Contexts[handleId] = std::make_unique<FSR2FeatureDx11>(handleId, InParameters);
|
||||
@@ -685,7 +684,7 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_EvaluateFeature(ID3D11DeviceConte
|
||||
Dx11Contexts[handleId] = std::make_unique<FSR2FeatureDx11>(handleId, createParams);
|
||||
}
|
||||
|
||||
if (Config::Instance()->Dx11DelayedInit.value_or(false) &&
|
||||
if (Config::Instance()->Dx11DelayedInit.value_or(false) &&
|
||||
Config::Instance()->newBackend != "fsr22" && Config::Instance()->newBackend != "dlss" && Config::Instance()->newBackend != "dlssd")
|
||||
{
|
||||
spdlog::trace("NVSDK_NGX_D3D11_EvaluateFeature sleeping after new creation of new feature for 1000ms");
|
||||
@@ -727,7 +726,7 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_EvaluateFeature(ID3D11DeviceConte
|
||||
else
|
||||
{
|
||||
spdlog::info("NVSDK_NGX_D3D11_EvaluateFeature init successful for {0}, upscaler changed", Config::Instance()->newBackend);
|
||||
|
||||
|
||||
Config::Instance()->newBackend = "";
|
||||
Config::Instance()->changeBackend = false;
|
||||
}
|
||||
|
||||
@@ -286,11 +286,6 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D12_Init_ProjectID(const char* InProj
|
||||
Config::Instance()->NVNGX_Engine = InEngineType;
|
||||
Config::Instance()->NVNGX_EngineVersion = std::string(InEngineVersion);
|
||||
|
||||
if (Config::Instance()->NVNGX_Engine == NVSDK_NGX_ENGINE_TYPE_UNREAL && InEngineVersion)
|
||||
Config::Instance()->NVNGX_EngineVersion5 = InEngineVersion[0] == '5';
|
||||
else
|
||||
Config::Instance()->NVNGX_EngineVersion5 = false;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -308,11 +303,6 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D12_Init_with_ProjectID(const char* I
|
||||
Config::Instance()->NVNGX_Engine = InEngineType;
|
||||
Config::Instance()->NVNGX_EngineVersion = std::string(InEngineVersion);
|
||||
|
||||
if (Config::Instance()->NVNGX_Engine == NVSDK_NGX_ENGINE_TYPE_UNREAL && InEngineVersion)
|
||||
Config::Instance()->NVNGX_EngineVersion5 = InEngineVersion[0] == '5';
|
||||
else
|
||||
Config::Instance()->NVNGX_EngineVersion5 = false;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -502,6 +492,14 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D12_CreateFeature(ID3D12GraphicsComma
|
||||
Config::Instance()->DE_Available = (deAvail > 0);
|
||||
}
|
||||
|
||||
// nvsdk logging - ini first
|
||||
if (!Config::Instance()->LogToNGX.has_value())
|
||||
{
|
||||
int nvsdkLogging = 0;
|
||||
InParameters->Get("DLSSEnabler.Logging", &nvsdkLogging);
|
||||
Config::Instance()->LogToNGX = nvsdkLogging > 0;
|
||||
}
|
||||
|
||||
if (InFeatureID == NVSDK_NGX_Feature_SuperSampling)
|
||||
{
|
||||
// backend selection
|
||||
@@ -509,27 +507,37 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D12_CreateFeature(ID3D12GraphicsComma
|
||||
// 1 : FSR2.2
|
||||
// 2 : FSR2.1
|
||||
// 3 : DLSS
|
||||
|
||||
int upscalerChoice = 0; // Default XeSS
|
||||
|
||||
// ini first
|
||||
if (InParameters->Get("DLSSEnabler.Dx12Backend", &upscalerChoice) != NVSDK_NGX_Result_Success &&
|
||||
Config::Instance()->Dx12Upscaler.has_value())
|
||||
// If original NVNGX available use DLSS as base upscaler
|
||||
if (NVNGXProxy::IsDx12Inited())
|
||||
upscalerChoice = 3;
|
||||
|
||||
// if Enabler does not set any upscaler
|
||||
if (InParameters->Get("DLSSEnabler.Dx12Backend", &upscalerChoice) != NVSDK_NGX_Result_Success && Config::Instance()->Dx12Upscaler.has_value())
|
||||
{
|
||||
if (Config::Instance()->Dx12Upscaler.value_or("xess") == "fsr22")
|
||||
spdlog::info("NVSDK_NGX_D3D12_CreateFeature DLSS Enabler does not set any upscaler using ini: {0}", Config::Instance()->Dx12Upscaler.value());
|
||||
|
||||
if (Config::Instance()->Dx12Upscaler.value() == "xess")
|
||||
upscalerChoice = 0;
|
||||
else if (Config::Instance()->Dx12Upscaler.value() == "fsr22")
|
||||
upscalerChoice = 1;
|
||||
else if (Config::Instance()->Dx12Upscaler.value_or("xess") == "fsr21")
|
||||
else if (Config::Instance()->Dx12Upscaler.value() == "fsr21")
|
||||
upscalerChoice = 2;
|
||||
else if (Config::Instance()->Dx12Upscaler.value_or("xess") == "dlss" && Config::Instance()->DLSSEnabled.value_or(true))
|
||||
else if (Config::Instance()->Dx12Upscaler.value() == "dlss" && Config::Instance()->DLSSEnabled.value_or(true))
|
||||
upscalerChoice = 3;
|
||||
}
|
||||
|
||||
spdlog::info("NVSDK_NGX_D3D12_CreateFeature upscalerChoice: {0}", upscalerChoice);
|
||||
|
||||
if (upscalerChoice == 3)
|
||||
{
|
||||
Dx12Contexts[handleId] = std::make_unique<DLSSFeatureDx12>(handleId, InParameters);
|
||||
|
||||
if (!Dx12Contexts[handleId]->ModuleLoaded())
|
||||
{
|
||||
spdlog::error("NVSDK_NGX_D3D12_CreateFeature can't create new DLSS feature, Fallback to XeSS!");
|
||||
spdlog::error("NVSDK_NGX_D3D12_CreateFeature can't create new DLSS feature, fallback to XeSS!");
|
||||
|
||||
Dx12Contexts[handleId].reset();
|
||||
auto it = std::find_if(Dx12Contexts.begin(), Dx12Contexts.end(), [&handleId](const auto& p) { return p.first == handleId; });
|
||||
@@ -577,15 +585,6 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D12_CreateFeature(ID3D12GraphicsComma
|
||||
spdlog::info("NVSDK_NGX_D3D12_CreateFeature creating new FSR 2.1.2 feature");
|
||||
Dx12Contexts[handleId] = std::make_unique<FSR2FeatureDx12_212>(handleId, InParameters);
|
||||
}
|
||||
|
||||
// nvsdk logging - ini first
|
||||
if (!Config::Instance()->LogToNGX.has_value())
|
||||
{
|
||||
int nvsdkLogging = 0;
|
||||
InParameters->Get("DLSSEnabler.Logging", &nvsdkLogging);
|
||||
|
||||
Config::Instance()->LogToNGX = nvsdkLogging > 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -181,11 +181,6 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_VULKAN_Init_ProjectID_Ext(const char* I
|
||||
Config::Instance()->NVNGX_Engine = InEngineType;
|
||||
Config::Instance()->NVNGX_EngineVersion = std::string(InEngineVersion);
|
||||
|
||||
if (Config::Instance()->NVNGX_Engine == NVSDK_NGX_ENGINE_TYPE_UNREAL && InEngineVersion)
|
||||
Config::Instance()->NVNGX_EngineVersion5 = InEngineVersion[0] == '5';
|
||||
else
|
||||
Config::Instance()->NVNGX_EngineVersion5 = false;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -362,7 +357,13 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_VULKAN_CreateFeature1(VkDevice InDevice
|
||||
|
||||
if (InFeatureID == NVSDK_NGX_Feature_SuperSampling)
|
||||
{
|
||||
if (Config::Instance()->VulkanUpscaler.value_or("fsr21") == "dlss")
|
||||
std::string defaultUpscaler = "fsr21";
|
||||
|
||||
// If original NVNGX available use DLSS as base upscaler
|
||||
if (NVNGXProxy::IsVulkanInited())
|
||||
defaultUpscaler = "dlss";
|
||||
|
||||
if (Config::Instance()->VulkanUpscaler.value_or(defaultUpscaler) == "dlss")
|
||||
{
|
||||
if (Config::Instance()->DLSSEnabled.value_or(true))
|
||||
{
|
||||
@@ -389,9 +390,9 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_VULKAN_CreateFeature1(VkDevice InDevice
|
||||
}
|
||||
}
|
||||
|
||||
if (Config::Instance()->VulkanUpscaler.value_or("fsr21") == "fsr22")
|
||||
if (Config::Instance()->VulkanUpscaler.value_or(defaultUpscaler) == "fsr22")
|
||||
VkContexts[handleId] = std::make_unique<FSR2FeatureVk>(handleId, InParameters);
|
||||
else if (Config::Instance()->VulkanUpscaler.value_or("fsr21") == "fsr21")
|
||||
else if (Config::Instance()->VulkanUpscaler.value_or(defaultUpscaler) == "fsr21")
|
||||
VkContexts[handleId] = std::make_unique<FSR2FeatureVk212>(handleId, InParameters);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
#pragma once
|
||||
#include "pch.h"
|
||||
#include <ankerl/unordered_dense.h>
|
||||
#include "Config.h"
|
||||
|
||||
#include <ankerl/unordered_dense.h>
|
||||
|
||||
//#define ENABLE_ENCAPSULATED_PARAMS
|
||||
|
||||
inline static std::optional<float> GetQualityOverrideRatio(const NVSDK_NGX_PerfQuality_Value input)
|
||||
{
|
||||
std::optional<float> output;
|
||||
@@ -524,7 +527,10 @@ struct Parameter
|
||||
struct NVNGX_Parameters : public NVSDK_NGX_Parameter
|
||||
{
|
||||
std::string Name;
|
||||
|
||||
#ifdef ENABLE_ENCAPSULATED_PARAMS
|
||||
NVSDK_NGX_Parameter* OriginalParam = nullptr;
|
||||
#endif // ENABLE_ENCAPSULATED_PARAMS
|
||||
|
||||
void Set(const char* key, unsigned long long value) override { spdlog::trace("NVNGX_Parameters[{2}]::Set ulong('{0}', {1})", key, value, Name); setT(key, value); }
|
||||
void Set(const char* key, float value) override { spdlog::trace("NVNGX_Parameters[{2}]::Set float('{0}', {1})", key, value, Name); setT(key, value); }
|
||||
@@ -544,6 +550,7 @@ struct NVNGX_Parameters : public NVSDK_NGX_Parameter
|
||||
return NVSDK_NGX_Result_Success;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_ENCAPSULATED_PARAMS
|
||||
if (OriginalParam != nullptr)
|
||||
{
|
||||
spdlog::trace("NVNGX_Parameters[{1}]::Get calling original ulong('{0}')", key, Name);
|
||||
@@ -556,6 +563,7 @@ struct NVNGX_Parameters : public NVSDK_NGX_Parameter
|
||||
return result;
|
||||
}
|
||||
}
|
||||
#endif // ENABLE_ENCAPSULATED_PARAMS
|
||||
|
||||
return NVSDK_NGX_Result_Fail;
|
||||
}
|
||||
@@ -569,6 +577,7 @@ struct NVNGX_Parameters : public NVSDK_NGX_Parameter
|
||||
return NVSDK_NGX_Result_Success;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_ENCAPSULATED_PARAMS
|
||||
if (OriginalParam != nullptr)
|
||||
{
|
||||
spdlog::trace("NVNGX_Parameters[{1}]::Get calling original float('{0}')", key, Name);
|
||||
@@ -581,6 +590,7 @@ struct NVNGX_Parameters : public NVSDK_NGX_Parameter
|
||||
return result;
|
||||
}
|
||||
}
|
||||
#endif // ENABLE_ENCAPSULATED_PARAMS
|
||||
|
||||
return NVSDK_NGX_Result_Fail;
|
||||
}
|
||||
@@ -594,6 +604,7 @@ struct NVNGX_Parameters : public NVSDK_NGX_Parameter
|
||||
return NVSDK_NGX_Result_Success;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_ENCAPSULATED_PARAMS
|
||||
if (OriginalParam != nullptr)
|
||||
{
|
||||
spdlog::trace("NVNGX_Parameters[{1}]::Get calling original double('{0}')", key, Name);
|
||||
@@ -606,6 +617,7 @@ struct NVNGX_Parameters : public NVSDK_NGX_Parameter
|
||||
return result;
|
||||
}
|
||||
}
|
||||
#endif // ENABLE_ENCAPSULATED_PARAMS
|
||||
|
||||
return NVSDK_NGX_Result_Fail;
|
||||
}
|
||||
@@ -619,6 +631,7 @@ struct NVNGX_Parameters : public NVSDK_NGX_Parameter
|
||||
return NVSDK_NGX_Result_Success;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_ENCAPSULATED_PARAMS
|
||||
if (OriginalParam != nullptr)
|
||||
{
|
||||
spdlog::trace("NVNGX_Parameters[{1}]::Get calling original uint('{0}')", key, Name);
|
||||
@@ -631,6 +644,7 @@ struct NVNGX_Parameters : public NVSDK_NGX_Parameter
|
||||
return result;
|
||||
}
|
||||
}
|
||||
#endif // ENABLE_ENCAPSULATED_PARAMS
|
||||
|
||||
return NVSDK_NGX_Result_Fail;
|
||||
}
|
||||
@@ -643,6 +657,7 @@ struct NVNGX_Parameters : public NVSDK_NGX_Parameter
|
||||
return NVSDK_NGX_Result_Success;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_ENCAPSULATED_PARAMS
|
||||
if (OriginalParam != nullptr)
|
||||
{
|
||||
spdlog::trace("NVNGX_Parameters[{1}]::Get calling original int('{0}')", key, Name);
|
||||
@@ -655,6 +670,7 @@ struct NVNGX_Parameters : public NVSDK_NGX_Parameter
|
||||
return result;
|
||||
}
|
||||
}
|
||||
#endif // ENABLE_ENCAPSULATED_PARAMS
|
||||
|
||||
return NVSDK_NGX_Result_Fail;
|
||||
}
|
||||
@@ -668,6 +684,7 @@ struct NVNGX_Parameters : public NVSDK_NGX_Parameter
|
||||
return NVSDK_NGX_Result_Success;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_ENCAPSULATED_PARAMS
|
||||
if (OriginalParam != nullptr)
|
||||
{
|
||||
spdlog::trace("NVNGX_Parameters[{1}]::Get calling original void('{0}')", key, Name);
|
||||
@@ -680,6 +697,7 @@ struct NVNGX_Parameters : public NVSDK_NGX_Parameter
|
||||
return result;
|
||||
}
|
||||
}
|
||||
#endif // ENABLE_ENCAPSULATED_PARAMS
|
||||
|
||||
return NVSDK_NGX_Result_Fail;
|
||||
}
|
||||
@@ -693,6 +711,7 @@ struct NVNGX_Parameters : public NVSDK_NGX_Parameter
|
||||
return NVSDK_NGX_Result_Success;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_ENCAPSULATED_PARAMS
|
||||
if (OriginalParam != nullptr)
|
||||
{
|
||||
spdlog::trace("NVNGX_Parameters[{1}]::Get calling original d3d11('{0}')", key, Name);
|
||||
@@ -705,6 +724,7 @@ struct NVNGX_Parameters : public NVSDK_NGX_Parameter
|
||||
return result;
|
||||
}
|
||||
}
|
||||
#endif // ENABLE_ENCAPSULATED_PARAMS
|
||||
|
||||
return NVSDK_NGX_Result_Fail;
|
||||
}
|
||||
@@ -718,6 +738,7 @@ struct NVNGX_Parameters : public NVSDK_NGX_Parameter
|
||||
return NVSDK_NGX_Result_Success;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_ENCAPSULATED_PARAMS
|
||||
if (OriginalParam != nullptr)
|
||||
{
|
||||
spdlog::trace("NVNGX_Parameters[{1}]::Get calling original d3d12('{0}')", key, Name);
|
||||
@@ -730,6 +751,7 @@ struct NVNGX_Parameters : public NVSDK_NGX_Parameter
|
||||
return result;
|
||||
}
|
||||
}
|
||||
#endif // ENABLE_ENCAPSULATED_PARAMS
|
||||
|
||||
return NVSDK_NGX_Result_Fail;
|
||||
}
|
||||
@@ -796,4 +818,3 @@ inline static NVNGX_Parameters* GetNGXParameters(std::string InName)
|
||||
|
||||
return params;
|
||||
}
|
||||
|
||||
|
||||
@@ -307,6 +307,11 @@ public:
|
||||
return _dll;
|
||||
}
|
||||
|
||||
static bool IsNVNGXInited()
|
||||
{
|
||||
return _dll != nullptr && (_dx11Inited || _dx12Inited || _vulkanInited) && Config::Instance()->DLSSEnabled.value_or(true);
|
||||
}
|
||||
|
||||
// DirectX11
|
||||
static bool InitDx11(ID3D11Device* InDevice)
|
||||
{
|
||||
|
||||
@@ -81,8 +81,8 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<IncludePath>$(SolutionDir)external\vulkan\include;$(SolutionDir)external\nvngx_dlss_sdk;$(SolutionDir)external\xess\inc\xess;$(SolutionDir)external\simpleini;$(SolutionDir)external\unordered_dense\include;$(SolutionDir)external\spdlog\include;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(ProjectDir)fsr2\lib;$(ProjectDir)fsr2_212\lib;$(ProjectDir)vulkan;$(ProjectDir)d3dx;$(ProjectDir)detours;$(SolutionDir)external\xess\lib;$(LibraryPath)</LibraryPath>
|
||||
<TargetName>dlss-enabler-upscaler</TargetName>
|
||||
<OutDir>D:\Folders\Games\SteamLibrary\steamapps\common\Ghost of Tsushima DIRECTOR%27S CUT\</OutDir>
|
||||
<TargetName>dxgi</TargetName>
|
||||
<OutDir>D:\Folders\Games\Deep Rock Galactic\FSD\Binaries\Win64\</OutDir>
|
||||
<IntDir>.\x64\Debug</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
|
||||
@@ -14,6 +14,8 @@ std::filesystem::path Util::DllPath()
|
||||
wchar_t dllPath[MAX_PATH];
|
||||
GetModuleFileNameW(dllModule, dllPath, MAX_PATH);
|
||||
dll = std::filesystem::path(dllPath);
|
||||
|
||||
spdlog::info("Dll path: {0}", dll.parent_path().string());
|
||||
}
|
||||
|
||||
return dll;
|
||||
|
||||
@@ -30,6 +30,8 @@ static PFN_CreateSwapChainForHwnd oCreateSwapChainForHwnd_Dx11 = nullptr;
|
||||
static PFN_CreateSwapChainForCoreWindow oCreateSwapChainForCoreWindow_Dx11 = nullptr;
|
||||
static PFN_CreateSwapChainForComposition oCreateSwapChainForComposition_Dx11 = nullptr;
|
||||
|
||||
inline static std::mutex _dx11CleanMutex;
|
||||
|
||||
static void CleanupRenderTarget();
|
||||
static void CleanupDeviceD3D11();
|
||||
static bool CreateDeviceD3D11(HWND hWnd);
|
||||
@@ -103,11 +105,15 @@ static void CleanupRenderTarget()
|
||||
{
|
||||
spdlog::debug("ImGuiOverlayDx11::CleanupRenderTarget");
|
||||
|
||||
_dx11CleanMutex.lock();
|
||||
|
||||
if (g_pd3dRenderTarget)
|
||||
{
|
||||
g_pd3dRenderTarget->Release();
|
||||
g_pd3dRenderTarget = NULL;
|
||||
}
|
||||
|
||||
_dx11CleanMutex.unlock();
|
||||
}
|
||||
|
||||
static void CleanupDeviceD3D11()
|
||||
|
||||
@@ -168,6 +168,7 @@ static long _slCounter;
|
||||
static long _fsr3ModCounter;
|
||||
static long _fsr3NativeCounter;
|
||||
|
||||
inline static std::mutex _dx12CleanMutex;
|
||||
|
||||
enum SwapchainSource
|
||||
{
|
||||
@@ -282,6 +283,8 @@ static void CleanupRenderTarget(bool clearQueue)
|
||||
{
|
||||
spdlog::debug("ImGuiOverlayDx12::CleanupRenderTarget({0})!", clearQueue);
|
||||
|
||||
_dx12CleanMutex.lock();
|
||||
|
||||
for (UINT i = 0; i < NUM_BACK_BUFFERS; ++i)
|
||||
{
|
||||
if (g_mainRenderTargetResource[i])
|
||||
@@ -293,7 +296,7 @@ static void CleanupRenderTarget(bool clearQueue)
|
||||
|
||||
if (clearQueue)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(300));
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
|
||||
if (ImGuiOverlayBase::IsInited() && ImGui::GetIO().BackendRendererUserData)
|
||||
ImGui_ImplDX12_Shutdown();
|
||||
@@ -329,6 +332,8 @@ static void CleanupRenderTarget(bool clearQueue)
|
||||
}
|
||||
|
||||
ClearActivePathInfo();
|
||||
|
||||
_dx12CleanMutex.unlock();
|
||||
}
|
||||
|
||||
#pragma region Hooks for native EB Prensent Methods
|
||||
|
||||
@@ -22,6 +22,7 @@ static HWND _hwnd;
|
||||
|
||||
static bool g_bInitialized = false;
|
||||
static bool g_bEnabled = false;
|
||||
inline static std::mutex _vkCleanMutex;
|
||||
|
||||
// vk hook stuff
|
||||
static VkRenderPass g_vkRenderPass = VK_NULL_HANDLE;
|
||||
@@ -490,10 +491,14 @@ void ImGuiOverlayVk::ReInitVk(HWND InNewHwnd)
|
||||
if (!_isInited || !g_bInitialized)
|
||||
return;
|
||||
|
||||
_vkCleanMutex.lock();
|
||||
|
||||
spdlog::debug("ImGuiOverlayVk::ReInitVk hwnd: {0:X}", (UINT64)InNewHwnd);
|
||||
|
||||
ImGui_ImplVulkan_Shutdown();
|
||||
ImGuiOverlayBase::Shutdown();
|
||||
ImGuiOverlayBase::Init(InNewHwnd);
|
||||
g_bInitialized = false;
|
||||
|
||||
_vkCleanMutex.unlock();
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#define VER_MAJOR_VERSION 0
|
||||
#define VER_MINOR_VERSION 6
|
||||
#define VER_HOTFIX_VERSION 1
|
||||
#define VER_BUILD_NUMBER 15
|
||||
#define VER_BUILD_NUMBER 21
|
||||
#define VER_PRE_RELEASE
|
||||
|
||||
#define VER_FILE_VERSION VER_MAJOR_VERSION, VER_MINOR_VERSION, VER_HOTFIX_VERSION, VER_BUILD_NUMBER
|
||||
|
||||
@@ -131,7 +131,7 @@ RenderPresetUltraPerformance=auto
|
||||
; -------------------------------------------------------
|
||||
[Menu]
|
||||
; -------------------------------------------------------
|
||||
; Enable new overlay ImGui menus
|
||||
; Enables new overlay ImGui menus
|
||||
; true or false - Default (auto) is true
|
||||
OverlayMenu=auto
|
||||
|
||||
@@ -154,6 +154,9 @@ ResetKey=auto
|
||||
; Integer value - Default (auto) is 90 frames
|
||||
MenuInitDelay=auto
|
||||
|
||||
; Enables advanced settings for DLSS Enabler in menu
|
||||
; true or false - Default (auto) is false
|
||||
ExtraEnablerSettings=auto
|
||||
|
||||
|
||||
|
||||
@@ -196,6 +199,11 @@ HookOriginalNvngxOnly=auto
|
||||
; true or false - Default (auto) is true
|
||||
Dxgi=auto
|
||||
|
||||
; Skips DXGI GPU spoofing for XeSS (Only for OptiScaler instances)
|
||||
; Might have compatibility issues, if screen is black try enabling autoexposure!
|
||||
; true or false - Default (auto) is true
|
||||
DxgiXessNoSpoof=auto
|
||||
|
||||
; Enables Nvidia GPU spoofing for Vulkan
|
||||
; true or false - Default (auto) is false
|
||||
Vulkan=auto
|
||||
|
||||
Reference in New Issue
Block a user