Skip to content

Commit

Permalink
d3d11: retry device creation without debug, if SDK is not available
Browse files Browse the repository at this point in the history
Fixes #11512
  • Loading branch information
kasper93 authored and jeeb committed Apr 2, 2023
1 parent 9d120a4 commit 68b3239
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion video/out/gpu/d3d11_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ bool mp_d3d11_create_present_device(struct mp_log *log,
struct d3d11_device_opts *opts,
ID3D11Device **dev_out)
{
bool debug = opts->debug;
bool warp = opts->force_warp;
int max_fl = opts->max_feature_level;
int min_fl = opts->min_feature_level;
Expand Down Expand Up @@ -510,7 +511,15 @@ bool mp_d3d11_create_present_device(struct mp_log *log,
max_fl = max_fl ? max_fl : D3D_FEATURE_LEVEL_11_0;
min_fl = min_fl ? min_fl : D3D_FEATURE_LEVEL_9_1;

hr = create_device(log, adapter, warp, opts->debug, max_fl, min_fl, &dev);
hr = create_device(log, adapter, warp, debug, max_fl, min_fl, &dev);

// Retry without debug, if SDK is not available
if (debug && hr == DXGI_ERROR_SDK_COMPONENT_MISSING) {
mp_warn(log, "gpu-debug disabled due to error: %s\n", mp_HRESULT_to_str(hr));
debug = false;
continue;
}

if (SUCCEEDED(hr))
break;

Expand Down

0 comments on commit 68b3239

Please sign in to comment.