d3d11: Implement device_GetFeatureLevel().

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Matteo Bruni 2016-03-09 23:19:20 +01:00 committed by Alexandre Julliard
parent ffce30bc31
commit 1e77bb01db
4 changed files with 16 additions and 6 deletions

View File

@ -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);

View File

@ -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)

View File

@ -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;

View File

@ -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 =