Better checking multiple context swap side effects.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com ---
So it looks like that a device context state tracks a unique state per device (or per context, but it only works on immediate contexts).
This requires anyway a new wined3d object to track the hidden refcount, but then the corresponding states also have to be tracked on each device, and doesn't seem to be viable to keep it on the d3d11 side.
dlls/d3d11/tests/d3d11.c | 47 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 4 deletions(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index c5c2e16e716..7935dab1332 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -7057,14 +7057,21 @@ static void test_device_context_state(void) ID3D11Device1_GetImmediateContext1(device2, &context2); ok(!!context2, "Failed to get immediate context.\n");
+ /* but they track a distinct state on each context */ ID3D11DeviceContext1_SwapDeviceContextState(context2, context_state, &tmp_context_state); ok(!!tmp_context_state, "Failed to get context state.\n"); tmp_vs = (ID3D11VertexShader *)0xdeadbeef; + ID3D11DeviceContext1_VSGetShader(context2, &tmp_vs, NULL, NULL); + ok(!tmp_vs, "Got unexpected shader %p.\n", tmp_vs); + + /* updating context2 vertex shader doesn't update other contexts using the same state */ + ID3D11DeviceContext1_VSSetShader(context2, vs, NULL, 0); ID3D11DeviceContext1_VSGetShader(context, &tmp_vs, NULL, NULL); todo_wine ok(tmp_vs == vs2, "Got shader %p, expected %p.\n", tmp_vs, vs2); if (tmp_vs) refcount = ID3D11VertexShader_Release(tmp_vs); else refcount = 0; todo_wine ok(refcount == 1, "Got refcount %u, expected 1.\n", refcount); + ID3D11DeviceContext1_SwapDeviceContextState(context2, tmp_context_state, &context_state2); refcount = ID3DDeviceContextState_Release(tmp_context_state); ok(refcount == 0, "Got refcount %u, expected 1.\n", refcount); @@ -7072,14 +7079,46 @@ static void test_device_context_state(void) todo_wine ok(refcount == 1, "Got refcount %u, expected 1.\n", refcount); todo_wine ok(context_state2 == context_state, "Got unexpected state pointer.\n");
- refcount = ID3D11DeviceContext1_Release(context2); - ok(refcount == 0, "Got refcount %u, expected 0.\n", refcount); - refcount = ID3D11Device1_Release(device2); - ok(refcount == 0, "Got refcount %u, expected 0.\n", refcount); + /* swapping the default state on context2 effectively clears the vertex shader */ + tmp_vs = (ID3D11VertexShader *)0xdeadbeef; + ID3D11DeviceContext1_VSGetShader(context2, &tmp_vs, NULL, NULL); + ok(!tmp_vs, "Got unexpected shader %p.\n", tmp_vs); + + ID3D11DeviceContext1_SwapDeviceContextState(context2, context_state, &tmp_context_state); + ok(!!tmp_context_state, "Failed to get context state.\n"); + refcount = ID3DDeviceContextState_Release(tmp_context_state); + ok(refcount == 0, "Got refcount %u, expected 1.\n", refcount);
+ /* clearing the vertex shader on context doesn't have side effect on context2 */ ID3D11DeviceContext1_VSSetShader(context, NULL, NULL, 0); refcount = ID3D11VertexShader_Release(vs2); ok(refcount == 0, "Got refcount %u, expected 0.\n", refcount); + tmp_vs = (ID3D11VertexShader *)0xdeadbeef; + ID3D11DeviceContext1_VSGetShader(context2, &tmp_vs, NULL, NULL); + todo_wine ok(tmp_vs == vs, "Got shader %p, expected %p.\n", tmp_vs, vs); + if (tmp_vs) refcount = ID3D11VertexShader_Release(tmp_vs); + else refcount = 0; + todo_wine ok(refcount == 1, "Got refcount %u, expected 1.\n", refcount); + + /* even after swapping it again */ + ID3D11DeviceContext1_SwapDeviceContextState(context2, context_state, NULL); + tmp_vs = (ID3D11VertexShader *)0xdeadbeef; + ID3D11DeviceContext1_VSGetShader(context2, &tmp_vs, NULL, NULL); + todo_wine ok(tmp_vs == vs, "Got shader %p, expected %p.\n", tmp_vs, vs); + if (tmp_vs) refcount = ID3D11VertexShader_Release(tmp_vs); + else refcount = 0; + todo_wine ok(refcount == 1, "Got refcount %u, expected 1.\n", refcount); + + /* swapping the initial state on context2 doesn't have side effect on context either */ + ID3D11DeviceContext1_SwapDeviceContextState(context2, previous_context_state, NULL); + tmp_vs = (ID3D11VertexShader *)0xdeadbeef; + ID3D11DeviceContext1_VSGetShader(context, &tmp_vs, NULL, NULL); + ok(!tmp_vs, "Got unexpected shader %p.\n", tmp_vs); + + refcount = ID3D11DeviceContext1_Release(context2); + ok(refcount == 0, "Got refcount %u, expected 0.\n", refcount); + refcount = ID3D11Device1_Release(device2); + ok(refcount == 0, "Got refcount %u, expected 0.\n", refcount);
ID3D11DeviceContext1_SwapDeviceContextState(context, previous_context_state, &tmp_context_state); refcount = ID3DDeviceContextState_Release(previous_context_state);
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/d3d11/tests/d3d11.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 7935dab1332..fbf88891e83 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -7373,6 +7373,7 @@ static void test_device_context_state(void) ID3D11DeviceContext1_CSSetSamplers(context, 0, 1, &sampler); ID3D11DeviceContext1_CSSetShader(context, cs, NULL, 0); ID3D11DeviceContext1_CSSetShaderResources(context, 0, 1, &srv); + ID3D11DeviceContext1_CSSetUnorderedAccessViews(context, 0, 1, &uav, NULL);
tmp_cb = (ID3D11Buffer *)0xdeadbeef; ID3D11DeviceContext1_CSGetConstantBuffers(context, 0, 1, &tmp_cb);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=84924
Your paranoid android.
=== w1064v1809 (32 bit report) ===
d3d11: d3d11.c:5804: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5805: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5806: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5809: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5810: Test failed: Got unexpected CPrimitives count: 0.
=== w1064 (32 bit report) ===
d3d11: d3d11.c:5651: Test failed: Got unexpected query result 0x0000000000000000. d3d11.c:5804: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5805: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5806: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5809: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5810: Test failed: Got unexpected CPrimitives count: 0.
=== w10pro64 (32 bit report) ===
d3d11: d3d11.c:5651: Test failed: Got unexpected query result 0x0000000000000000. d3d11.c:5804: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5805: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5806: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5809: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5810: Test failed: Got unexpected CPrimitives count: 0. d3d11.c:5821: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5822: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5823: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5826: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5827: Test failed: Got unexpected CPrimitives count: 0. d3d11.c:5828: Test failed: Got unexpected PSInvocations count: 0.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/d3d11/tests/d3d11.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index fbf88891e83..2a94621e1e3 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -6597,6 +6597,8 @@ static void test_state_refcounting(const D3D_FEATURE_LEVEL feature_level)
static void test_device_context_state(void) { + static const GUID test_guid = + {0xfdb37466, 0x428f, 0x4edf, {0xa3, 0x7f, 0x9b, 0x1d, 0xf4, 0x88, 0xc5, 0xfc}}; #if 0 float4 main(float4 pos : POSITION) : POSITION { @@ -6781,7 +6783,9 @@ static void test_device_context_state(void) ID3D11Device1 *device, *device2; struct vec4 constant; ID3D11Buffer *cb, *srvb, *uavb, *tmp_cb; + DWORD data_size; ULONG refcount; + char data[64]; HRESULT hr;
if (!(d3d11_device = create_device(NULL))) @@ -6936,6 +6940,19 @@ static void test_device_context_state(void) refcount = get_refcount(vs); todo_wine ok(refcount == 1, "Got refcount %u, expected 1.\n", refcount);
+ hr = ID3DDeviceContextState_SetPrivateData(context_state, &test_guid, sizeof(constant), &constant); + ok(hr == S_OK, "Failed to set private data, hr %#x.\n", hr); + refcount = ID3DDeviceContextState_Release(context_state); + ok(!refcount, "Got refcount %u, expected 0.\n", refcount); + ID3D11DeviceContext1_SwapDeviceContextState(context, previous_context_state, &context_state); + data_size = sizeof(data); + memset(data, 0xa5, sizeof(data)); + hr = ID3DDeviceContextState_GetPrivateData(context_state, &test_guid, &data_size, data); + todo_wine ok(hr == S_OK, "Failed to get private data, hr %#x.\n", hr); + todo_wine ok(data_size == sizeof(constant), "Got private data size %x, expected %x.\n", data_size, sizeof(constant)); + todo_wine ok(!memcmp(data, &constant, sizeof(constant)), "Got unexpected private data.\n"); + ID3D11DeviceContext1_SwapDeviceContextState(context, context_state, NULL); + context_type = ID3D11DeviceContext1_GetType(context); ok(context_type == D3D11_DEVICE_CONTEXT_IMMEDIATE, "Unexpected context type %u.\n", context_type);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=84925
Your paranoid android.
=== w10pro64 (32 bit report) ===
d3d11: d3d11.c:5651: Test failed: Got unexpected query result 0x0000000000000000.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/d3d11/tests/d3d11.c | 129 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 128 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 2a94621e1e3..3ea65a218a7 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -6599,6 +6599,10 @@ static void test_device_context_state(void) { static const GUID test_guid = {0xfdb37466, 0x428f, 0x4edf, {0xa3, 0x7f, 0x9b, 0x1d, 0xf4, 0x88, 0xc5, 0xfc}}; + static const D3D11_INPUT_ELEMENT_DESC layout_desc[] = + { + {"POSITION", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0}, + }; #if 0 float4 main(float4 pos : POSITION) : POSITION { @@ -6764,6 +6768,8 @@ static void test_device_context_state(void) };
ID3DDeviceContextState *context_state, *previous_context_state, *tmp_context_state, *context_state2; + ID3D11Buffer *cb, *srvb, *uavb, *ib, *vb, *tmp_cb, *tmp_ib, *tmp_vb; + UINT ib_offset, vb_offset, vb_stride, offset, stride; ID3D11SamplerState *sampler, *tmp_sampler; D3D11_UNORDERED_ACCESS_VIEW_DESC uav_desc; D3D11_SHADER_RESOURCE_VIEW_DESC srv_desc; @@ -6771,6 +6777,7 @@ static void test_device_context_state(void) ID3D11ShaderResourceView *tmp_srv, *srv; D3D11_DEVICE_CONTEXT_TYPE context_type; ID3D11DeviceContext1 *context = NULL, *context2; + enum D3D_PRIMITIVE_TOPOLOGY topo; D3D11_SAMPLER_DESC sampler_desc; D3D_FEATURE_LEVEL feature_level; ID3D11GeometryShader *tmp_gs, *gs; @@ -6781,8 +6788,9 @@ static void test_device_context_state(void) ID3D11HullShader *tmp_hs, *hs; ID3D11Device *d3d11_device, *d3d11_device2; ID3D11Device1 *device, *device2; + ID3D11InputLayout *il, *tmp_il; + enum DXGI_FORMAT format; struct vec4 constant; - ID3D11Buffer *cb, *srvb, *uavb, *tmp_cb; DWORD data_size; ULONG refcount; char data[64]; @@ -6849,6 +6857,8 @@ static void test_device_context_state(void) cb = create_buffer((ID3D11Device *)device, D3D11_BIND_CONSTANT_BUFFER, sizeof(constant), NULL); srvb = create_buffer((ID3D11Device *)device, D3D11_BIND_SHADER_RESOURCE, 1024, NULL); uavb = create_buffer((ID3D11Device *)device, D3D11_BIND_UNORDERED_ACCESS, 1024, NULL); + ib = create_buffer((ID3D11Device *)device, D3D11_BIND_INDEX_BUFFER, 1024, NULL); + vb = create_buffer((ID3D11Device *)device, D3D11_BIND_VERTEX_BUFFER, 1024, NULL);
hr = ID3D11Device1_CreateVertexShader(device, simple_vs, sizeof(simple_vs), NULL, &vs); ok(SUCCEEDED(hr), "Failed to create vertex shader, hr %#x.\n", hr); @@ -6897,6 +6907,14 @@ static void test_device_context_state(void) ok(hr == S_OK, "Failed to create unordered access view, hr %#x.\n", hr); ID3D11Buffer_Release(uavb);
+ hr = ID3D11Device1_CreateInputLayout(device, layout_desc, ARRAY_SIZE(layout_desc), + simple_vs, sizeof(simple_vs), &il); + ok(SUCCEEDED(hr), "Failed to create input layout, hr %#x.\n", hr); + + ib_offset = 16; + vb_offset = 16; + vb_stride = 16; + ID3D11DeviceContext1_VSSetConstantBuffers(context, 0, 1, &cb); ID3D11DeviceContext1_VSSetSamplers(context, 0, 1, &sampler); ID3D11DeviceContext1_VSSetShader(context, vs, NULL, 0); @@ -6930,6 +6948,11 @@ static void test_device_context_state(void) ID3D11DeviceContext1_CSSetShaderResources(context, 0, 1, &srv); ID3D11DeviceContext1_CSSetUnorderedAccessViews(context, 0, 1, &uav, NULL);
+ ID3D11DeviceContext1_IASetPrimitiveTopology(context, D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); + ID3D11DeviceContext1_IASetInputLayout(context, il); + ID3D11DeviceContext1_IASetIndexBuffer(context, ib, DXGI_FORMAT_R32_UINT, ib_offset); + ID3D11DeviceContext1_IASetVertexBuffers(context, 0, 1, &vb, &vb_stride, &vb_offset); + previous_context_state = (ID3DDeviceContextState *)0xdeadbeef; ID3D11DeviceContext1_SwapDeviceContextState(context, NULL, &previous_context_state); todo_wine ok(previous_context_state == NULL, "Got unexpected state pointer.\n"); @@ -7050,6 +7073,30 @@ static void test_device_context_state(void) todo_wine ok(!tmp_uav, "Got unexpected uav %p.\n", tmp_uav); if (tmp_uav) ID3D11UnorderedAccessView_Release(tmp_uav);
+ topo = 0xdeadbeef; + ID3D11DeviceContext1_IAGetPrimitiveTopology(context, &topo); + todo_wine ok(topo == D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED, "Got unexpected topology %#x.\n", topo); + tmp_il = (ID3D11InputLayout *)0xdeadbeef; + ID3D11DeviceContext1_IAGetInputLayout(context, &tmp_il); + todo_wine ok(!tmp_il, "Got unexpected input layout %p.\n", tmp_il); + if (tmp_il) ID3D11InputLayout_Release(tmp_il); + tmp_ib = (ID3D11Buffer *)0xdeadbeef; + format = 0xdeadbeef; + offset = 0xdeadbeef; + ID3D11DeviceContext1_IAGetIndexBuffer(context, &tmp_ib, &format, &offset); + todo_wine ok(!tmp_ib, "Got unexpected input buffer %p.\n", tmp_ib); + if (tmp_ib) ID3D11Buffer_Release(tmp_ib); + todo_wine ok(format == DXGI_FORMAT_UNKNOWN, "Got unexpected input buffer format %#x.\n", format); + todo_wine ok(offset == 0, "Got unexpected input buffer offset %#x.\n", offset); + tmp_vb = (ID3D11Buffer *)0xdeadbeef; + stride = 0xdeadbeef; + offset = 0xdeadbeef; + ID3D11DeviceContext1_IAGetVertexBuffers(context, 0, 1, &tmp_vb, &stride, &offset); + todo_wine ok(!tmp_vb, "Got unexpected vertex buffer %p.\n", tmp_vb); + if (tmp_vb) ID3D11Buffer_Release(tmp_vb); + todo_wine ok(stride == 0, "Got unexpected vertex buffer stride %#x.\n", stride); + todo_wine ok(offset == 0, "Got unexpected vertex buffer offset %#x.\n", offset); + /* updating the device context should also update the device context state */ hr = ID3D11Device1_CreateVertexShader(device, simple_vs, sizeof(simple_vs), NULL, &vs2); ok(SUCCEEDED(hr), "Failed to create vertex shader, hr %#x.\n", hr); @@ -7256,6 +7303,30 @@ static void test_device_context_state(void) ok(tmp_srv == srv, "Got srv %p, expected %p.\n", tmp_srv, srv); ID3D11ShaderResourceView_Release(tmp_srv);
+ topo = 0xdeadbeef; + ID3D11DeviceContext1_IAGetPrimitiveTopology(context, &topo); + ok(topo == D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP, "Got topology %#x, expected %#x.\n", topo, D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); + tmp_il = (ID3D11InputLayout *)0xdeadbeef; + ID3D11DeviceContext1_IAGetInputLayout(context, &tmp_il); + ok(tmp_il == il, "Got input layout %p, expected %p.\n", tmp_il, il); + ID3D11InputLayout_Release(tmp_il); + tmp_ib = (ID3D11Buffer *)0xdeadbeef; + format = 0xdeadbeef; + offset = 0xdeadbeef; + ID3D11DeviceContext1_IAGetIndexBuffer(context, &tmp_ib, &format, &offset); + ok(tmp_ib == ib, "Got input buffer %p, expected %p.\n", tmp_ib, ib); + ID3D11Buffer_Release(tmp_ib); + ok(format == DXGI_FORMAT_R32_UINT, "Got input buffer format %#x, expected %#x.\n", format, DXGI_FORMAT_R32_UINT); + ok(offset == 16, "Got input buffer offset %#x, expected 16.\n", offset); + tmp_vb = (ID3D11Buffer *)0xdeadbeef; + stride = 0xdeadbeef; + offset = 0xdeadbeef; + ID3D11DeviceContext1_IAGetVertexBuffers(context, 0, 1, &tmp_vb, &stride, &offset); + ok(tmp_vb == vb, "Got vertex buffer %p, expected %p.\n", tmp_vb, vb); + ID3D11Buffer_Release(tmp_vb); + ok(stride == 16, "Got vertex buffer stride %#x, expected 16.\n", stride); + ok(offset == 16, "Got vertex buffer offset %#x, expected 16.\n", offset); + 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); @@ -7413,6 +7484,35 @@ static void test_device_context_state(void) todo_wine ok(!tmp_uav, "Got unexpected uav %p.\n", tmp_uav); if (tmp_uav && tmp_uav != (ID3D11UnorderedAccessView *)0xdeadbeef) ID3D11UnorderedAccessView_Release(tmp_uav);
+ ID3D11DeviceContext1_IASetPrimitiveTopology(context, D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); + ID3D11DeviceContext1_IASetInputLayout(context, il); + ID3D11DeviceContext1_IASetIndexBuffer(context, ib, DXGI_FORMAT_R32_UINT, ib_offset); + ID3D11DeviceContext1_IASetVertexBuffers(context, 0, 1, &vb, &vb_stride, &vb_offset); + + topo = 0xdeadbeef; + ID3D11DeviceContext1_IAGetPrimitiveTopology(context, &topo); + todo_wine ok(topo == D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED, "Got unexpected topology %#x.\n", topo); + tmp_il = (ID3D11InputLayout *)0xdeadbeef; + ID3D11DeviceContext1_IAGetInputLayout(context, &tmp_il); + todo_wine ok(!tmp_il, "Got unexpected input layout %p.\n", tmp_il); + if (tmp_il) ID3D11InputLayout_Release(tmp_il); + tmp_ib = (ID3D11Buffer *)0xdeadbeef; + format = 0xdeadbeef; + offset = 0xdeadbeef; + ID3D11DeviceContext1_IAGetIndexBuffer(context, &tmp_ib, &format, &offset); + todo_wine ok(!tmp_ib, "Got unexpected input buffer %p.\n", tmp_ib); + if (tmp_ib) ID3D11Buffer_Release(tmp_ib); + todo_wine ok(format == DXGI_FORMAT_UNKNOWN, "Got unexpected input buffer format %#x.\n", format); + todo_wine ok(offset == 0, "Got unexpected input buffer offset %#x.\n", offset); + tmp_vb = (ID3D11Buffer *)0xdeadbeef; + stride = 0xdeadbeef; + offset = 0xdeadbeef; + ID3D11DeviceContext1_IAGetVertexBuffers(context, 0, 1, &tmp_vb, &stride, &offset); + todo_wine ok(!tmp_vb, "Got unexpected vertex buffer %p.\n", tmp_vb); + if (tmp_vb) ID3D11Buffer_Release(tmp_vb); + todo_wine ok(stride == 0, "Got unexpected vertex buffer stride %#x.\n", stride); + todo_wine ok(offset == 0, "Got unexpected vertex buffer offset %#x.\n", offset); + check_interface(device, &IID_ID3D10Device, TRUE, FALSE); check_interface(device, &IID_ID3D10Device1, TRUE, FALSE);
@@ -7531,9 +7631,36 @@ static void test_device_context_state(void) ok(tmp_uav == uav, "Got uav %p, expected %p.\n", tmp_uav, uav); ID3D11UnorderedAccessView_Release(tmp_uav);
+ topo = 0xdeadbeef; + ID3D11DeviceContext1_IAGetPrimitiveTopology(context, &topo); + ok(topo == D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP, "Got topology %#x, expected %#x.\n", topo, D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); + tmp_il = (ID3D11InputLayout *)0xdeadbeef; + ID3D11DeviceContext1_IAGetInputLayout(context, &tmp_il); + ok(tmp_il == il, "Got input layout %p, expected %p.\n", tmp_il, il); + ID3D11InputLayout_Release(tmp_il); + tmp_ib = (ID3D11Buffer *)0xdeadbeef; + format = 0xdeadbeef; + offset = 0xdeadbeef; + ID3D11DeviceContext1_IAGetIndexBuffer(context, &tmp_ib, &format, &offset); + ok(tmp_ib == ib, "Got input buffer %p, expected %p.\n", tmp_ib, ib); + ID3D11Buffer_Release(tmp_ib); + ok(format == DXGI_FORMAT_R32_UINT, "Got input buffer format %#x, expected %#x.\n", format, DXGI_FORMAT_R32_UINT); + ok(offset == 16, "Got input buffer offset %#x, expected 16.\n", offset); + tmp_vb = (ID3D11Buffer *)0xdeadbeef; + stride = 0xdeadbeef; + offset = 0xdeadbeef; + ID3D11DeviceContext1_IAGetVertexBuffers(context, 0, 1, &tmp_vb, &stride, &offset); + ok(tmp_vb == vb, "Got vertex buffer %p, expected %p.\n", tmp_vb, vb); + ID3D11Buffer_Release(tmp_vb); + ok(stride == 16, "Got vertex buffer stride %#x, expected 16.\n", stride); + ok(offset == 16, "Got vertex buffer offset %#x, expected 16.\n", offset); + check_interface(device, &IID_ID3D10Device, TRUE, FALSE); check_interface(device, &IID_ID3D10Device1, TRUE, FALSE);
+ ID3D11InputLayout_Release(il); + ID3D11Buffer_Release(ib); + ID3D11Buffer_Release(vb); if (cs) ID3D11ComputeShader_Release(cs); if (ds) ID3D11DomainShader_Release(ds); if (hs) ID3D11HullShader_Release(hs);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=84926
Your paranoid android.
=== w8 (32 bit report) ===
d3d11: d3d11.c:6134: Test failed: Got unexpected NumPrimitivesWritten: 3986790517. d3d11.c:6137: Test failed: Got unexpected PrimitivesStorageNeeded: 3210968202.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/d3d11/tests/d3d11.c | 214 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 204 insertions(+), 10 deletions(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 3ea65a218a7..29f8f124686 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -6603,6 +6603,8 @@ static void test_device_context_state(void) { {"POSITION", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0}, }; + static const float custom_blend_factor[] = {0.1f, 0.2f, 0.3f, 0.4f}; + static const float default_blend_factor[] = {1.0f, 1.0f, 1.0f, 1.0f}; #if 0 float4 main(float4 pos : POSITION) : POSITION { @@ -6768,28 +6770,37 @@ static void test_device_context_state(void) };
ID3DDeviceContextState *context_state, *previous_context_state, *tmp_context_state, *context_state2; + UINT ib_offset, vb_offset, vb_stride, offset, stride, sample_mask, stencil_ref; ID3D11Buffer *cb, *srvb, *uavb, *ib, *vb, *tmp_cb, *tmp_ib, *tmp_vb; - UINT ib_offset, vb_offset, vb_stride, offset, stride; + ID3D11UnorderedAccessView *tmp_uav, *uav, *ps_uav; + ID3D11Device *d3d11_device, *d3d11_device2; ID3D11SamplerState *sampler, *tmp_sampler; D3D11_UNORDERED_ACCESS_VIEW_DESC uav_desc; D3D11_SHADER_RESOURCE_VIEW_DESC srv_desc; - ID3D11UnorderedAccessView *tmp_uav, *uav; + ID3D11DeviceContext1 *context, *context2; ID3D11ShaderResourceView *tmp_srv, *srv; D3D11_DEVICE_CONTEXT_TYPE context_type; - ID3D11DeviceContext1 *context = NULL, *context2; - enum D3D_PRIMITIVE_TOPOLOGY topo; - D3D11_SAMPLER_DESC sampler_desc; - D3D_FEATURE_LEVEL feature_level; + ID3D11DepthStencilState *tmp_dss, *dss; + ID3D11RenderTargetView *tmp_rtv, *rtv; + ID3D11DepthStencilView *tmp_dsv, *dsv; + ID3D11VertexShader *tmp_vs, *vs, *vs2; + D3D11_TEXTURE2D_DESC texture_desc; ID3D11GeometryShader *tmp_gs, *gs; + enum D3D_PRIMITIVE_TOPOLOGY topo; ID3D11ComputeShader *tmp_cs, *cs; + D3D11_DEPTH_STENCIL_DESC ds_desc; ID3D11DomainShader *tmp_ds, *ds; - ID3D11VertexShader *tmp_vs, *vs, *vs2; - ID3D11PixelShader *tmp_ps, *ps; - ID3D11HullShader *tmp_hs, *hs; - ID3D11Device *d3d11_device, *d3d11_device2; + D3D11_SAMPLER_DESC sampler_desc; + D3D_FEATURE_LEVEL feature_level; ID3D11Device1 *device, *device2; ID3D11InputLayout *il, *tmp_il; + ID3D11PixelShader *tmp_ps, *ps; + ID3D11BlendState *tmp_bs, *bs; + ID3D11HullShader *tmp_hs, *hs; + D3D11_BLEND_DESC blend_desc; + ID3D11Texture2D *texture; enum DXGI_FORMAT format; + float blend_factor[4]; struct vec4 constant; DWORD data_size; ULONG refcount; @@ -6814,6 +6825,7 @@ static void test_device_context_state(void) check_interface(device, &IID_ID3D10Device1, FALSE, FALSE);
feature_level = ID3D11Device1_GetFeatureLevel(device); + context = NULL; ID3D11Device1_GetImmediateContext1(device, &context); ok(!!context, "Failed to get immediate context.\n");
@@ -6907,6 +6919,11 @@ static void test_device_context_state(void) ok(hr == S_OK, "Failed to create unordered access view, hr %#x.\n", hr); ID3D11Buffer_Release(uavb);
+ uavb = create_buffer((ID3D11Device *)device, D3D11_BIND_UNORDERED_ACCESS, 1024, NULL); + hr = ID3D11Device1_CreateUnorderedAccessView(device, (ID3D11Resource *)uavb, &uav_desc, &ps_uav); + ok(hr == S_OK, "Failed to create unordered access view, hr %#x.\n", hr); + ID3D11Buffer_Release(uavb); + hr = ID3D11Device1_CreateInputLayout(device, layout_desc, ARRAY_SIZE(layout_desc), simple_vs, sizeof(simple_vs), &il); ok(SUCCEEDED(hr), "Failed to create input layout, hr %#x.\n", hr); @@ -6915,6 +6932,60 @@ static void test_device_context_state(void) vb_offset = 16; vb_stride = 16;
+ texture_desc.Width = 512; + texture_desc.Height = 512; + texture_desc.MipLevels = 1; + texture_desc.ArraySize = 1; + texture_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + texture_desc.SampleDesc.Count = 1; + texture_desc.SampleDesc.Quality = 0; + texture_desc.Usage = D3D11_USAGE_DEFAULT; + texture_desc.BindFlags = D3D11_BIND_RENDER_TARGET; + texture_desc.CPUAccessFlags = 0; + texture_desc.MiscFlags = 0; + hr = ID3D11Device1_CreateTexture2D(device, &texture_desc, NULL, &texture); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + hr = ID3D11Device1_CreateRenderTargetView(device, (ID3D11Resource *)texture, NULL, &rtv); + ok(SUCCEEDED(hr), "Failed to create rendertarget view, hr %#x.\n", hr); + ID3D11Texture2D_Release(texture); + + texture_desc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT; + texture_desc.BindFlags = D3D11_BIND_DEPTH_STENCIL; + hr = ID3D11Device1_CreateTexture2D(device, &texture_desc, NULL, &texture); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + hr = ID3D11Device1_CreateDepthStencilView(device, (ID3D11Resource *)texture, NULL, &dsv); + ok(SUCCEEDED(hr), "Failed to create depth/stencil view, hr %#x.\n", hr); + ID3D11Texture2D_Release(texture); + + memset(&blend_desc, 0, sizeof(blend_desc)); + blend_desc.RenderTarget[0].BlendEnable = TRUE; + blend_desc.RenderTarget[0].SrcBlend = D3D11_BLEND_SRC_ALPHA; + blend_desc.RenderTarget[0].DestBlend = D3D11_BLEND_INV_SRC_ALPHA; + blend_desc.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD; + blend_desc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_SRC_ALPHA; + blend_desc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_INV_SRC_ALPHA; + blend_desc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD; + blend_desc.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL; + hr = ID3D11Device1_CreateBlendState(device, &blend_desc, &bs); + ok(SUCCEEDED(hr), "Failed to create blend state, hr %#x.\n", hr); + + ds_desc.DepthEnable = TRUE; + ds_desc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL; + ds_desc.DepthFunc = D3D11_COMPARISON_LESS; + ds_desc.StencilEnable = FALSE; + ds_desc.StencilReadMask = D3D11_DEFAULT_STENCIL_READ_MASK; + ds_desc.StencilWriteMask = D3D11_DEFAULT_STENCIL_WRITE_MASK; + ds_desc.FrontFace.StencilFailOp = D3D11_STENCIL_OP_KEEP; + ds_desc.FrontFace.StencilDepthFailOp = D3D11_STENCIL_OP_KEEP; + ds_desc.FrontFace.StencilPassOp = D3D11_STENCIL_OP_KEEP; + ds_desc.FrontFace.StencilFunc = D3D11_COMPARISON_ALWAYS; + ds_desc.BackFace.StencilFailOp = D3D11_STENCIL_OP_KEEP; + ds_desc.BackFace.StencilDepthFailOp = D3D11_STENCIL_OP_KEEP; + ds_desc.BackFace.StencilPassOp = D3D11_STENCIL_OP_KEEP; + ds_desc.BackFace.StencilFunc = D3D11_COMPARISON_ALWAYS; + hr = ID3D11Device1_CreateDepthStencilState(device, &ds_desc, &dss); + ok(SUCCEEDED(hr), "Failed to create depthstencil state, hr %#x.\n", hr); + ID3D11DeviceContext1_VSSetConstantBuffers(context, 0, 1, &cb); ID3D11DeviceContext1_VSSetSamplers(context, 0, 1, &sampler); ID3D11DeviceContext1_VSSetShader(context, vs, NULL, 0); @@ -6953,6 +7024,10 @@ static void test_device_context_state(void) ID3D11DeviceContext1_IASetIndexBuffer(context, ib, DXGI_FORMAT_R32_UINT, ib_offset); ID3D11DeviceContext1_IASetVertexBuffers(context, 0, 1, &vb, &vb_stride, &vb_offset);
+ ID3D11DeviceContext1_OMSetBlendState(context, bs, custom_blend_factor, 0xff00ff00); + ID3D11DeviceContext1_OMSetDepthStencilState(context, dss, 3); + ID3D11DeviceContext1_OMSetRenderTargetsAndUnorderedAccessViews(context, 1, &rtv, dsv, 1, 1, &ps_uav, NULL); + previous_context_state = (ID3DDeviceContextState *)0xdeadbeef; ID3D11DeviceContext1_SwapDeviceContextState(context, NULL, &previous_context_state); todo_wine ok(previous_context_state == NULL, "Got unexpected state pointer.\n"); @@ -7097,6 +7172,33 @@ static void test_device_context_state(void) todo_wine ok(stride == 0, "Got unexpected vertex buffer stride %#x.\n", stride); todo_wine ok(offset == 0, "Got unexpected vertex buffer offset %#x.\n", offset);
+ tmp_rtv = (ID3D11RenderTargetView *)0xdeadbeef; + tmp_dsv = (ID3D11DepthStencilView *)0xdeadbeef; + tmp_uav = (ID3D11UnorderedAccessView *)0xdeadbeef; + ID3D11DeviceContext1_OMGetRenderTargetsAndUnorderedAccessViews(context, 1, &tmp_rtv, &tmp_dsv, 1, 1, &tmp_uav); + todo_wine ok(!tmp_rtv, "Got unexpected rendertarget view %p.\n", tmp_rtv); + if (tmp_rtv) ID3D11RenderTargetView_Release(tmp_rtv); + todo_wine ok(!tmp_dsv, "Got unexpected depth/stencil view %p.\n", tmp_dsv); + if (tmp_dsv) ID3D11DepthStencilView_Release(tmp_dsv); + todo_wine ok(!tmp_uav, "Got unexpected unordered access view %p.\n", tmp_uav); + if (tmp_uav) ID3D11UnorderedAccessView_Release(tmp_uav); + tmp_bs = (ID3D11BlendState *)0xdeadbeef; + memset(blend_factor, 0xcd, sizeof(blend_factor)); + sample_mask = 0xdeadbeef; + ID3D11DeviceContext1_OMGetBlendState(context, &tmp_bs, blend_factor, &sample_mask); + todo_wine ok(!tmp_bs, "Got unexpected blend state %p.\n", tmp_bs); + if (tmp_bs) ID3D11BlendState_Release(tmp_bs); + todo_wine ok(!memcmp(blend_factor, default_blend_factor, sizeof(blend_factor)), + "Got unexpected blend factor %f,%f,%f,%f.\n", + blend_factor[0], blend_factor[1], blend_factor[2], blend_factor[3]); + todo_wine ok(sample_mask == ~0, "Got unexpected sample mask %#x.\n", sample_mask); + tmp_dss = (ID3D11DepthStencilState *)0xdeadbeef; + stencil_ref = 0xdeadbeef; + ID3D11DeviceContext1_OMGetDepthStencilState(context, &tmp_dss, &stencil_ref); + todo_wine ok(!tmp_dss, "Got unexpected depth/stencil state %p.\n", tmp_dss); + if (tmp_dss) ID3D11DepthStencilState_Release(tmp_dss); + todo_wine ok(stencil_ref == 0, "Got unexpected stencil ref %#x.\n", stencil_ref); + /* updating the device context should also update the device context state */ hr = ID3D11Device1_CreateVertexShader(device, simple_vs, sizeof(simple_vs), NULL, &vs2); ok(SUCCEEDED(hr), "Failed to create vertex shader, hr %#x.\n", hr); @@ -7327,6 +7429,34 @@ static void test_device_context_state(void) ok(stride == 16, "Got vertex buffer stride %#x, expected 16.\n", stride); ok(offset == 16, "Got vertex buffer offset %#x, expected 16.\n", offset);
+ tmp_rtv = (ID3D11RenderTargetView *)0xdeadbeef; + tmp_dsv = (ID3D11DepthStencilView *)0xdeadbeef; + tmp_uav = (ID3D11UnorderedAccessView *)0xdeadbeef; + ID3D11DeviceContext1_OMGetRenderTargetsAndUnorderedAccessViews(context, 1, &tmp_rtv, &tmp_dsv, 1, 1, &tmp_uav); + ok(tmp_rtv == rtv, "Got rendertarget view %p, expected %p.\n", tmp_rtv, rtv); + ID3D11RenderTargetView_Release(tmp_rtv); + ok(tmp_dsv == dsv, "Got depth/stencil view %p, expected %p.\n", tmp_dsv, dsv); + ID3D11DepthStencilView_Release(tmp_dsv); + ok(tmp_uav == ps_uav, "Got unordered access view %p, expected %p.\n", tmp_uav, ps_uav); + ID3D11UnorderedAccessView_Release(tmp_uav); + tmp_bs = (ID3D11BlendState *)0xdeadbeef; + memset(blend_factor, 0xcd, sizeof(blend_factor)); + sample_mask = 0xdeadbeef; + ID3D11DeviceContext1_OMGetBlendState(context, &tmp_bs, blend_factor, &sample_mask); + ok(tmp_bs == bs, "Got blend state %p, expected %p.\n", tmp_bs, bs); + ID3D11BlendState_Release(tmp_bs); + ok(!memcmp(blend_factor, custom_blend_factor, sizeof(blend_factor)), + "Got blend factor %f,%f,%f,%f, expected %f,%f,%f,%f.\n", + blend_factor[0], blend_factor[1], blend_factor[2], blend_factor[3], + custom_blend_factor[0], custom_blend_factor[1], custom_blend_factor[2], custom_blend_factor[3]); + ok(sample_mask == 0xff00ff00, "Got sample mask %#x, expected %#x.\n", sample_mask, 0xff00ff00); + tmp_dss = (ID3D11DepthStencilState *)0xdeadbeef; + stencil_ref = 0xdeadbeef; + ID3D11DeviceContext1_OMGetDepthStencilState(context, &tmp_dss, &stencil_ref); + ok(tmp_dss == dss, "Got depth/stencil state %p, expected %p.\n", tmp_dss, dss); + ID3D11DepthStencilState_Release(tmp_dss); + ok(stencil_ref == 3, "Got stencil ref %#x, expected 3.\n", stencil_ref); + 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); @@ -7513,6 +7643,37 @@ static void test_device_context_state(void) todo_wine ok(stride == 0, "Got unexpected vertex buffer stride %#x.\n", stride); todo_wine ok(offset == 0, "Got unexpected vertex buffer offset %#x.\n", offset);
+ ID3D11DeviceContext1_OMSetBlendState(context, bs, custom_blend_factor, 0xff00ff00); + ID3D11DeviceContext1_OMSetDepthStencilState(context, dss, 3); + ID3D11DeviceContext1_OMSetRenderTargetsAndUnorderedAccessViews(context, 1, &rtv, dsv, 1, 1, &ps_uav, NULL); + + tmp_rtv = (ID3D11RenderTargetView *)0xdeadbeef; + tmp_dsv = (ID3D11DepthStencilView *)0xdeadbeef; + tmp_uav = (ID3D11UnorderedAccessView *)0xdeadbeef; + ID3D11DeviceContext1_OMGetRenderTargetsAndUnorderedAccessViews(context, 1, &tmp_rtv, &tmp_dsv, 1, 1, &tmp_uav); + todo_wine ok(!tmp_rtv, "Got unexpected rendertarget view %p.\n", tmp_rtv); + if (tmp_rtv) ID3D11RenderTargetView_Release(tmp_rtv); + todo_wine ok(!tmp_dsv, "Got unexpected depth/stencil view %p.\n", tmp_dsv); + if (tmp_dsv) ID3D11DepthStencilView_Release(tmp_dsv); + todo_wine ok(!tmp_uav, "Got unexpected unordered access view %p.\n", tmp_uav); + if (tmp_uav) ID3D11UnorderedAccessView_Release(tmp_uav); + tmp_bs = (ID3D11BlendState *)0xdeadbeef; + memset(blend_factor, 0xcd, sizeof(blend_factor)); + sample_mask = 0xdeadbeef; + ID3D11DeviceContext1_OMGetBlendState(context, &tmp_bs, blend_factor, &sample_mask); + todo_wine ok(!tmp_bs, "Got unexpected blend state %p.\n", tmp_bs); + if (tmp_bs) ID3D11BlendState_Release(tmp_bs); + todo_wine ok(!memcmp(blend_factor, default_blend_factor, sizeof(blend_factor)), + "Got unexpected blend factor %f,%f,%f,%f.\n", + blend_factor[0], blend_factor[1], blend_factor[2], blend_factor[3]); + todo_wine ok(sample_mask == ~0, "Got unexpected sample mask %#x.\n", sample_mask); + tmp_dss = (ID3D11DepthStencilState *)0xdeadbeef; + stencil_ref = 0xdeadbeef; + ID3D11DeviceContext1_OMGetDepthStencilState(context, &tmp_dss, &stencil_ref); + todo_wine ok(!tmp_dss, "Got unexpected depth/stencil state %p.\n", tmp_dss); + if (tmp_dss) ID3D11DepthStencilState_Release(tmp_dss); + todo_wine ok(stencil_ref == 0, "Got unexpected stencil ref %#x.\n", stencil_ref); + check_interface(device, &IID_ID3D10Device, TRUE, FALSE); check_interface(device, &IID_ID3D10Device1, TRUE, FALSE);
@@ -7655,9 +7816,42 @@ static void test_device_context_state(void) ok(stride == 16, "Got vertex buffer stride %#x, expected 16.\n", stride); ok(offset == 16, "Got vertex buffer offset %#x, expected 16.\n", offset);
+ tmp_rtv = (ID3D11RenderTargetView *)0xdeadbeef; + tmp_dsv = (ID3D11DepthStencilView *)0xdeadbeef; + tmp_uav = (ID3D11UnorderedAccessView *)0xdeadbeef; + ID3D11DeviceContext1_OMGetRenderTargetsAndUnorderedAccessViews(context, 1, &tmp_rtv, &tmp_dsv, 1, 1, &tmp_uav); + ok(tmp_rtv == rtv, "Got rendertarget view %p, expected %p.\n", tmp_rtv, rtv); + ID3D11RenderTargetView_Release(tmp_rtv); + ok(tmp_dsv == dsv, "Got depth/stencil view %p, expected %p.\n", tmp_dsv, dsv); + ID3D11DepthStencilView_Release(tmp_dsv); + ok(tmp_uav == ps_uav, "Got unordered access view %p, expected %p.\n", tmp_uav, ps_uav); + ID3D11UnorderedAccessView_Release(tmp_uav); + tmp_bs = (ID3D11BlendState *)0xdeadbeef; + memset(blend_factor, 0xcd, sizeof(blend_factor)); + sample_mask = 0xdeadbeef; + ID3D11DeviceContext1_OMGetBlendState(context, &tmp_bs, blend_factor, &sample_mask); + ok(tmp_bs == bs, "Got blend state %p, expected %p.\n", tmp_bs, bs); + ID3D11BlendState_Release(tmp_bs); + ok(!memcmp(blend_factor, custom_blend_factor, sizeof(blend_factor)), + "Got blend factor %f,%f,%f,%f, expected %f,%f,%f,%f.\n", + blend_factor[0], blend_factor[1], blend_factor[2], blend_factor[3], + custom_blend_factor[0], custom_blend_factor[1], custom_blend_factor[2], custom_blend_factor[3]); + ok(sample_mask == 0xff00ff00, "Got sample mask %#x, expected %#x.\n", sample_mask, 0xff00ff00); + tmp_dss = (ID3D11DepthStencilState *)0xdeadbeef; + stencil_ref = 0xdeadbeef; + ID3D11DeviceContext1_OMGetDepthStencilState(context, &tmp_dss, &stencil_ref); + ok(tmp_dss == dss, "Got depth/stencil state %p, expected %p.\n", tmp_dss, dss); + ID3D11DepthStencilState_Release(tmp_dss); + ok(stencil_ref == 3, "Got stencil ref %#x, expected 3.\n", stencil_ref); + check_interface(device, &IID_ID3D10Device, TRUE, FALSE); check_interface(device, &IID_ID3D10Device1, TRUE, FALSE);
+ ID3D11BlendState_Release(bs); + ID3D11DepthStencilState_Release(dss); + ID3D11DepthStencilView_Release(dsv); + ID3D11RenderTargetView_Release(rtv); + ID3D11UnorderedAccessView_Release(ps_uav); ID3D11InputLayout_Release(il); ID3D11Buffer_Release(ib); ID3D11Buffer_Release(vb);
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/d3d11/tests/d3d11.c | 103 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 102 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 29f8f124686..63a98f5099a 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -280,6 +280,13 @@ static BOOL compare_color(DWORD c1, DWORD c2, BYTE max_diff) && compare_uint((c1 >> 24) & 0xff, (c2 >> 24) & 0xff, max_diff); }
+static char const *debugstr_viewport(D3D11_VIEWPORT *vp) +{ + if (!vp) return "(null)"; + return wine_dbg_sprintf("{%.8e, %.8e, %.8e, %.8e, %.8e, %.8e}", + vp->TopLeftX, vp->TopLeftY, vp->Width, vp->Height, vp->MinDepth, vp->MaxDepth); +} + struct srv_desc { DXGI_FORMAT format; @@ -6770,7 +6777,7 @@ static void test_device_context_state(void) };
ID3DDeviceContextState *context_state, *previous_context_state, *tmp_context_state, *context_state2; - UINT ib_offset, vb_offset, vb_stride, offset, stride, sample_mask, stencil_ref; + UINT ib_offset, vb_offset, vb_stride, offset, stride, sample_mask, stencil_ref, count; ID3D11Buffer *cb, *srvb, *uavb, *ib, *vb, *tmp_cb, *tmp_ib, *tmp_vb; ID3D11UnorderedAccessView *tmp_uav, *uav, *ps_uav; ID3D11Device *d3d11_device, *d3d11_device2; @@ -6784,6 +6791,7 @@ static void test_device_context_state(void) ID3D11RenderTargetView *tmp_rtv, *rtv; ID3D11DepthStencilView *tmp_dsv, *dsv; ID3D11VertexShader *tmp_vs, *vs, *vs2; + ID3D11RasterizerState *tmp_rs, *rs; D3D11_TEXTURE2D_DESC texture_desc; ID3D11GeometryShader *tmp_gs, *gs; enum D3D_PRIMITIVE_TOPOLOGY topo; @@ -6795,8 +6803,11 @@ static void test_device_context_state(void) ID3D11Device1 *device, *device2; ID3D11InputLayout *il, *tmp_il; ID3D11PixelShader *tmp_ps, *ps; + D3D11_RASTERIZER_DESC rs_desc; ID3D11BlendState *tmp_bs, *bs; ID3D11HullShader *tmp_hs, *hs; + D3D11_VIEWPORT tmp_vp[2], vp; + D3D11_RECT tmp_rect[2], rect; D3D11_BLEND_DESC blend_desc; ID3D11Texture2D *texture; enum DXGI_FORMAT format; @@ -6986,6 +6997,27 @@ static void test_device_context_state(void) hr = ID3D11Device1_CreateDepthStencilState(device, &ds_desc, &dss); ok(SUCCEEDED(hr), "Failed to create depthstencil state, hr %#x.\n", hr);
+ rs_desc.FillMode = D3D11_FILL_SOLID; + rs_desc.CullMode = D3D11_CULL_BACK; + rs_desc.FrontCounterClockwise = FALSE; + rs_desc.DepthBias = 0; + rs_desc.DepthBiasClamp = 0.0f; + rs_desc.SlopeScaledDepthBias = 0.0f; + rs_desc.DepthClipEnable = TRUE; + rs_desc.ScissorEnable = TRUE; + rs_desc.MultisampleEnable = FALSE; + rs_desc.AntialiasedLineEnable = FALSE; + hr = ID3D11Device1_CreateRasterizerState(device, &rs_desc, &rs); + ok(SUCCEEDED(hr), "Failed to create rasterizer state, hr %#x.\n", hr); + + SetRect(&rect, 0, 0, 1, 2); + vp.TopLeftX = 0; + vp.TopLeftY = 0; + vp.Width = 3; + vp.Height = 4; + vp.MinDepth = 0.f; + vp.MaxDepth = 0.01f; + ID3D11DeviceContext1_VSSetConstantBuffers(context, 0, 1, &cb); ID3D11DeviceContext1_VSSetSamplers(context, 0, 1, &sampler); ID3D11DeviceContext1_VSSetShader(context, vs, NULL, 0); @@ -7028,6 +7060,10 @@ static void test_device_context_state(void) ID3D11DeviceContext1_OMSetDepthStencilState(context, dss, 3); ID3D11DeviceContext1_OMSetRenderTargetsAndUnorderedAccessViews(context, 1, &rtv, dsv, 1, 1, &ps_uav, NULL);
+ ID3D11DeviceContext1_RSSetScissorRects(context, 1, &rect); + ID3D11DeviceContext1_RSSetViewports(context, 1, &vp); + ID3D11DeviceContext1_RSSetState(context, rs); + previous_context_state = (ID3DDeviceContextState *)0xdeadbeef; ID3D11DeviceContext1_SwapDeviceContextState(context, NULL, &previous_context_state); todo_wine ok(previous_context_state == NULL, "Got unexpected state pointer.\n"); @@ -7199,6 +7235,19 @@ static void test_device_context_state(void) if (tmp_dss) ID3D11DepthStencilState_Release(tmp_dss); todo_wine ok(stencil_ref == 0, "Got unexpected stencil ref %#x.\n", stencil_ref);
+ tmp_rs = (ID3D11RasterizerState *)0xdeadbeef; + ID3D11DeviceContext1_RSGetState(context, &tmp_rs); + todo_wine ok(!tmp_rs, "Got unexpected rasterizer state %p.\n", tmp_rs); + if (tmp_rs) ID3D11RasterizerState_Release(tmp_rs); + memset(tmp_vp, 0xa5, sizeof(tmp_vp)); + count = 2; + ID3D11DeviceContext1_RSGetViewports(context, &count, tmp_vp); + todo_wine ok(count == 0, "Got unexpected viewport count %u.\n", count); + memset(tmp_rect, 0xa5, sizeof(tmp_rect)); + count = 2; + ID3D11DeviceContext1_RSGetScissorRects(context, &count, tmp_rect); + todo_wine ok(count == 0, "Got unexpected scissor rect count %u.\n", count); + /* updating the device context should also update the device context state */ hr = ID3D11Device1_CreateVertexShader(device, simple_vs, sizeof(simple_vs), NULL, &vs2); ok(SUCCEEDED(hr), "Failed to create vertex shader, hr %#x.\n", hr); @@ -7457,6 +7506,23 @@ static void test_device_context_state(void) ID3D11DepthStencilState_Release(tmp_dss); ok(stencil_ref == 3, "Got stencil ref %#x, expected 3.\n", stencil_ref);
+ tmp_rs = (ID3D11RasterizerState *)0xdeadbeef; + ID3D11DeviceContext1_RSGetState(context, &tmp_rs); + ok(tmp_rs == rs, "Got unexpected rasterizer state %p.\n", tmp_rs); + ID3D11RasterizerState_Release(tmp_rs); + memset(tmp_vp, 0xa5, sizeof(tmp_vp)); + count = 2; + ID3D11DeviceContext1_RSGetViewports(context, &count, tmp_vp); + ok(count == 1, "Got viewport count %u, expected 1.\n", count); + ok(!memcmp(tmp_vp, &vp, sizeof(vp)), "Got viewport %s, expected %s.\n", + debugstr_viewport(tmp_vp), debugstr_viewport(&vp)); + memset(tmp_rect, 0xa5, sizeof(tmp_rect)); + count = 2; + ID3D11DeviceContext1_RSGetScissorRects(context, &count, tmp_rect); + todo_wine ok(count == 1, "Got scissor rect count %u, expected 1.\n", count); + ok(!memcmp(tmp_rect, &rect, sizeof(rect)), "Got scissor rect %s, expected %s.\n", + wine_dbgstr_rect(tmp_rect), wine_dbgstr_rect(&rect)); + 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); @@ -7674,6 +7740,23 @@ static void test_device_context_state(void) if (tmp_dss) ID3D11DepthStencilState_Release(tmp_dss); todo_wine ok(stencil_ref == 0, "Got unexpected stencil ref %#x.\n", stencil_ref);
+ ID3D11DeviceContext1_RSSetScissorRects(context, 1, &rect); + ID3D11DeviceContext1_RSSetViewports(context, 1, &vp); + ID3D11DeviceContext1_RSSetState(context, rs); + + tmp_rs = (ID3D11RasterizerState *)0xdeadbeef; + ID3D11DeviceContext1_RSGetState(context, &tmp_rs); + todo_wine ok(!tmp_rs, "Got unexpected rasterizer state %p.\n", tmp_rs); + if (tmp_rs) ID3D11RasterizerState_Release(tmp_rs); + memset(tmp_vp, 0xa5, sizeof(tmp_vp)); + count = 2; + ID3D11DeviceContext1_RSGetViewports(context, &count, tmp_vp); + todo_wine ok(count == 0, "Got unexpected viewport count %u.\n", count); + memset(tmp_rect, 0xa5, sizeof(tmp_rect)); + count = 2; + ID3D11DeviceContext1_RSGetScissorRects(context, &count, tmp_rect); + todo_wine ok(count == 0, "Got unexpected scissor rect count %u.\n", count); + check_interface(device, &IID_ID3D10Device, TRUE, FALSE); check_interface(device, &IID_ID3D10Device1, TRUE, FALSE);
@@ -7844,9 +7927,27 @@ static void test_device_context_state(void) ID3D11DepthStencilState_Release(tmp_dss); ok(stencil_ref == 3, "Got stencil ref %#x, expected 3.\n", stencil_ref);
+ tmp_rs = (ID3D11RasterizerState *)0xdeadbeef; + ID3D11DeviceContext1_RSGetState(context, &tmp_rs); + ok(tmp_rs == rs, "Got unexpected rasterizer state %p.\n", tmp_rs); + ID3D11RasterizerState_Release(tmp_rs); + memset(tmp_vp, 0xa5, sizeof(tmp_vp)); + count = 2; + ID3D11DeviceContext1_RSGetViewports(context, &count, tmp_vp); + ok(count == 1, "Got viewport count %u, expected 1.\n", count); + ok(!memcmp(tmp_vp, &vp, sizeof(vp)), "Got viewport %s, expected %s.\n", + debugstr_viewport(tmp_vp), debugstr_viewport(&vp)); + memset(tmp_rect, 0xa5, sizeof(tmp_rect)); + count = 2; + ID3D11DeviceContext1_RSGetScissorRects(context, &count, tmp_rect); + todo_wine ok(count == 1, "Got scissor rect count %u, expected 1.\n", count); + ok(!memcmp(tmp_rect, &rect, sizeof(rect)), "Got scissor rect %s, expected %s.\n", + wine_dbgstr_rect(tmp_rect), wine_dbgstr_rect(&rect)); + check_interface(device, &IID_ID3D10Device, TRUE, FALSE); check_interface(device, &IID_ID3D10Device1, TRUE, FALSE);
+ ID3D11RasterizerState_Release(rs); ID3D11BlendState_Release(bs); ID3D11DepthStencilState_Release(dss); ID3D11DepthStencilView_Release(dsv);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=84928
Your paranoid android.
=== w10pro64 (32 bit report) ===
d3d11: d3d11.c:5811: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5812: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5813: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5816: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5817: Test failed: Got unexpected CPrimitives count: 0. d3d11.c:5658: Test failed: Got unexpected query result 0x0000000000000000.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/d3d11/tests/d3d11.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 63a98f5099a..5212776cc59 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -6777,8 +6777,8 @@ static void test_device_context_state(void) };
ID3DDeviceContextState *context_state, *previous_context_state, *tmp_context_state, *context_state2; - UINT ib_offset, vb_offset, vb_stride, offset, stride, sample_mask, stencil_ref, count; - ID3D11Buffer *cb, *srvb, *uavb, *ib, *vb, *tmp_cb, *tmp_ib, *tmp_vb; + UINT ib_offset, vb_offset, vb_stride, so_offset, offset, stride, sample_mask, stencil_ref, count; + ID3D11Buffer *cb, *srvb, *uavb, *ib, *vb, *sob, *tmp_cb, *tmp_ib, *tmp_vb, *tmp_sob; ID3D11UnorderedAccessView *tmp_uav, *uav, *ps_uav; ID3D11Device *d3d11_device, *d3d11_device2; ID3D11SamplerState *sampler, *tmp_sampler; @@ -6882,6 +6882,7 @@ static void test_device_context_state(void) uavb = create_buffer((ID3D11Device *)device, D3D11_BIND_UNORDERED_ACCESS, 1024, NULL); ib = create_buffer((ID3D11Device *)device, D3D11_BIND_INDEX_BUFFER, 1024, NULL); vb = create_buffer((ID3D11Device *)device, D3D11_BIND_VERTEX_BUFFER, 1024, NULL); + sob = create_buffer((ID3D11Device *)device, D3D11_BIND_STREAM_OUTPUT, 1024, NULL);
hr = ID3D11Device1_CreateVertexShader(device, simple_vs, sizeof(simple_vs), NULL, &vs); ok(SUCCEEDED(hr), "Failed to create vertex shader, hr %#x.\n", hr); @@ -6942,6 +6943,7 @@ static void test_device_context_state(void) ib_offset = 16; vb_offset = 16; vb_stride = 16; + so_offset = 16;
texture_desc.Width = 512; texture_desc.Height = 512; @@ -7064,6 +7066,8 @@ static void test_device_context_state(void) ID3D11DeviceContext1_RSSetViewports(context, 1, &vp); ID3D11DeviceContext1_RSSetState(context, rs);
+ ID3D11DeviceContext1_SOSetTargets(context, 1, &sob, &so_offset); + previous_context_state = (ID3DDeviceContextState *)0xdeadbeef; ID3D11DeviceContext1_SwapDeviceContextState(context, NULL, &previous_context_state); todo_wine ok(previous_context_state == NULL, "Got unexpected state pointer.\n"); @@ -7248,6 +7252,11 @@ static void test_device_context_state(void) ID3D11DeviceContext1_RSGetScissorRects(context, &count, tmp_rect); todo_wine ok(count == 0, "Got unexpected scissor rect count %u.\n", count);
+ tmp_sob = (ID3D11Buffer *)0xdeadbeef; + ID3D11DeviceContext1_SOGetTargets(context, 1, &tmp_sob); + todo_wine ok(!tmp_sob, "Got unexpected stream output buffer %p.\n", tmp_sob); + if (tmp_sob) ID3D11Buffer_Release(tmp_sob); + /* updating the device context should also update the device context state */ hr = ID3D11Device1_CreateVertexShader(device, simple_vs, sizeof(simple_vs), NULL, &vs2); ok(SUCCEEDED(hr), "Failed to create vertex shader, hr %#x.\n", hr); @@ -7523,6 +7532,11 @@ static void test_device_context_state(void) ok(!memcmp(tmp_rect, &rect, sizeof(rect)), "Got scissor rect %s, expected %s.\n", wine_dbgstr_rect(tmp_rect), wine_dbgstr_rect(&rect));
+ tmp_sob = (ID3D11Buffer *)0xdeadbeef; + ID3D11DeviceContext1_SOGetTargets(context, 1, &tmp_sob); + ok(tmp_sob == sob, "Got stream output buffer %p, expected %p.\n", tmp_sob, sob); + ID3D11Buffer_Release(tmp_sob); + 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); @@ -7744,6 +7758,8 @@ static void test_device_context_state(void) ID3D11DeviceContext1_RSSetViewports(context, 1, &vp); ID3D11DeviceContext1_RSSetState(context, rs);
+ ID3D11DeviceContext1_SOSetTargets(context, 1, &sob, &so_offset); + tmp_rs = (ID3D11RasterizerState *)0xdeadbeef; ID3D11DeviceContext1_RSGetState(context, &tmp_rs); todo_wine ok(!tmp_rs, "Got unexpected rasterizer state %p.\n", tmp_rs); @@ -7757,6 +7773,11 @@ static void test_device_context_state(void) ID3D11DeviceContext1_RSGetScissorRects(context, &count, tmp_rect); todo_wine ok(count == 0, "Got unexpected scissor rect count %u.\n", count);
+ tmp_sob = (ID3D11Buffer *)0xdeadbeef; + ID3D11DeviceContext1_SOGetTargets(context, 1, &tmp_sob); + todo_wine ok(!tmp_sob, "Got unexpected stream output buffer %p.\n", tmp_sob); + if (tmp_sob) ID3D11Buffer_Release(tmp_sob); + check_interface(device, &IID_ID3D10Device, TRUE, FALSE); check_interface(device, &IID_ID3D10Device1, TRUE, FALSE);
@@ -7944,9 +7965,15 @@ static void test_device_context_state(void) ok(!memcmp(tmp_rect, &rect, sizeof(rect)), "Got scissor rect %s, expected %s.\n", wine_dbgstr_rect(tmp_rect), wine_dbgstr_rect(&rect));
+ tmp_sob = (ID3D11Buffer *)0xdeadbeef; + ID3D11DeviceContext1_SOGetTargets(context, 1, &tmp_sob); + ok(tmp_sob == sob, "Got stream output buffer %p, expected %p.\n", tmp_sob, sob); + ID3D11Buffer_Release(tmp_sob); + check_interface(device, &IID_ID3D10Device, TRUE, FALSE); check_interface(device, &IID_ID3D10Device1, TRUE, FALSE);
+ ID3D11Buffer_Release(sob); ID3D11RasterizerState_Release(rs); ID3D11BlendState_Release(bs); ID3D11DepthStencilState_Release(dss);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=84929
Your paranoid android.
=== w1064 (32 bit report) ===
d3d11: d3d11.c:5811: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5812: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5813: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5816: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5817: Test failed: Got unexpected CPrimitives count: 0.
=== w10pro64 (32 bit report) ===
d3d11: d3d11.c:5811: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5812: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5813: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5816: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5817: Test failed: Got unexpected CPrimitives count: 0. d3d11.c:5658: Test failed: Got unexpected query result 0x0000000000000000.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/d3d11/tests/d3d11.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 5212776cc59..d7a49f4af3a 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -6797,9 +6797,11 @@ static void test_device_context_state(void) enum D3D_PRIMITIVE_TOPOLOGY topo; ID3D11ComputeShader *tmp_cs, *cs; D3D11_DEPTH_STENCIL_DESC ds_desc; + ID3D11Predicate *tmp_pred, *pred; ID3D11DomainShader *tmp_ds, *ds; D3D11_SAMPLER_DESC sampler_desc; D3D_FEATURE_LEVEL feature_level; + D3D11_QUERY_DESC predicate_desc; ID3D11Device1 *device, *device2; ID3D11InputLayout *il, *tmp_il; ID3D11PixelShader *tmp_ps, *ps; @@ -6814,6 +6816,7 @@ static void test_device_context_state(void) float blend_factor[4]; struct vec4 constant; DWORD data_size; + BOOL pred_value; ULONG refcount; char data[64]; HRESULT hr; @@ -7020,6 +7023,10 @@ static void test_device_context_state(void) vp.MinDepth = 0.f; vp.MaxDepth = 0.01f;
+ predicate_desc.Query = D3D11_QUERY_OCCLUSION_PREDICATE; + predicate_desc.MiscFlags = 0; + ID3D11Device1_CreatePredicate(device, &predicate_desc, &pred); + ID3D11DeviceContext1_VSSetConstantBuffers(context, 0, 1, &cb); ID3D11DeviceContext1_VSSetSamplers(context, 0, 1, &sampler); ID3D11DeviceContext1_VSSetShader(context, vs, NULL, 0); @@ -7067,6 +7074,7 @@ static void test_device_context_state(void) ID3D11DeviceContext1_RSSetState(context, rs);
ID3D11DeviceContext1_SOSetTargets(context, 1, &sob, &so_offset); + ID3D11DeviceContext1_SetPredication(context, pred, TRUE);
previous_context_state = (ID3DDeviceContextState *)0xdeadbeef; ID3D11DeviceContext1_SwapDeviceContextState(context, NULL, &previous_context_state); @@ -7257,6 +7265,13 @@ static void test_device_context_state(void) todo_wine ok(!tmp_sob, "Got unexpected stream output buffer %p.\n", tmp_sob); if (tmp_sob) ID3D11Buffer_Release(tmp_sob);
+ tmp_pred = (ID3D11Predicate *)0xdeadbeef; + pred_value = 0xdeadbeef; + ID3D11DeviceContext1_GetPredication(context, &tmp_pred, &pred_value); + todo_wine ok(!tmp_pred, "Got unexpected predicate %p.\n", tmp_pred); + if (tmp_pred) ID3D11Predicate_Release(tmp_pred); + todo_wine ok(!pred_value, "Got unexpected predicate value %d.\n", pred_value); + /* updating the device context should also update the device context state */ hr = ID3D11Device1_CreateVertexShader(device, simple_vs, sizeof(simple_vs), NULL, &vs2); ok(SUCCEEDED(hr), "Failed to create vertex shader, hr %#x.\n", hr); @@ -7537,6 +7552,13 @@ static void test_device_context_state(void) ok(tmp_sob == sob, "Got stream output buffer %p, expected %p.\n", tmp_sob, sob); ID3D11Buffer_Release(tmp_sob);
+ tmp_pred = (ID3D11Predicate *)0xdeadbeef; + pred_value = 0xdeadbeef; + ID3D11DeviceContext1_GetPredication(context, &tmp_pred, &pred_value); + ok(tmp_pred == pred, "Got predicate %p, expected %p.\n", tmp_pred, pred); + ID3D11Predicate_Release(tmp_pred); + ok(pred_value == TRUE, "Got predicate value %#x, expected TRUE.\n", pred_value); + 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); @@ -7759,6 +7781,7 @@ static void test_device_context_state(void) ID3D11DeviceContext1_RSSetState(context, rs);
ID3D11DeviceContext1_SOSetTargets(context, 1, &sob, &so_offset); + ID3D11DeviceContext1_SetPredication(context, pred, TRUE);
tmp_rs = (ID3D11RasterizerState *)0xdeadbeef; ID3D11DeviceContext1_RSGetState(context, &tmp_rs); @@ -7778,6 +7801,13 @@ static void test_device_context_state(void) todo_wine ok(!tmp_sob, "Got unexpected stream output buffer %p.\n", tmp_sob); if (tmp_sob) ID3D11Buffer_Release(tmp_sob);
+ tmp_pred = (ID3D11Predicate *)0xdeadbeef; + pred_value = 0xdeadbeef; + ID3D11DeviceContext1_GetPredication(context, &tmp_pred, &pred_value); + todo_wine ok(!tmp_pred, "Got unexpected predicate %p.\n", tmp_pred); + if (tmp_pred) ID3D11Predicate_Release(tmp_pred); + todo_wine ok(!pred_value, "Got unexpected predicate value %d.\n", pred_value); + check_interface(device, &IID_ID3D10Device, TRUE, FALSE); check_interface(device, &IID_ID3D10Device1, TRUE, FALSE);
@@ -7970,9 +8000,17 @@ static void test_device_context_state(void) ok(tmp_sob == sob, "Got stream output buffer %p, expected %p.\n", tmp_sob, sob); ID3D11Buffer_Release(tmp_sob);
+ tmp_pred = (ID3D11Predicate *)0xdeadbeef; + pred_value = 0xdeadbeef; + ID3D11DeviceContext1_GetPredication(context, &tmp_pred, &pred_value); + ok(tmp_pred == pred, "Got predicate %p, expected %p.\n", tmp_pred, pred); + ID3D11Predicate_Release(tmp_pred); + ok(pred_value == TRUE, "Got predicate value %#x, expected TRUE.\n", pred_value); + check_interface(device, &IID_ID3D10Device, TRUE, FALSE); check_interface(device, &IID_ID3D10Device1, TRUE, FALSE);
+ ID3D11Predicate_Release(pred); ID3D11Buffer_Release(sob); ID3D11RasterizerState_Release(rs); ID3D11BlendState_Release(bs);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=84930
Your paranoid android.
=== w10pro64 (32 bit report) ===
d3d11: d3d11.c:5811: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5812: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5813: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5816: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5817: Test failed: Got unexpected CPrimitives count: 0. d3d11.c:5658: Test failed: Got unexpected query result 0x0000000000000000.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=84923
Your paranoid android.
=== w1064v1809 (32 bit report) ===
d3d11: d3d11.c:5804: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5805: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5806: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5809: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5810: Test failed: Got unexpected CPrimitives count: 0.
=== w1064 (32 bit report) ===
d3d11: d3d11.c:5804: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5805: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5806: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5809: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5810: Test failed: Got unexpected CPrimitives count: 0.