Skip to content

Commit e678449

Browse files
committed
Added D3D Feature Level spoofing
1 parent aa43f4b commit e678449

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

OptiScaler.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,10 @@ VulkanVRAM=auto
422422
; true or false - Default (auto) is false, unless DLSSG mod is enabled
423423
SpoofHAGS=auto
424424

425+
; Enables overriding of requested D3D feature level
426+
; true or false - Default (auto) is false
427+
D3DFeatureLevel=auto
428+
425429

426430

427431
; -------------------------------------------------------

OptiScaler/Config.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ class Config
288288
CustomOptional<std::wstring> SpoofedGPUName{ L"NVIDIA GeForce RTX 4090" };
289289
CustomOptional<int, NoDefault> VulkanVRAM; // disabled by default
290290
CustomOptional<bool> SpoofHAGS{ false };
291+
CustomOptional<bool> SpoofFeatureLevel{ false };
291292

292293
// Plugins
293294
CustomOptional<std::wstring> PluginPath{ L"plugins" };

OptiScaler/hooks/HooksDx.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3603,8 +3603,12 @@ static HRESULT hkD3D12CreateDevice(IDXGIAdapter* pAdapter, D3D_FEATURE_LEVEL Min
36033603
}
36043604
#endif
36053605

3606+
auto minLevel = MinimumFeatureLevel;
3607+
if (Config::Instance()->SpoofFeatureLevel.value_or_default())
3608+
minLevel = D3D_FEATURE_LEVEL_11_0;
3609+
36063610
//State::Instance().skipSpoofing = true;
3607-
auto result = o_D3D12CreateDevice(pAdapter, MinimumFeatureLevel, riid, ppDevice);
3611+
auto result = o_D3D12CreateDevice(pAdapter, minLevel, riid, ppDevice);
36083612
//State::Instance().skipSpoofing = false;
36093613

36103614
if (result == S_OK && ppDevice != nullptr && *ppDevice != nullptr)

0 commit comments

Comments
 (0)