Skip to content

Commit

Permalink
Added D3D Feature Level spoofing
Browse files Browse the repository at this point in the history
  • Loading branch information
cdozdil committed Feb 18, 2025
1 parent aa43f4b commit e678449
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions OptiScaler.ini
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,10 @@ VulkanVRAM=auto
; true or false - Default (auto) is false, unless DLSSG mod is enabled
SpoofHAGS=auto

; Enables overriding of requested D3D feature level
; true or false - Default (auto) is false
D3DFeatureLevel=auto



; -------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions OptiScaler/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ class Config
CustomOptional<std::wstring> SpoofedGPUName{ L"NVIDIA GeForce RTX 4090" };
CustomOptional<int, NoDefault> VulkanVRAM; // disabled by default
CustomOptional<bool> SpoofHAGS{ false };
CustomOptional<bool> SpoofFeatureLevel{ false };

// Plugins
CustomOptional<std::wstring> PluginPath{ L"plugins" };
Expand Down
6 changes: 5 additions & 1 deletion OptiScaler/hooks/HooksDx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3603,8 +3603,12 @@ static HRESULT hkD3D12CreateDevice(IDXGIAdapter* pAdapter, D3D_FEATURE_LEVEL Min
}
#endif

auto minLevel = MinimumFeatureLevel;
if (Config::Instance()->SpoofFeatureLevel.value_or_default())
minLevel = D3D_FEATURE_LEVEL_11_0;

//State::Instance().skipSpoofing = true;
auto result = o_D3D12CreateDevice(pAdapter, MinimumFeatureLevel, riid, ppDevice);
auto result = o_D3D12CreateDevice(pAdapter, minLevel, riid, ppDevice);
//State::Instance().skipSpoofing = false;

if (result == S_OK && ppDevice != nullptr && *ppDevice != nullptr)
Expand Down

0 comments on commit e678449

Please sign in to comment.