[vlc-commits] d3d11_fmt: keep the feature level in d3d11_device_t

Steve Lhomme git at videolan.org
Wed Mar 14 11:52:11 CET 2018


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Mar 13 14:14:55 2018 +0100| [7fcf4a741ad3bef41d577818aca97713fd1d0c00] | committer: Hugo Beauzée-Luyssen

d3d11_fmt: keep the feature level in d3d11_device_t

(cherry picked from commit d444a1ae5d188bbdefafd45639410c8db9ea1cd9)
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=7fcf4a741ad3bef41d577818aca97713fd1d0c00
---

 modules/video_chroma/d3d11_fmt.c | 9 ++++-----
 modules/video_chroma/d3d11_fmt.h | 1 +
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/video_chroma/d3d11_fmt.c b/modules/video_chroma/d3d11_fmt.c
index 1ebc5ddd45..0932c4228d 100644
--- a/modules/video_chroma/d3d11_fmt.c
+++ b/modules/video_chroma/d3d11_fmt.c
@@ -269,21 +269,20 @@ HRESULT D3D11_CreateDevice(vlc_object_t *obj, d3d11_handle_t *hd3d,
     };
 
     for (UINT driver = 0; driver < ARRAY_SIZE(driverAttempts); driver++) {
-        D3D_FEATURE_LEVEL i_feature_level;
         hr = D3D11CreateDevice(NULL, driverAttempts[driver], NULL, creationFlags,
                     D3D11_features, ARRAY_SIZE(D3D11_features), D3D11_SDK_VERSION,
-                    &out->d3ddevice, &i_feature_level, &out->d3dcontext);
+                    &out->d3ddevice, &out->feature_level, &out->d3dcontext);
         if (SUCCEEDED(hr)) {
 #ifndef NDEBUG
             msg_Dbg(obj, "Created the D3D11 device 0x%p ctx 0x%p type %d level %x.",
                     (void *)out->d3ddevice, (void *)out->d3dcontext,
-                    driverAttempts[driver], i_feature_level);
+                    driverAttempts[driver], out->feature_level);
             D3D11_GetDriverVersion( obj, out );
 #endif
             /* we can work with legacy levels but only if forced */
-            if ( obj->obj.force || i_feature_level >= D3D_FEATURE_LEVEL_11_0 )
+            if ( obj->obj.force || out->feature_level >= D3D_FEATURE_LEVEL_11_0 )
                 break;
-            msg_Dbg(obj, "Incompatible feature level %x", i_feature_level);
+            msg_Dbg(obj, "Incompatible feature level %x", out->feature_level);
             ID3D11DeviceContext_Release(out->d3dcontext);
             ID3D11Device_Release(out->d3ddevice);
             out->d3dcontext = NULL;
diff --git a/modules/video_chroma/d3d11_fmt.h b/modules/video_chroma/d3d11_fmt.h
index 4a22b28cb7..64743bb9e9 100644
--- a/modules/video_chroma/d3d11_fmt.h
+++ b/modules/video_chroma/d3d11_fmt.h
@@ -41,6 +41,7 @@ typedef struct
     ID3D11DeviceContext      *d3dcontext;      /* D3D context */
     bool                     owner;
     struct wddm_version      WDDM;
+    D3D_FEATURE_LEVEL        feature_level;
 } d3d11_device_t;
 
 typedef struct



More information about the vlc-commits mailing list