Skip to content

Commit 08f42f4

Browse files
committed
Device is only forced to debug mode if a debugger is present.
1 parent 61c0815 commit 08f42f4

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

loader_core/loader_core.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,17 @@ HRESULT loader_core::RouteD3D11CreateDeviceAndSwapChain(DX11_CREATE_FDEF)
222222
HRESULT ret = NULL;
223223

224224
#ifdef _DEBUG
225-
Flags |= D3D11_CREATE_DEVICE_DEBUG;
226-
if (g_warpSelection == WarpSelection::ASK)
227-
g_warpSelection = MessageBoxA(nullptr, "Debug addon loader active. Enable WARP?", "WARP", MB_YESNO | MB_ICONQUESTION | MB_DEFBUTTON2 | MB_TASKMODAL) == IDYES ? WarpSelection::ON : WarpSelection::OFF;
228-
229-
if (g_warpSelection == WarpSelection::ON)
225+
if(IsDebuggerPresent())
230226
{
231-
DriverType = D3D_DRIVER_TYPE_WARP;
232-
pAdapter = nullptr;
227+
Flags |= D3D11_CREATE_DEVICE_DEBUG;
228+
if (g_warpSelection == WarpSelection::ASK)
229+
g_warpSelection = MessageBoxA(nullptr, "Debug addon loader active. Enable WARP?", "WARP", MB_YESNO | MB_ICONQUESTION | MB_DEFBUTTON2 | MB_TASKMODAL) == IDYES ? WarpSelection::ON : WarpSelection::OFF;
230+
231+
if (g_warpSelection == WarpSelection::ON)
232+
{
233+
DriverType = D3D_DRIVER_TYPE_WARP;
234+
pAdapter = nullptr;
235+
}
233236
}
234237
#endif
235238

0 commit comments

Comments
 (0)