[vlc-commits] direct3d11: rework the check on AMD drivers capable to display decoder NV12

Steve Lhomme git at videolan.org
Tue Jul 2 07:23:14 CEST 2019


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Jun 21 18:04:12 2019 +0200| [daec5391b99e6cc49fae9ee4da899e5b57916695] | committer: Steve Lhomme

direct3d11: rework the check on AMD drivers capable to display decoder NV12

The test allowed either version 20 and above OR version 162 and above.
Both conditions need to be true.

Add more known bad drivers to the documentation.

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

 modules/video_output/win32/direct3d11.c | 30 +++++++++++++++++++++---------
 1 file changed, 21 insertions(+), 9 deletions(-)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 46a05dc03c..12e38ce2fa 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1468,17 +1468,29 @@ static bool CanUseTextureArray(vout_display_t *vd)
     (void) vd;
     return false;
 #else
-    struct wddm_version WDDM = {
-        .wddm         = 20,  // starting with drivers designed for W10
-        // 15.200.1062.1004 is wrong - 2015/08/03
-        // 22.19.165.3 is good       - 2017/05/04
-        .revision     = 162, // 17.5.1
+    // 15.200.1062.1004 is wrong - 2015/08/03 - 15.7.1 WHQL
+    // 21.19.144.1281 is wrong   -
+    // 22.19.165.3 is good       - 2017/05/04 - ReLive Edition 17.5.1
+    struct wddm_version WDDM_os = {
+        .wddm         = 21,  // starting with drivers designed for W10 Anniversary Update
     };
-    if (D3D11CheckDriverVersion(&vd->sys->d3d_dev, GPU_MANUFACTURER_AMD, &WDDM) == VLC_SUCCESS)
-        return true;
+    if (D3D11CheckDriverVersion(&vd->sys->d3d_dev, GPU_MANUFACTURER_AMD, &WDDM_os) != VLC_SUCCESS)
+    {
+        msg_Dbg(vd, "AMD driver too old, fallback to legacy shader mode");
+        return false;
+    }
 
-    msg_Dbg(vd, "fallback to legacy shader mode for old AMD drivers");
-    return false;
+    // xx.xx.1000.xxx drivers can't happen here for WDDM > 2.0
+    struct wddm_version WDDM_build = {
+        .revision     = 162,
+    };
+    if (D3D11CheckDriverVersion(&vd->sys->d3d_dev, GPU_MANUFACTURER_AMD, &WDDM_build) != VLC_SUCCESS)
+    {
+        msg_Dbg(vd, "Bogus AMD driver detected, fallback to legacy shader mode");
+        return false;
+    }
+
+    return true;
 #endif
 }
 



More information about the vlc-commits mailing list