Skip to content

Commit d4e28cf

Browse files
committed
Added DONT_USE_XMX define
1 parent 703860b commit d4e28cf

6 files changed

Lines changed: 29 additions & 2 deletions

File tree

‎OptiScaler/SysUtils.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@
6464
// Use vkQueueSubmit2KHR instead of vkQueueSubmit for testing Linux issue
6565
// #define USE_QUEUE_SUBMIT_2_KHR
6666

67+
// Don't skip spoofing for XeSS features
68+
// Which would ONLY disable XMX when using spoofing
69+
// #define DONT_USE_XMX
70+
6771
inline HMODULE dllModule = nullptr;
6872
inline HMODULE exeModule = nullptr;
6973
inline HMODULE originalModule = nullptr;

‎OptiScaler/framegen/xefg/XeFG_Dx12.cpp‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ bool XeFG_Dx12::CreateSwapchainContext(ID3D12Device* device)
4444

4545
auto createResult = false;
4646

47+
#ifndef DONT_USE_XMX
4748
ScopedSkipSpoofing skipSpoofing {};
49+
#endif // !DONT_USE_XMX
4850

4951
do
5052
{
@@ -386,8 +388,11 @@ bool XeFG_Dx12::CreateSwapchain(IDXGIFactory* factory, ID3D12CommandQueue* cmdQu
386388
if (Config::Instance()->FGXeFGHighResMV.value_or_default())
387389
_constants.flags |= FG_Flags::DisplayResolutionMVs;
388390

389-
xefg_swapchain_result_t result;
391+
#ifndef DONT_USE_XMX
390392
ScopedSkipSpoofing skipSpoofing {};
393+
#endif // !DONT_USE_XMX
394+
395+
xefg_swapchain_result_t result;
391396
result = XeFGProxy::D3D12InitFromSwapChainDesc()(_swapChainContext, hwnd, &scDesc, &fsDesc, realQueue, factory12,
392397
&params);
393398

@@ -547,8 +552,11 @@ bool XeFG_Dx12::CreateSwapchain1(IDXGIFactory* factory, ID3D12CommandQueue* cmdQ
547552

548553
State::Instance().skipSpoofing = true;
549554

550-
xefg_swapchain_result_t result;
555+
#ifndef DONT_USE_XMX
551556
ScopedSkipSpoofing skipSpoofing {};
557+
#endif // !DONT_USE_XMX
558+
559+
xefg_swapchain_result_t result;
552560
result = XeFGProxy::D3D12InitFromSwapChainDesc()(_swapChainContext, hwnd, desc, pFullscreenDesc, realQueue,
553561
factory12, &params);
554562

@@ -723,7 +731,10 @@ bool XeFG_Dx12::Dispatch()
723731
auto uiState =
724732
_uiComposition ? XEFG_SWAPCHAIN_UI_COMPOSITION_STATE_ENABLED : XEFG_SWAPCHAIN_UI_COMPOSITION_STATE_DISABLED;
725733

734+
#ifndef DONT_USE_XMX
726735
ScopedSkipSpoofing skipSpoofing {};
736+
#endif // !DONT_USE_XMX
737+
727738
auto uiResult = XeFGProxy::SetUiCompositionState()(_swapChainContext, uiState);
728739

729740
if (uiResult != XEFG_SWAPCHAIN_RESULT_SUCCESS)
@@ -747,7 +758,9 @@ bool XeFG_Dx12::Dispatch()
747758

748759
state.WAR_xefgRequestFGToggle = true;
749760

761+
#ifndef DONT_USE_XMX
750762
ScopedSkipSpoofing skipSpoofing {};
763+
#endif // !DONT_USE_XMX
751764

752765
auto intResult = XeFGProxy::SetNumInterpolatedFrames()(
753766
_swapChainContext, Config::Instance()->FGXeFGInterpolationCount.value_or_default());

‎OptiScaler/proxies/XeLL_Proxy.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,10 @@ class XeLLProxy
329329

330330
xell_result_t xellResult;
331331
{
332+
#ifndef DONT_USE_XMX
332333
ScopedSkipSpoofing skipSpoofing {};
334+
#endif // !DONT_USE_XMX
335+
333336
xellResult = _xellD3D12CreateContext(device, &_xellContext);
334337
}
335338

‎OptiScaler/upscalers/xess/XeSSFeature.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ bool XeSSFeature::InitXeSS(ID3D12Device* device, const NVSDK_NGX_Parameter* InPa
3333
}
3434

3535
{
36+
#ifndef DONT_USE_XMX
3637
ScopedSkipSpoofing skipSpoofing {};
38+
#endif // !DONT_USE_XMX
3739

3840
auto ret = XeSSProxy::D3D12CreateContext()(device, &_xessContext);
3941

‎OptiScaler/upscalers/xess/XeSSFeature_Dx11.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ bool XeSSFeature_Dx11::Init(ID3D11Device* InDevice, ID3D11DeviceContext* InConte
7474
DeviceContext = InContext;
7575

7676
{
77+
#ifndef DONT_USE_XMX
7778
ScopedSkipSpoofing skipSpoofing {};
79+
#endif // !DONT_USE_XMX
7880

7981
auto ret = XeSSProxy::D3D11CreateContext()(InDevice, &_xessContext);
8082

‎OptiScaler/upscalers/xess/XeSSFeature_Vk.cpp‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,10 @@ bool XeSSFeature_Vk::Init(VkInstance InInstance, VkPhysicalDevice InPD, VkDevice
108108
}
109109

110110
{
111+
#ifndef DONT_USE_XMX
111112
ScopedSkipSpoofing skipSpoofing {};
113+
#endif // !DONT_USE_XMX
114+
112115
auto ret = XeSSProxy::VKCreateContext()(InInstance, InPD, InDevice, &_xessContext);
113116

114117
if (ret != XESS_RESULT_SUCCESS)

0 commit comments

Comments
 (0)