File tree 9 files changed +64
-4
lines changed
9 files changed +64
-4
lines changed Original file line number Diff line number Diff line change @@ -276,6 +276,8 @@ bool Config::Reload(std::filesystem::path iniPath)
276
276
277
277
UsePrecompiledShaders = readBool (" Hotfix" , " UsePrecompiledShaders" );
278
278
279
+ UseGenericAppIdWithDlss = readBool (" Hotfix" , " UseGenericAppIdWithDlss" );
280
+
279
281
ColorResourceBarrier = readInt (" Hotfix" , " ColorResourceBarrier" );
280
282
MVResourceBarrier = readInt (" Hotfix" , " MotionVectorResourceBarrier" );
281
283
DepthResourceBarrier = readInt (" Hotfix" , " DepthResourceBarrier" );
@@ -566,6 +568,8 @@ bool Config::SaveIni()
566
568
567
569
ini.SetValue (" Hotfix" , " UsePrecompiledShaders" , GetBoolValue (Instance ()->UsePrecompiledShaders ).c_str ());
568
570
571
+ ini.SetValue (" Hotfix" , " UseGenericAppIdWithDlss" , GetBoolValue (Instance ()->UseGenericAppIdWithDlss ).c_str ());
572
+
569
573
ini.SetValue (" Hotfix" , " ColorResourceBarrier" , GetIntValue (Instance ()->ColorResourceBarrier ).c_str ());
570
574
ini.SetValue (" Hotfix" , " MotionVectorResourceBarrier" , GetIntValue (Instance ()->MVResourceBarrier ).c_str ());
571
575
ini.SetValue (" Hotfix" , " DepthResourceBarrier" , GetIntValue (Instance ()->DepthResourceBarrier ).c_str ());
Original file line number Diff line number Diff line change @@ -106,6 +106,8 @@ class Config
106
106
107
107
std::optional<bool > UsePrecompiledShaders;
108
108
109
+ std::optional<bool > UseGenericAppIdWithDlss;
110
+
109
111
std::optional<int32_t > ColorResourceBarrier;
110
112
std::optional<int32_t > MVResourceBarrier;
111
113
std::optional<int32_t > DepthResourceBarrier;
Original file line number Diff line number Diff line change @@ -107,16 +107,19 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_UpdateFeature(const NVSDK_NGX_Applicati
107
107
{
108
108
if (ApplicationId->IdentifierType == NVSDK_NGX_Application_Identifier_Type_Application_Id)
109
109
{
110
- LOG_INFO (" Update ApplicationId: {0:X}" , ApplicationId->v .ApplicationId );
111
- Config::Instance ()->NVNGX_ApplicationId = ApplicationId->v .ApplicationId ;
110
+ auto appId = Config::Instance ()->UseGenericAppIdWithDlss .value_or (false ) ? app_id_override : ApplicationId->v .ApplicationId ;
111
+ LOG_INFO (" Update ApplicationId: {0:X}" , appId);
112
+ Config::Instance ()->NVNGX_ApplicationId = appId;
112
113
}
113
114
else if (ApplicationId->IdentifierType == NVSDK_NGX_Application_Identifier_Type_Project_Id)
114
115
{
115
- Config::Instance ()->NVNGX_ProjectId = std::string (ApplicationId->v .ProjectDesc .ProjectId );
116
+ auto projectId = Config::Instance ()->UseGenericAppIdWithDlss .value_or (false ) ? project_id_override :
117
+ std::string (ApplicationId->v .ProjectDesc .ProjectId );
118
+ Config::Instance ()->NVNGX_ProjectId = projectId;
116
119
Config::Instance ()->NVNGX_Engine = ApplicationId->v .ProjectDesc .EngineType ;
117
120
Config::Instance ()->NVNGX_EngineVersion = std::string (ApplicationId->v .ProjectDesc .EngineVersion );
118
121
119
- LOG_INFO (" Update InProjectId: {0}" , Config::Instance ()-> NVNGX_ProjectId );
122
+ LOG_INFO (" Update InProjectId: {0}" , projectId );
120
123
LOG_INFO (" Update InEngineType: {0}" , (int )Config::Instance ()->NVNGX_Engine );
121
124
LOG_INFO (" Update InEngineVersion: {0}" , Config::Instance ()->NVNGX_EngineVersion );
122
125
}
Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_Init_Ext(unsigned long long InApp
34
34
{
35
35
if (Config::Instance ()->DLSSEnabled .value_or (true ) && !NVNGXProxy::IsDx11Inited ())
36
36
{
37
+ if (Config::Instance ()->UseGenericAppIdWithDlss .value_or (false ))
38
+ InApplicationId = app_id_override;
39
+
37
40
if (NVNGXProxy::NVNGXModule () == nullptr )
38
41
NVNGXProxy::InitNVNGX ();
39
42
@@ -106,6 +109,9 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_Init(unsigned long long InApplica
106
109
{
107
110
if (Config::Instance ()->DLSSEnabled .value_or (true ) && !NVNGXProxy::IsDx11Inited ())
108
111
{
112
+ if (Config::Instance ()->UseGenericAppIdWithDlss .value_or (false ))
113
+ InApplicationId = app_id_override;
114
+
109
115
if (NVNGXProxy::NVNGXModule () == nullptr )
110
116
NVNGXProxy::InitNVNGX ();
111
117
@@ -131,6 +137,9 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D11_Init_ProjectID(const char* InProj
131
137
{
132
138
if (Config::Instance ()->DLSSEnabled .value_or (true ) && !NVNGXProxy::IsDx11Inited ())
133
139
{
140
+ if (Config::Instance ()->UseGenericAppIdWithDlss .value_or (false ))
141
+ InProjectId = project_id_override;
142
+
134
143
if (NVNGXProxy::NVNGXModule () == nullptr )
135
144
NVNGXProxy::InitNVNGX ();
136
145
Original file line number Diff line number Diff line change @@ -209,6 +209,9 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D12_Init_Ext(unsigned long long InApp
209
209
{
210
210
LOG_FUNC ();
211
211
212
+ if (Config::Instance ()->UseGenericAppIdWithDlss .value_or (false ))
213
+ InApplicationId = app_id_override;
214
+
212
215
Config::Instance ()->NVNGX_ApplicationId = InApplicationId;
213
216
Config::Instance ()->NVNGX_ApplicationDataPath = std::wstring (InApplicationDataPath);
214
217
Config::Instance ()->NVNGX_Version = InSDKVersion;
@@ -291,6 +294,9 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D12_Init(unsigned long long InApplica
291
294
292
295
if (Config::Instance ()->DLSSEnabled .value_or (true ) && !NVNGXProxy::IsDx12Inited ())
293
296
{
297
+ if (Config::Instance ()->UseGenericAppIdWithDlss .value_or (false ))
298
+ InApplicationId = app_id_override;
299
+
294
300
if (NVNGXProxy::NVNGXModule () == nullptr )
295
301
NVNGXProxy::InitNVNGX ();
296
302
@@ -319,6 +325,9 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_D3D12_Init_ProjectID(const char* InProj
319
325
320
326
if (Config::Instance ()->DLSSEnabled .value_or (true ) && !NVNGXProxy::IsDx12Inited ())
321
327
{
328
+ if (Config::Instance ()->UseGenericAppIdWithDlss .value_or (false ))
329
+ InProjectId = project_id_override;
330
+
322
331
if (NVNGXProxy::NVNGXModule () == nullptr )
323
332
NVNGXProxy::InitNVNGX ();
324
333
Original file line number Diff line number Diff line change @@ -36,6 +36,9 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_VULKAN_Init_Ext(unsigned long long InAp
36
36
37
37
if (Config::Instance ()->DLSSEnabled .value_or (true ) && !NVNGXProxy::IsVulkanInited ())
38
38
{
39
+ if (Config::Instance ()->UseGenericAppIdWithDlss .value_or (false ))
40
+ InApplicationId = app_id_override;
41
+
39
42
if (NVNGXProxy::NVNGXModule () == nullptr )
40
43
NVNGXProxy::InitNVNGX ();
41
44
@@ -59,6 +62,9 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_VULKAN_Init_Ext2(unsigned long long InA
59
62
60
63
if (Config::Instance ()->DLSSEnabled .value_or (true ) && !NVNGXProxy::IsVulkanInited ())
61
64
{
65
+ if (Config::Instance ()->UseGenericAppIdWithDlss .value_or (false ))
66
+ InApplicationId = app_id_override;
67
+
62
68
if (NVNGXProxy::NVNGXModule () == nullptr )
63
69
NVNGXProxy::InitNVNGX ();
64
70
@@ -206,6 +212,9 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_VULKAN_Init(unsigned long long InApplic
206
212
207
213
if (Config::Instance ()->DLSSEnabled .value_or (true ) && !NVNGXProxy::IsVulkanInited ())
208
214
{
215
+ if (Config::Instance ()->UseGenericAppIdWithDlss .value_or (false ))
216
+ InApplicationId = app_id_override;
217
+
209
218
if (NVNGXProxy::NVNGXModule () == nullptr )
210
219
NVNGXProxy::InitNVNGX ();
211
220
@@ -230,6 +239,9 @@ NVSDK_NGX_API NVSDK_NGX_Result NVSDK_NGX_VULKAN_Init_ProjectID(const char* InPro
230
239
231
240
if (Config::Instance ()->DLSSEnabled .value_or (true ) && !NVNGXProxy::IsVulkanInited ())
232
241
{
242
+ if (Config::Instance ()->UseGenericAppIdWithDlss .value_or (false ))
243
+ InProjectId = project_id_override;
244
+
233
245
if (NVNGXProxy::NVNGXModule () == nullptr )
234
246
NVNGXProxy::InitNVNGX ();
235
247
Original file line number Diff line number Diff line change 11
11
#include < filesystem>
12
12
#include " detours/detours.h"
13
13
14
+ inline const char * project_id_override = " 24480451-f00d-face-1304-0308dabad187" ;
15
+ constexpr unsigned long long app_id_override = 0x24480451 ;
16
+
14
17
#pragma region spoofing hooks for 16xx
15
18
16
19
// NvAPI_GPU_GetArchInfo hooking based on Nukem's spoofing code here
Original file line number Diff line number Diff line change @@ -1744,6 +1744,20 @@ void ImGuiCommon::RenderMenu()
1744
1744
Config::Instance ()->changeBackend = true ;
1745
1745
}
1746
1746
}
1747
+
1748
+ if (Config::Instance ()->AdvancedSettings .value_or (false ) && currentBackend == " dlss" )
1749
+ {
1750
+ bool appIdOverride = Config::Instance ()->UseGenericAppIdWithDlss .value_or (false );
1751
+
1752
+ if (ImGui::Checkbox (" Use Generic App Id with DLSS" , &appIdOverride))
1753
+ {
1754
+ Config::Instance ()->UseGenericAppIdWithDlss = appIdOverride;
1755
+ }
1756
+
1757
+ ShowHelpMarker (" Use generic appid with NGX\n "
1758
+ " Fixes OptiScaler preset override not working with certain games\n "
1759
+ " Requires a game restart." );
1760
+ }
1747
1761
}
1748
1762
}
1749
1763
Original file line number Diff line number Diff line change @@ -502,6 +502,10 @@ ExposureResourceBarrier=auto
502
502
; Default (auto) is state correction disabled
503
503
OutputResourceBarrier =auto
504
504
505
+ ; Use generic appid with NGX, fixes OptiScaler preset override not working with certain games
506
+ ; true or false - Default (auto) is false
507
+ UseGenericAppIdWithDlss =auto
508
+
505
509
; These settings defines each resources initial resource
506
510
; state and add resource barrier for correct state
507
511
;
You can’t perform that action at this time.
0 commit comments