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

Steve Lhomme git at videolan.org
Wed Mar 21 16:22:35 CET 2018


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Mar 21 16:07:01 2018 +0100| [15a0a1c4eb42bba4d0844b5b9fe95c35c21fa0cb] | committer: Hugo Beauzée-Luyssen

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

(cherry picked from commit cb9e21e362e5c1ad4a0fe2137988a11d699e3abb)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

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

 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 843b771475..ec6fee3c2a 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1561,6 +1561,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