d3d11: Implement d3d11_device_GetImmediateContext1().

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46298
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
stable
Nikolay Sivov 2019-01-23 08:21:33 +03:00 committed by Alexandre Julliard
parent 5eab4a59de
commit 9ede653d0d
2 changed files with 16 additions and 8 deletions

View File

@ -3648,9 +3648,15 @@ static UINT STDMETHODCALLTYPE d3d11_device_GetExceptionMode(ID3D11Device2 *iface
return 0;
}
static void STDMETHODCALLTYPE d3d11_device_GetImmediateContext1(ID3D11Device2 *iface, ID3D11DeviceContext1 **context)
static void STDMETHODCALLTYPE d3d11_device_GetImmediateContext1(ID3D11Device2 *iface,
ID3D11DeviceContext1 **immediate_context)
{
FIXME("iface %p, context %p stub!\n", iface, context);
struct d3d_device *device = impl_from_ID3D11Device2(iface);
TRACE("iface %p, immediate_context %p.\n", iface, immediate_context);
*immediate_context = &device->immediate_context.ID3D11DeviceContext1_iface;
ID3D11DeviceContext1_AddRef(*immediate_context);
}
static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeferredContext1(ID3D11Device2 *iface, UINT flags,

View File

@ -6439,12 +6439,7 @@ static void test_device_context_state(void)
feature_level = ID3D11Device1_GetFeatureLevel(device);
ID3D11Device1_GetImmediateContext1(device, &context);
todo_wine ok(!!context, "Failed to get immediate context.\n");
if (!context)
{
ID3D11Device1_Release(device);
return;
}
ok(!!context, "Failed to get immediate context.\n");
sampler_desc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR;
sampler_desc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP;
@ -6471,7 +6466,14 @@ static void test_device_context_state(void)
feature_level = min(feature_level, D3D_FEATURE_LEVEL_10_1);
hr = ID3D11Device1_CreateDeviceContextState(device, 0, &feature_level, 1, D3D11_SDK_VERSION,
&IID_ID3D10Device, NULL, &context_state);
todo_wine
ok(SUCCEEDED(hr), "Failed to create device context state, hr %#x.\n", hr);
if (FAILED(hr))
{
ID3D11SamplerState_Release(sampler);
ID3D11Device1_Release(device);
return;
}
refcount = get_refcount(context_state);
ok(refcount == 1, "Got refcount %u, expected 1.\n", refcount);