[vlc-devel] [PATCH 2/3] direct3d11: make sure we request a device that can do D3D11 11.1

Steve Lhomme robux4 at videolabs.io
Thu Mar 3 11:22:05 CET 2016


---
 modules/video_output/msw/direct3d11.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/video_output/msw/direct3d11.c b/modules/video_output/msw/direct3d11.c
index 2bcc6a6..27f2e29 100644
--- a/modules/video_output/msw/direct3d11.c
+++ b/modules/video_output/msw/direct3d11.c
@@ -886,7 +886,6 @@ static int Direct3D11Open(vout_display_t *vd, video_format_t *fmt)
     scd.OutputWindow = sys->hvideownd;
 
     IDXGIAdapter *dxgiadapter;
-# if USE_DXGI
     static const D3D_FEATURE_LEVEL featureLevels[] =
     {
         D3D_FEATURE_LEVEL_11_1,
@@ -898,6 +897,7 @@ static int Direct3D11Open(vout_display_t *vd, video_format_t *fmt)
         D3D_FEATURE_LEVEL_9_1
     };
 
+# if USE_DXGI
     /* TODO : list adapters for the user to choose from */
     hr = IDXGIFactory_EnumAdapters(sys->dxgifactory, 0, &dxgiadapter);
     if (FAILED(hr)) {
@@ -954,7 +954,7 @@ static int Direct3D11Open(vout_display_t *vd, video_format_t *fmt)
 
     for (UINT driver = 0; driver < ARRAYSIZE(driverAttempts); driver++) {
         hr = D3D11CreateDevice(NULL, driverAttempts[driver], NULL, creationFlags,
-                    NULL, 0, D3D11_SDK_VERSION,
+                    featureLevels, ARRAY_SIZE(featureLevels), D3D11_SDK_VERSION,
                     &sys->d3ddevice, NULL, &sys->d3dcontext);
         if (SUCCEEDED(hr)) {
 #ifndef NDEBUG
-- 
2.7.2.windows.1



More information about the vlc-devel mailing list