Module: wine Branch: master Commit: faecb8eda4b0360f5d60d3a989fb3cfed779df0c URL: http://source.winehq.org/git/wine.git/?a=commit;h=faecb8eda4b0360f5d60d3a989...
Author: Józef Kucia jkucia@codeweavers.com Date: Wed Apr 26 13:19:59 2017 +0200
d3d11/tests: Extend test for ID3DDeviceContextState.
Signed-off-by: Józef Kucia jkucia@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/d3d11/tests/d3d11.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index a692473..23fbecf 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -5314,6 +5314,9 @@ static void test_device_context_state(void) return; }
+ check_interface(device, &IID_ID3D10Device, FALSE, FALSE); + check_interface(device, &IID_ID3D10Device1, FALSE, FALSE); + feature_level = ID3D11Device1_GetFeatureLevel(device); ID3D11Device1_GetImmediateContext1(device, &context);
@@ -5334,7 +5337,7 @@ static void test_device_context_state(void) ok(SUCCEEDED(hr), "Failed to create sampler state, hr %#x.\n", hr);
ID3D11DeviceContext1_PSSetSamplers(context, 0, 1, &sampler); - tmp_sampler = (ID3D11SamplerState *)0xdeadbeef; + tmp_sampler = NULL; ID3D11DeviceContext1_PSGetSamplers(context, 0, 1, &tmp_sampler); ok(tmp_sampler == sampler, "Got sampler %p, expected %p.\n", tmp_sampler, sampler); ID3D11SamplerState_Release(tmp_sampler); @@ -5347,7 +5350,7 @@ static void test_device_context_state(void) ok(refcount == 1, "Got refcount %u, expected 1.\n", refcount);
/* Enable ID3D10Device behavior. */ - previous_context_state = (ID3DDeviceContextState *)0xdeadbeef; + previous_context_state = NULL; ID3D11DeviceContext1_SwapDeviceContextState(context, context_state, &previous_context_state); refcount = ID3DDeviceContextState_Release(context_state); ok(!refcount, "Got refcount %u, expected 0.\n", refcount); @@ -5358,18 +5361,35 @@ static void test_device_context_state(void) ok(tmp_sampler == (ID3D11SamplerState *)0xdeadbeef, "Got unexpected sampler %p.\n", tmp_sampler); ID3D11DeviceContext1_PSSetSamplers(context, 0, 1, &tmp_sampler);
+ check_interface(device, &IID_ID3D10Device, TRUE, FALSE); + check_interface(device, &IID_ID3D10Device1, TRUE, FALSE); + ID3D11DeviceContext1_SwapDeviceContextState(context, previous_context_state, &context_state); refcount = ID3DDeviceContextState_Release(context_state); ok(!refcount, "Got refcount %u, expected 0.\n", refcount); refcount = ID3DDeviceContextState_Release(previous_context_state); ok(!refcount, "Got refcount %u, expected 0.\n", refcount);
- ID3D11DeviceContext1_PSSetSamplers(context, 0, 1, &sampler); + /* ID3DDeviceContextState retains the previous state. */ + tmp_sampler = NULL; + ID3D11DeviceContext1_PSGetSamplers(context, 0, 1, &tmp_sampler); + ok(tmp_sampler == sampler, "Got sampler %p, expected %p.\n", tmp_sampler, sampler); + ID3D11SamplerState_Release(tmp_sampler); + + tmp_sampler = NULL; + ID3D11DeviceContext1_PSSetSamplers(context, 0, 1, &tmp_sampler); tmp_sampler = (ID3D11SamplerState *)0xdeadbeef; ID3D11DeviceContext1_PSGetSamplers(context, 0, 1, &tmp_sampler); + ok(!tmp_sampler, "Got unexpected sampler %p.\n", tmp_sampler); + ID3D11DeviceContext1_PSSetSamplers(context, 0, 1, &sampler); + tmp_sampler = NULL; + ID3D11DeviceContext1_PSGetSamplers(context, 0, 1, &tmp_sampler); ok(tmp_sampler == sampler, "Got sampler %p, expected %p.\n", tmp_sampler, sampler); ID3D11SamplerState_Release(tmp_sampler);
+ check_interface(device, &IID_ID3D10Device, TRUE, FALSE); + check_interface(device, &IID_ID3D10Device1, TRUE, FALSE); + ID3D11SamplerState_Release(sampler); ID3D11DeviceContext1_Release(context); refcount = ID3D11Device1_Release(device);