summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurice Kalinowski <maurice.kalinowski@theqtcompany.com>2016-01-12 15:13:08 +0100
committerYoann Lopes <yoann.lopes@theqtcompany.com>2016-01-18 12:44:23 +0000
commit752c1f0077c5f8361d9a166b8caaf7bff25562c1 (patch)
tree42ab10751bf9c7d3eb58f14629e0f56d18e6eb80
parentf69a0516754ec2c6f1448fd3deac8d34bc35eb73 (diff)
downloadqtmultimedia-752c1f0077c5f8361d9a166b8caaf7bff25562c1.tar.gz
winrt: Fix crash in debug mode
In debug mode we try to set the D3D11_CREATE_DEVICE_DEBUG flag to gather additional information for debugging purposes. However, some devices do not provide those and the D3D11CreateDevice call fails. Instead, try to create a hardware non-debug device first before going into the last software-mode fallback. Task-number: QTBUG-49488 Change-Id: I2d91b5f54f7fd818103bd106314b8503e5759159 Reviewed-by: Samuel Nevala <samuel.nevala@intopalo.com> Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
-rw-r--r--src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp b/src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp
index cf62843f7..7dd2e6557 100644
--- a/src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp
+++ b/src/plugins/winrt/qwinrtabstractvideorenderercontrol.cpp
@@ -86,6 +86,14 @@ struct QWinRTVideoRendererControlGlobal
hr = D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, flags,
featureLevels, ARRAYSIZE(featureLevels), D3D11_SDK_VERSION,
&device, &featureLevel, &context);
+#ifdef _DEBUG
+ if (FAILED(hr)) {
+ qErrnoWarning(hr, "Failed to create D3D device with device debug flag");
+ hr = D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, D3D11_CREATE_DEVICE_VIDEO_SUPPORT,
+ featureLevels, ARRAYSIZE(featureLevels), D3D11_SDK_VERSION,
+ &device, &featureLevel, &context);
+ }
+#endif
if (FAILED(hr))
qErrnoWarning(hr, "Failed to create D3D device");