[vlc-commits] d3d9_fmt: make the driver version test more flexible

Steve Lhomme git at videolan.org
Fri Apr 6 11:23:43 CEST 2018


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Apr  5 08:40:16 2018 +0200| [675334fd6f320c71e2430a1e80183bfe3d67beb6] | committer: Jean-Baptiste Kempf

d3d9_fmt: make the driver version test more flexible

Just like d3d11

(cherry picked from commit 425a6eb97891f11e21f1a67994f304e5bde491a4)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/video_chroma/d3d9_fmt.c | 38 +++++++++++++++++++++++++++++---------
 1 file changed, 29 insertions(+), 9 deletions(-)

diff --git a/modules/video_chroma/d3d9_fmt.c b/modules/video_chroma/d3d9_fmt.c
index a0a0bb12a5..901317935f 100644
--- a/modules/video_chroma/d3d9_fmt.c
+++ b/modules/video_chroma/d3d9_fmt.c
@@ -279,13 +279,33 @@ int D3D9CheckDriverVersion(d3d9_handle_t *hd3d, d3d9_device_t *d3d_dev,
         build += (revision - 100) * 1000;
     }
 
-    bool newer =
-           wddm > min_ver->wddm ||
-          (wddm == min_ver->wddm && (d3d_features > min_ver->d3d_features ||
-                                    (d3d_features == min_ver->d3d_features &&
-                                                (revision > min_ver->revision ||
-                                                (revision == min_ver->revision &&
-                                                       build > min_ver->build)))));
-
-    return newer ? VLC_SUCCESS : VLC_EGENERIC;
+    if (min_ver->wddm)
+    {
+        if (wddm > min_ver->wddm)
+            return VLC_SUCCESS;
+        else if (wddm != min_ver->wddm)
+            return VLC_EGENERIC;
+    }
+    if (min_ver->d3d_features)
+    {
+        if (d3d_features > min_ver->d3d_features)
+            return VLC_SUCCESS;
+        else if (d3d_features != min_ver->d3d_features)
+            return VLC_EGENERIC;
+    }
+    if (min_ver->revision)
+    {
+        if (revision > min_ver->revision)
+            return VLC_SUCCESS;
+        else if (revision != min_ver->revision)
+            return VLC_EGENERIC;
+    }
+    if (min_ver->build)
+    {
+        if (build > min_ver->build)
+            return VLC_SUCCESS;
+        else if (build != min_ver->build)
+            return VLC_EGENERIC;
+    }
+    return VLC_SUCCESS;
 }



More information about the vlc-commits mailing list