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

Steve Lhomme git at videolan.org
Thu Apr 5 08:47:01 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Apr  5 08:40:16 2018 +0200| [425a6eb97891f11e21f1a67994f304e5bde491a4] | committer: Steve Lhomme

d3d9_fmt: make the driver version test more flexible

Just like d3d11

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

 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