Skip to content

Commit

Permalink
Add a define to force warp
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Sep 24, 2024
1 parent 359b523 commit 7339386
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ void kope_d3d12_device_create(kope_g5_device *device, const kope_g5_device_wishl
IDXGIFactory4 *dxgi_factory = NULL;
kinc_microsoft_affirm(CreateDXGIFactory1(IID_PPV_ARGS(&dxgi_factory)));

HRESULT result = D3D12CreateDevice(NULL, D3D_FEATURE_LEVEL_12_2, IID_PPV_ARGS(&device->d3d12.device));
HRESULT result = S_FALSE;

#ifndef KOPE_D3D12_FORCE_WARP
result = D3D12CreateDevice(NULL, D3D_FEATURE_LEVEL_12_2, IID_PPV_ARGS(&device->d3d12.device));
if (result == S_OK) {
kinc_log(KINC_LOG_LEVEL_INFO, "%s", "Direct3D running on feature level 12.2.");
}
Expand All @@ -62,6 +65,7 @@ void kope_d3d12_device_create(kope_g5_device *device, const kope_g5_device_wishl
kinc_log(KINC_LOG_LEVEL_INFO, "%s", "Direct3D running on feature level 12.0.");
}
}
#endif

if (result != S_OK) {
kinc_log(KINC_LOG_LEVEL_WARNING, "%s", "Falling back to the WARP driver, things will be slow.");
Expand Down

0 comments on commit 7339386

Please sign in to comment.