From 1e77bb01db6ae8c79125de90c983696e5e301e2f Mon Sep 17 00:00:00 2001 From: Matteo Bruni Date: Wed, 9 Mar 2016 23:19:20 +0100 Subject: [PATCH] d3d11: Implement device_GetFeatureLevel(). Signed-off-by: Matteo Bruni Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/d3d10_1/tests/d3d10_1.c | 4 ++-- dlls/d3d11/d3d11_main.c | 4 ++++ dlls/d3d11/d3d11_private.h | 2 ++ dlls/d3d11/device.c | 12 ++++++++---- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/dlls/d3d10_1/tests/d3d10_1.c b/dlls/d3d10_1/tests/d3d10_1.c index f67896e8450..7eba447ff87 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); - ok(feature_level == supported_feature_level, "Got feature level %#x, expected %#x.\n", + todo_wine 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); - ok(feature_level == supported_feature_level, "Got feature level %#x, expected %#x.\n", + todo_wine 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/d3d11/d3d11_main.c b/dlls/d3d11/d3d11_main.c index afc161f220f..e3ef209ba14 100644 --- a/dlls/d3d11/d3d11_main.c +++ b/dlls/d3d11/d3d11_main.c @@ -104,6 +104,8 @@ static HRESULT WINAPI layer_create(enum dxgi_device_layer_id id, void **layer_ba static void WINAPI layer_set_feature_level(enum dxgi_device_layer_id id, void *device, D3D_FEATURE_LEVEL feature_level) { + struct d3d_device *d3d_device = device; + TRACE("id %#x, device %p, feature_level %u.\n", id, device, feature_level); if (id != DXGI_DEVICE_LAYER_D3D10_DEVICE) @@ -111,6 +113,8 @@ static void WINAPI layer_set_feature_level(enum dxgi_device_layer_id id, void *d WARN("Unknown layer id %#x.\n", id); return; } + + d3d_device->feature_level = feature_level; } HRESULT WINAPI D3D11CoreRegisterLayers(void) diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h index a501a13d21d..072afb4c9ce 100644 --- a/dlls/d3d11/d3d11_private.h +++ b/dlls/d3d11/d3d11_private.h @@ -394,6 +394,8 @@ struct d3d_device IUnknown *outer_unk; LONG refcount; + D3D_FEATURE_LEVEL feature_level; + struct d3d11_immediate_context immediate_context; struct wined3d_device_parent device_parent; diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 8b7d2f88ca0..6ec154f963a 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -2536,9 +2536,11 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_SetPrivateDataInterface(ID3D11Devi static D3D_FEATURE_LEVEL STDMETHODCALLTYPE d3d11_device_GetFeatureLevel(ID3D11Device *iface) { - FIXME("iface %p stub!\n", iface); + struct d3d_device *device = impl_from_ID3D11Device(iface); - return D3D_FEATURE_LEVEL_10_0; + TRACE("iface %p.\n", iface); + + return device->feature_level; } static UINT STDMETHODCALLTYPE d3d11_device_GetCreationFlags(ID3D11Device *iface) @@ -4557,9 +4559,11 @@ static void STDMETHODCALLTYPE d3d10_device_GetTextFilterSize(ID3D10Device1 *ifac static D3D10_FEATURE_LEVEL1 STDMETHODCALLTYPE d3d10_device_GetFeatureLevel(ID3D10Device1 *iface) { - FIXME("iface %p stub!\n", iface); + struct d3d_device *device = impl_from_ID3D10Device(iface); - return D3D10_FEATURE_LEVEL_10_1; + TRACE("iface %p.\n", iface); + + return device->feature_level; } static const struct ID3D10Device1Vtbl d3d10_device1_vtbl =