[PATCH 1/5] d3d11/tests: Require feature level 11_0 or 10_0 by default.

Matteo Bruni mbruni at codeweavers.com
Tue Mar 8 16:19:41 CST 2016


Otherwise D3D11CreateDevice() might fallback to feature level 9 and the
current tests can't handle (nor are interested in) that.

Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
---
This becomes particularly relevant after adding feature level support in
dxgi.

 dlls/d3d11/tests/d3d11.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index 9d9b2e4..9d6add5 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -187,8 +187,23 @@ static void check_texture_color_(unsigned int line, ID3D11Texture2D *texture,
 
 static ID3D11Device *create_device(const D3D_FEATURE_LEVEL *feature_level)
 {
+    static const D3D_FEATURE_LEVEL default_feature_level[] =
+    {
+        D3D_FEATURE_LEVEL_11_0,
+        D3D_FEATURE_LEVEL_10_0,
+    };
+    unsigned int feature_level_count;
     ID3D11Device *device;
-    UINT feature_level_count = feature_level ? 1 : 0;
+
+    if (feature_level)
+    {
+        feature_level_count = 1;
+    }
+    else
+    {
+        feature_level = default_feature_level;
+        feature_level_count = sizeof(default_feature_level) / sizeof(default_feature_level[0]);
+    }
 
     if (SUCCEEDED(D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, feature_level, feature_level_count,
             D3D11_SDK_VERSION, &device, NULL, NULL)))
-- 
2.4.10




More information about the wine-patches mailing list