=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: d3d10core/tests: Add test for device feature level.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Aug 24 07:37:15 CDT 2015
Module: wine
Branch: master
Commit: 66b2d96a69f5c0e74980d7d66a1f36ca4ed160ce
URL: http://source.winehq.org/git/wine.git/?a=commit;h=66b2d96a69f5c0e74980d7d66a1f36ca4ed160ce
Author: Józef Kucia <jkucia at codeweavers.com>
Date: Mon Aug 24 01:04:25 2015 +0200
d3d10core/tests: Add test for device feature level.
---
dlls/d3d10core/tests/device.c | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c
index bdceb9b..47719e4 100644
--- a/dlls/d3d10core/tests/device.c
+++ b/dlls/d3d10core/tests/device.c
@@ -19,6 +19,7 @@
#define COBJMACROS
#include "initguid.h"
#include "d3d10.h"
+#include "d3d11.h"
#include "wine/test.h"
#include <limits.h>
@@ -171,6 +172,37 @@ static IDXGISwapChain *create_swapchain(ID3D10Device *device, HWND window, BOOL
return swapchain;
}
+static void test_feature_level(void)
+{
+ D3D_FEATURE_LEVEL feature_level;
+ ID3D11Device *device11;
+ ID3D10Device *device10;
+ HRESULT hr;
+
+ if (!(device10 = create_device()))
+ {
+ skip("Failed to create device, skipping tests.\n");
+ return;
+ }
+
+ hr = ID3D10Device_QueryInterface(device10, &IID_ID3D11Device, (void **)&device11);
+ ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */,
+ "Failed to query ID3D11Device interface, hr %#x.\n", hr);
+ if (FAILED(hr))
+ {
+ skip("D3D11 is not available.\n");
+ ID3D10Device_Release(device10);
+ return;
+ }
+
+ /* Device was created by D3D10CreateDevice. */
+ feature_level = ID3D11Device_GetFeatureLevel(device11);
+ ok(feature_level == D3D_FEATURE_LEVEL_10_0, "Got unexpected feature level %#x.\n", feature_level);
+
+ ID3D11Device_Release(device11);
+ ID3D10Device_Release(device10);
+}
+
static void test_create_texture2d(void)
{
ULONG refcount, expected_refcount;
@@ -3432,6 +3464,7 @@ static void test_update_subresource(void)
START_TEST(device)
{
+ test_feature_level();
test_create_texture2d();
test_create_texture3d();
test_create_depthstencil_view();
More information about the wine-cvs
mailing list