[vlc-commits] direct3d11: try to fallback to 8 bits rendering if 10 bits fail

Steve Lhomme git at videolan.org
Wed Mar 21 16:07:06 CET 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Mar 21 16:07:01 2018 +0100| [cb9e21e362e5c1ad4a0fe2137988a11d699e3abb] | committer: Steve Lhomme

direct3d11: try to fallback to 8 bits rendering if 10 bits fail

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cb9e21e362e5c1ad4a0fe2137988a11d699e3abb
---

 modules/video_output/win32/direct3d11.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 919bd2e6b2..a09981287a 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1562,6 +1562,13 @@ static int Direct3D11Open(vout_display_t *vd)
 
     hr = IDXGIFactory2_CreateSwapChainForHwnd(dxgifactory, (IUnknown *)sys->d3d_dev.d3ddevice,
                                               sys->sys.hvideownd, &scd, NULL, NULL, &sys->dxgiswapChain);
+    if (hr == DXGI_ERROR_INVALID_CALL && scd.Format == DXGI_FORMAT_R10G10B10A2_UNORM)
+    {
+        msg_Warn(vd, "10 bits swapchain failed, try 8 bits");
+        scd.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
+        hr = IDXGIFactory2_CreateSwapChainForHwnd(dxgifactory, (IUnknown *)sys->d3d_dev.d3ddevice,
+                                                  sys->sys.hvideownd, &scd, NULL, NULL, &sys->dxgiswapChain);
+    }
     IDXGIFactory2_Release(dxgifactory);
     if (FAILED(hr)) {
        msg_Err(vd, "Could not create the SwapChain. (hr=0x%lX)", hr);



More information about the vlc-commits mailing list