From fcc8553d8b8075542cd3edf26276c1915d29b0da Mon Sep 17 00:00:00 2001 From: Matteo Bruni Date: Wed, 16 Mar 2016 00:24:10 +0100 Subject: [PATCH] d3d10core: Add feature level support. Signed-off-by: Matteo Bruni Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/d3d10/d3d10_main.c | 2 +- dlls/d3d10/d3d10_private.h | 2 +- dlls/d3d10_1/d3d10_1_main.c | 6 ++---- dlls/d3d10_1/tests/d3d10_1.c | 4 ++-- dlls/d3d10core/d3d10core.spec | 2 +- dlls/d3d10core/d3d10core_main.c | 11 +++++------ 6 files changed, 12 insertions(+), 15 deletions(-) diff --git a/dlls/d3d10/d3d10_main.c b/dlls/d3d10/d3d10_main.c index 4600a70f359..e36ec51d753 100644 --- a/dlls/d3d10/d3d10_main.c +++ b/dlls/d3d10/d3d10_main.c @@ -117,7 +117,7 @@ HRESULT WINAPI D3D10CreateDevice(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver } } - hr = D3D10CoreCreateDevice(factory, adapter, flags, NULL, device); + hr = D3D10CoreCreateDevice(factory, adapter, flags, D3D_FEATURE_LEVEL_10_0, device); IDXGIAdapter_Release(adapter); IDXGIFactory_Release(factory); if (FAILED(hr)) diff --git a/dlls/d3d10/d3d10_private.h b/dlls/d3d10/d3d10_private.h index dbd72baf55d..232399faeca 100644 --- a/dlls/d3d10/d3d10_private.h +++ b/dlls/d3d10/d3d10_private.h @@ -268,7 +268,7 @@ HRESULT d3d10_effect_parse(struct d3d10_effect *This, const void *data, SIZE_T d /* D3D10Core */ HRESULT WINAPI D3D10CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapter, - UINT flags, void *unknown0, ID3D10Device **device); + unsigned int flags, D3D_FEATURE_LEVEL feature_level, ID3D10Device **device); #define MAKE_TAG(ch0, ch1, ch2, ch3) \ ((DWORD)(ch0) | ((DWORD)(ch1) << 8) | \ diff --git a/dlls/d3d10_1/d3d10_1_main.c b/dlls/d3d10_1/d3d10_1_main.c index 1f35c43cc87..e9fad3ed093 100644 --- a/dlls/d3d10_1/d3d10_1_main.c +++ b/dlls/d3d10_1/d3d10_1_main.c @@ -27,7 +27,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d10); HRESULT WINAPI D3D10CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapter, - UINT flags, void *unknown0, ID3D10Device **device); + unsigned int flags, D3D_FEATURE_LEVEL feature_level, ID3D10Device **device); #define WINE_D3D10_TO_STR(x) case x: return #x @@ -161,9 +161,7 @@ HRESULT WINAPI D3D10CreateDevice1(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE drive } } - FIXME("Ignoring feature level %s.\n", debug_d3d10_feature_level(hw_level)); - - hr = D3D10CoreCreateDevice(factory, adapter, flags, NULL, (ID3D10Device **)device); + hr = D3D10CoreCreateDevice(factory, adapter, flags, hw_level, (ID3D10Device **)device); IDXGIAdapter_Release(adapter); IDXGIFactory_Release(factory); if (FAILED(hr)) diff --git a/dlls/d3d10_1/tests/d3d10_1.c b/dlls/d3d10_1/tests/d3d10_1.c index ccea06b9be0..f7d188d6bf7 100644 --- a/dlls/d3d10_1/tests/d3d10_1.c +++ b/dlls/d3d10_1/tests/d3d10_1.c @@ -82,7 +82,7 @@ static void test_create_device(void) } feature_level = ID3D10Device1_GetFeatureLevel(device); - todo_wine ok(feature_level == supported_feature_level, "Got feature level %#x, expected %#x.\n", + ok(feature_level == supported_feature_level, "Got feature level %#x, expected %#x.\n", feature_level, supported_feature_level); ID3D10Device1_Release(device); @@ -165,7 +165,7 @@ static void test_create_device(void) ok(!refcount, "Swapchain has %u references left.\n", refcount); feature_level = ID3D10Device1_GetFeatureLevel(device); - todo_wine ok(feature_level == supported_feature_level, "Got feature level %#x, expected %#x.\n", + ok(feature_level == supported_feature_level, "Got feature level %#x, expected %#x.\n", feature_level, supported_feature_level); refcount = ID3D10Device1_Release(device); diff --git a/dlls/d3d10core/d3d10core.spec b/dlls/d3d10core/d3d10core.spec index 65698881c92..9bf25b5c7f4 100644 --- a/dlls/d3d10core/d3d10core.spec +++ b/dlls/d3d10core/d3d10core.spec @@ -1,2 +1,2 @@ -@ stdcall D3D10CoreCreateDevice(ptr ptr long ptr ptr) +@ stdcall D3D10CoreCreateDevice(ptr ptr long long ptr) @ stdcall D3D10CoreRegisterLayers() diff --git a/dlls/d3d10core/d3d10core_main.c b/dlls/d3d10core/d3d10core_main.c index 44f1e29344e..d364be90d6d 100644 --- a/dlls/d3d10core/d3d10core_main.c +++ b/dlls/d3d10core/d3d10core_main.c @@ -26,8 +26,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d10core); -HRESULT WINAPI D3D11CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapter, UINT flags, - const D3D_FEATURE_LEVEL *feature_levels, UINT levels, ID3D11Device **device); +HRESULT WINAPI D3D11CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapter, unsigned int flags, + const D3D_FEATURE_LEVEL *feature_levels, unsigned int level_count, ID3D11Device **device); HRESULT WINAPI D3D10CoreRegisterLayers(void) { @@ -37,14 +37,13 @@ HRESULT WINAPI D3D10CoreRegisterLayers(void) } HRESULT WINAPI D3D10CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapter, - UINT flags, void *unknown0, ID3D10Device **device) + unsigned int flags, D3D_FEATURE_LEVEL feature_level, ID3D10Device **device) { - D3D_FEATURE_LEVEL feature_level = D3D_FEATURE_LEVEL_10_0; ID3D11Device *device11; HRESULT hr; - TRACE("factory %p, adapter %p, flags %#x, unknown0 %p, device %p.\n", - factory, adapter, flags, unknown0, device); + TRACE("factory %p, adapter %p, flags %#x, feature_level %#x, device %p.\n", + factory, adapter, flags, feature_level, device); if (FAILED(hr = D3D11CoreCreateDevice(factory, adapter, flags, &feature_level, 1, &device11))) return hr;