summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-03-28 21:03:03 +0200
committerJan Ekström <jeebjp@gmail.com>2023-04-02 21:43:53 +0300
commit68b3239b523cd75ba0a12f680ac7bc77e5647d40 (patch)
tree37186d174130ac268668051b58e335dce0d11027 /video
parent9d120a441191870cbb734a6769478eb4aadd701e (diff)
downloadmpv-68b3239b523cd75ba0a12f680ac7bc77e5647d40.tar.bz2
mpv-68b3239b523cd75ba0a12f680ac7bc77e5647d40.tar.xz
d3d11: retry device creation without debug, if SDK is not available
Fixes #11512
Diffstat (limited to 'video')
-rw-r--r--video/out/gpu/d3d11_helpers.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/video/out/gpu/d3d11_helpers.c b/video/out/gpu/d3d11_helpers.c
index 54eaea94aa..b3e524056e 100644
--- a/video/out/gpu/d3d11_helpers.c
+++ b/video/out/gpu/d3d11_helpers.c
@@ -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;
@@ -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;