From: Józef Kucia jkucia@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/d3d11/tests/d3d11.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 18b7f4855608..4fe81109768a 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -23010,8 +23010,8 @@ static void test_fractional_viewports(void) static const float white[] = {1.0f, 1.0f, 1.0f, 1.0f}; static const float viewport_offsets[] = { - 0.0f, 0.5f, 0.25f, 0.125f, 0.0625f, 0.03125f, 0.015625f, 0.0078125f, 0.00390625f, - 1.0f / 128.0f, 63.0f / 128.0f, + 0.0f, 1.0f / 2.0f, 1.0f / 4.0f, 1.0f / 8.0f, 1.0f / 16.0f, 1.0f / 32.0f, + 1.0f / 64.0f, 1.0f / 128.0f, 1.0f / 256.0f, 63.0f / 128.0f, };
if (!init_test_context(&test_context, &feature_level))
From: Józef Kucia jkucia@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/d3d11/tests/Makefile.in | 2 +- dlls/d3d11/tests/d3d11.c | 76 ++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 71 insertions(+), 7 deletions(-)
diff --git a/dlls/d3d11/tests/Makefile.in b/dlls/d3d11/tests/Makefile.in index ac95e2e40110..9612bb363747 100644 --- a/dlls/d3d11/tests/Makefile.in +++ b/dlls/d3d11/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = d3d11.dll -IMPORTS = d3d11 user32 gdi32 +IMPORTS = d3d11 dxgi user32 gdi32
C_SRCS = \ d3d11.c diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 4fe81109768a..2b0a57797a86 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -1004,6 +1004,48 @@ static void check_texture_uvec4_(unsigned int line, ID3D11Texture2D *texture, check_texture_sub_resource_uvec4_(line, texture, sub_resource_idx, NULL, expected_value); }
+static BOOL use_warp_adapter; +static unsigned int use_adapter_idx; + +static IDXGIAdapter *create_adapter(void) +{ + IDXGIFactory4 *factory4; + IDXGIFactory *factory; + IDXGIAdapter *adapter; + HRESULT hr; + + if (!use_warp_adapter && !use_adapter_idx) + return NULL; + + if (FAILED(hr = CreateDXGIFactory1(&IID_IDXGIFactory, (void **)&factory))) + { + trace("Failed to create IDXGIFactory, hr %#x.\n", hr); + return NULL; + } + + adapter = NULL; + if (use_warp_adapter) + { + if (SUCCEEDED(hr = IDXGIFactory_QueryInterface(factory, &IID_IDXGIFactory4, (void **)&factory4))) + { + hr = IDXGIFactory4_EnumWarpAdapter(factory4, &IID_IDXGIAdapter, (void **)&adapter); + IDXGIFactory4_Release(factory4); + } + else + { + trace("Failed to get IDXGIFactory4, hr %#x.\n", hr); + } + } + else + { + hr = IDXGIFactory_EnumAdapters(factory, use_adapter_idx, &adapter); + } + IDXGIFactory_Release(factory); + if (FAILED(hr)) + trace("Failed to get adapter, hr %#x.\n", hr); + return adapter; +} + static ID3D11Device *create_device(const struct device_desc *desc) { static const D3D_FEATURE_LEVEL default_feature_level[] = @@ -1015,7 +1057,9 @@ static ID3D11Device *create_device(const struct device_desc *desc) const D3D_FEATURE_LEVEL *feature_level; UINT flags = desc ? desc->flags : 0; unsigned int feature_level_count; + IDXGIAdapter *adapter; ID3D11Device *device; + HRESULT hr;
if (desc && desc->feature_level) { @@ -1028,14 +1072,22 @@ static ID3D11Device *create_device(const struct device_desc *desc) feature_level_count = ARRAY_SIZE(default_feature_level); }
- if (SUCCEEDED(D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, flags, feature_level, feature_level_count, - D3D11_SDK_VERSION, &device, NULL, NULL))) + if ((adapter = create_adapter())) + { + hr = D3D11CreateDevice(adapter, D3D_DRIVER_TYPE_UNKNOWN, NULL, flags, + feature_level, feature_level_count, D3D11_SDK_VERSION, &device, NULL, NULL); + IDXGIAdapter_Release(adapter); + return SUCCEEDED(hr) ? device : NULL; + } + + if (SUCCEEDED(D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, flags, + feature_level, feature_level_count, D3D11_SDK_VERSION, &device, NULL, NULL))) return device; - if (SUCCEEDED(D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_WARP, NULL, flags, feature_level, feature_level_count, - D3D11_SDK_VERSION, &device, NULL, NULL))) + if (SUCCEEDED(D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_WARP, NULL, flags, + feature_level, feature_level_count, D3D11_SDK_VERSION, &device, NULL, NULL))) return device; - if (SUCCEEDED(D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_REFERENCE, NULL, flags, feature_level, feature_level_count, - D3D11_SDK_VERSION, &device, NULL, NULL))) + if (SUCCEEDED(D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_REFERENCE, NULL, flags, + feature_level, feature_level_count, D3D11_SDK_VERSION, &device, NULL, NULL))) return device;
return NULL; @@ -24738,6 +24790,18 @@ static void test_generate_mips(void)
START_TEST(d3d11) { + unsigned int argc, i; + char **argv; + + argc = winetest_get_mainargs(&argv); + for (i = 2; i < argc; ++i) + { + if (!strcmp(argv[i], "--warp")) + use_warp_adapter = TRUE; + else if (!strcmp(argv[i], "--adapter") && i + 1 < argc) + use_adapter_idx = atoi(argv[++i]); + } + test_create_device(); run_for_each_feature_level(test_device_interfaces); test_get_immediate_context();
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
From: Józef Kucia jkucia@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/d3d11/tests/d3d11.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 2b0a57797a86..c0cb9a2400f0 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -1109,6 +1109,20 @@ static void get_device_adapter_desc(ID3D11Device *device, DXGI_ADAPTER_DESC *ada IDXGIAdapter_Release(adapter); }
+static void print_adapter_info(void) +{ + DXGI_ADAPTER_DESC adapter_desc; + ID3D11Device *device; + + if (!(device = create_device(NULL))) + return; + + get_device_adapter_desc(device, &adapter_desc); + trace("Adapter: %s, %04x:%04x.\n", wine_dbgstr_w(adapter_desc.Description), + adapter_desc.VendorId, adapter_desc.DeviceId); + ID3D11Device_Release(device); +} + static BOOL is_warp_device(ID3D11Device *device) { DXGI_ADAPTER_DESC adapter_desc; @@ -24802,6 +24816,8 @@ START_TEST(d3d11) use_adapter_idx = atoi(argv[++i]); }
+ print_adapter_info(); + test_create_device(); run_for_each_feature_level(test_device_interfaces); test_get_immediate_context();
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com