Signed-off-by: Rémi Bernon rbernon@codeweavers.com ---
This basically shows that the initial plan is a dead-end, and that I'll have to implement device context swap through wined3d_state swapping instead.
So, just sending the tests for now.
dlls/d3d11/tests/d3d11.c | 79 +++++++++++++++++++++++++++++++++++----- 1 file changed, 69 insertions(+), 10 deletions(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 7220be73ac7..20bf62b792e 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -6673,19 +6673,19 @@ static void test_device_context_state(void) 0x00000000, 0x00101e46, 0x00000000, 0x0100003e, };
- ID3DDeviceContextState *context_state, *previous_context_state; + ID3DDeviceContextState *context_state, *previous_context_state, *tmp_context_state, *context_state2; ID3D11SamplerState *sampler, *tmp_sampler; D3D11_SHADER_RESOURCE_VIEW_DESC srv_desc; ID3D11ShaderResourceView *tmp_srv, *srv; D3D11_DEVICE_CONTEXT_TYPE context_type; - ID3D11DeviceContext1 *context = NULL; + ID3D11DeviceContext1 *context = NULL, *context2; D3D11_SAMPLER_DESC sampler_desc; D3D_FEATURE_LEVEL feature_level; ID3D11GeometryShader *tmp_gs, *gs; - ID3D11VertexShader *tmp_vs, *vs; + ID3D11VertexShader *tmp_vs, *vs, *vs2; ID3D11PixelShader *tmp_ps, *ps; - ID3D11Device *d3d11_device; - ID3D11Device1 *device; + ID3D11Device *d3d11_device, *d3d11_device2; + ID3D11Device1 *device, *device2; struct vec4 constant; ID3D11Buffer *cb, *srvb, *tmp_cb; ULONG refcount; @@ -6809,6 +6809,8 @@ static void test_device_context_state(void) ID3D11DeviceContext1_VSSetSamplers(context, 0, 1, &sampler); ID3D11DeviceContext1_VSSetShader(context, vs, NULL, 0); ID3D11DeviceContext1_VSSetShaderResources(context, 0, 1, &srv); + refcount = get_refcount(vs); + ok(refcount == 1, "Got refcount %u, expected 1.\n", refcount);
ID3D11DeviceContext1_GSSetConstantBuffers(context, 0, 1, &cb); ID3D11DeviceContext1_GSSetSamplers(context, 0, 1, &sampler); @@ -6820,11 +6822,15 @@ static void test_device_context_state(void) ID3D11DeviceContext1_PSSetShader(context, ps, NULL, 0); ID3D11DeviceContext1_PSSetShaderResources(context, 0, 1, &srv);
+ previous_context_state = (ID3DDeviceContextState *)0xdeadbeef; + ID3D11DeviceContext1_SwapDeviceContextState(context, NULL, &previous_context_state); + todo_wine ok(previous_context_state == NULL, "Got unexpected state pointer.\n"); + if (previous_context_state) ID3DDeviceContextState_Release(previous_context_state); 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); ok(previous_context_state != NULL, "Failed to get previous context state\n"); + refcount = get_refcount(vs); + todo_wine ok(refcount == 1, "Got refcount %u, expected 1.\n", refcount);
context_type = ID3D11DeviceContext1_GetType(context); ok(context_type == D3D11_DEVICE_CONTEXT_IMMEDIATE, "Unexpected context type %u.\n", context_type); @@ -6868,11 +6874,64 @@ static void test_device_context_state(void) ID3D11DeviceContext1_PSGetShaderResources(context, 0, 1, &tmp_srv); ok(!tmp_srv, "Got unexpected srv %p.\n", tmp_srv);
- ID3D11DeviceContext1_SwapDeviceContextState(context, previous_context_state, &context_state); - refcount = ID3DDeviceContextState_Release(context_state); - ok(!refcount, "Got refcount %u, expected 0.\n", refcount); + /* 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); + ID3D11DeviceContext1_VSSetShader(context, vs2, NULL, 0); + ID3D11DeviceContext1_SwapDeviceContextState(context, context_state, &tmp_context_state); + refcount = ID3DDeviceContextState_Release(tmp_context_state); + todo_wine ok(refcount == 1, "Got refcount %u, expected 1.\n", refcount); + todo_wine ok(tmp_context_state == context_state, "Got unexpected state pointer.\n"); + tmp_vs = (ID3D11VertexShader *)0xdeadbeef; + 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); + + /* context states may be used with other devices instances too */ + d3d11_device2 = create_device(NULL); + ok(!!d3d11_device2, "Failed to create device.\n"); + hr = ID3D11Device_QueryInterface(d3d11_device2, &IID_ID3D11Device1, (void **)&device2); + ok(SUCCEEDED(hr), "Failed to query device interface, hr %#x.\n", hr); + ID3D11Device_Release(d3d11_device2); + ID3D11Device1_GetImmediateContext1(device2, &context2); + ok(!!context2, "Failed to get immediate context.\n"); + + ID3D11DeviceContext1_SwapDeviceContextState(context2, context_state, &tmp_context_state); + ok(!!tmp_context_state, "Failed to get context state.\n"); + tmp_vs = (ID3D11VertexShader *)0xdeadbeef; + 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); + refcount = ID3DDeviceContextState_Release(context_state2); + 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); + + ID3D11DeviceContext1_VSSetShader(context, NULL, NULL, 0); + refcount = ID3D11VertexShader_Release(vs2); + 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); ok(!refcount, "Got refcount %u, expected 0.\n", refcount); + refcount = ID3DDeviceContextState_Release(tmp_context_state); + todo_wine ok(refcount == 1, "Got refcount %u, expected 1.\n", refcount); + refcount = ID3DDeviceContextState_Release(context_state); + ok(!refcount, "Got refcount %u, expected 0.\n", refcount); + todo_wine ok(tmp_context_state == context_state, "Got unexpected state pointer.\n"); + refcount = get_refcount(vs); + ok(refcount == 1, "Got refcount %u, expected 1.\n", refcount);
/* ID3DDeviceContextState retains the previous state. */
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/d3d11/tests/d3d11.c | 152 ++++++++++++++++++++++++++++++++++----- 1 file changed, 133 insertions(+), 19 deletions(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 20bf62b792e..c0dd5bd546c 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -6613,6 +6613,65 @@ static void test_device_context_state(void) 0x0000000e, 0x0300005f, 0x001010f2, 0x00000000, 0x03000065, 0x001020f2, 0x00000000, 0x05000036, 0x001020f2, 0x00000000, 0x00101e46, 0x00000000, 0x0100003e, }; +#if 0 + struct data + { + float4 position : SV_Position; + }; + + struct patch_constant_data + { + float edges[3] : SV_TessFactor; + float inside : SV_InsideTessFactor; + }; + + void patch_constant(InputPatch<data, 3> input, out patch_constant_data output) + { + output.edges[0] = output.edges[1] = output.edges[2] = 1.0f; + output.inside = 1.0f; + } + + [domain("tri")] + [outputcontrolpoints(3)] + [partitioning("integer")] + [outputtopology("triangle_ccw")] + [patchconstantfunc("patch_constant")] + data hs_main(InputPatch<data, 3> input, uint i : SV_OutputControlPointID) + { + return input[i]; + } + + [domain("tri")] + void ds_main(patch_constant_data input, + float3 tess_coord : SV_DomainLocation, + const OutputPatch<data, 3> patch, + out data output) + { + output.position = tess_coord.x * patch[0].position + + tess_coord.y * patch[1].position + + tess_coord.z * patch[2].position; + } +#endif + static const DWORD simple_hs[] = + { + 0x43425844, 0x42b5df25, 0xfd8aa2b1, 0xbe5490cb, 0xb595f8b1, 0x00000001, 0x0000020c, 0x00000004, + 0x00000030, 0x00000064, 0x00000098, 0x0000012c, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, + 0x00000020, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x00000f0f, 0x505f5653, 0x7469736f, + 0x006e6f69, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, + 0x00000003, 0x00000000, 0x0000000f, 0x505f5653, 0x7469736f, 0x006e6f69, 0x47534350, 0x0000008c, + 0x00000004, 0x00000008, 0x00000068, 0x00000000, 0x0000000d, 0x00000003, 0x00000000, 0x00000e01, + 0x00000068, 0x00000001, 0x0000000d, 0x00000003, 0x00000001, 0x00000e01, 0x00000068, 0x00000002, + 0x0000000d, 0x00000003, 0x00000002, 0x00000e01, 0x00000076, 0x00000000, 0x0000000e, 0x00000003, + 0x00000003, 0x00000e01, 0x545f5653, 0x46737365, 0x6f746361, 0x56530072, 0x736e495f, 0x54656469, + 0x46737365, 0x6f746361, 0xabab0072, 0x58454853, 0x000000d8, 0x00030050, 0x00000036, 0x01000071, + 0x01001893, 0x01001894, 0x01001095, 0x01000896, 0x01002097, 0x0100086a, 0x01000073, 0x02000099, + 0x00000003, 0x0200005f, 0x00017000, 0x04000067, 0x00102012, 0x00000000, 0x00000011, 0x04000067, + 0x00102012, 0x00000001, 0x00000012, 0x04000067, 0x00102012, 0x00000002, 0x00000013, 0x02000068, + 0x00000001, 0x0400005b, 0x00102012, 0x00000000, 0x00000003, 0x04000036, 0x00100012, 0x00000000, + 0x0001700a, 0x06000036, 0x00902012, 0x0010000a, 0x00000000, 0x00004001, 0x3f800000, 0x0100003e, + 0x01000073, 0x04000067, 0x00102012, 0x00000003, 0x00000014, 0x05000036, 0x00102012, 0x00000003, + 0x00004001, 0x3f800000, 0x0100003e, + }; #if 0 struct gs_out { @@ -6684,6 +6743,7 @@ static void test_device_context_state(void) ID3D11GeometryShader *tmp_gs, *gs; ID3D11VertexShader *tmp_vs, *vs, *vs2; ID3D11PixelShader *tmp_ps, *ps; + ID3D11HullShader *tmp_hs, *hs; ID3D11Device *d3d11_device, *d3d11_device2; ID3D11Device1 *device, *device2; struct vec4 constant; @@ -6740,12 +6800,6 @@ static void test_device_context_state(void) ok(tmp_sampler == sampler, "Got sampler %p, expected %p.\n", tmp_sampler, sampler); ID3D11SamplerState_Release(tmp_sampler);
- ID3D11DeviceContext1_HSSetSamplers(context, 0, 1, &sampler); - tmp_sampler = NULL; - ID3D11DeviceContext1_HSGetSamplers(context, 0, 1, &tmp_sampler); - ok(tmp_sampler == sampler, "Got sampler %p, expected %p.\n", tmp_sampler, sampler); - ID3D11SamplerState_Release(tmp_sampler); - feature_level = min(feature_level, D3D_FEATURE_LEVEL_11_1); hr = ID3D11Device1_CreateDeviceContextState(device, 0, &feature_level, 1, D3D11_SDK_VERSION, &IID_ID3D11Device1, NULL, &context_state); @@ -6782,12 +6836,6 @@ static void test_device_context_state(void) ok(tmp_cb == cb, "Got buffer %p, expected %p.\n", tmp_cb, cb); ID3D11Buffer_Release(tmp_cb);
- ID3D11DeviceContext1_HSSetConstantBuffers(context, 0, 1, &cb); - tmp_cb = NULL; - ID3D11DeviceContext1_HSGetConstantBuffers(context, 0, 1, &tmp_cb); - ok(tmp_cb == cb, "Got buffer %p, expected %p.\n", tmp_cb, cb); - ID3D11Buffer_Release(tmp_cb); - hr = ID3D11Device1_CreateVertexShader(device, simple_vs, sizeof(simple_vs), NULL, &vs); ok(SUCCEEDED(hr), "Failed to create vertex shader, hr %#x.\n", hr);
@@ -6797,6 +6845,13 @@ static void test_device_context_state(void) hr = ID3D11Device1_CreatePixelShader(device, simple_ps, sizeof(simple_ps), NULL, &ps); ok(SUCCEEDED(hr), "Failed to create pixel shader, hr %#x.\n", hr);
+ if (feature_level < D3D_FEATURE_LEVEL_11_0) hs = NULL; + else + { + hr = ID3D11Device1_CreateHullShader(device, simple_hs, sizeof(simple_hs), NULL, &hs); + ok(SUCCEEDED(hr), "Failed to create hull shader, hr %#x.\n", hr); + } + srv_desc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT; srv_desc.ViewDimension = D3D11_SRV_DIMENSION_BUFFER; U(srv_desc).Buffer.ElementOffset = 0; @@ -6822,6 +6877,11 @@ static void test_device_context_state(void) ID3D11DeviceContext1_PSSetShader(context, ps, NULL, 0); ID3D11DeviceContext1_PSSetShaderResources(context, 0, 1, &srv);
+ ID3D11DeviceContext1_HSSetConstantBuffers(context, 0, 1, &cb); + ID3D11DeviceContext1_HSSetSamplers(context, 0, 1, &sampler); + ID3D11DeviceContext1_HSSetShader(context, hs, NULL, 0); + ID3D11DeviceContext1_HSSetShaderResources(context, 0, 1, &srv); + previous_context_state = (ID3DDeviceContextState *)0xdeadbeef; ID3D11DeviceContext1_SwapDeviceContextState(context, NULL, &previous_context_state); todo_wine ok(previous_context_state == NULL, "Got unexpected state pointer.\n"); @@ -6874,6 +6934,23 @@ static void test_device_context_state(void) ID3D11DeviceContext1_PSGetShaderResources(context, 0, 1, &tmp_srv); ok(!tmp_srv, "Got unexpected srv %p.\n", tmp_srv);
+ tmp_cb = (ID3D11Buffer *)0xdeadbeef; + ID3D11DeviceContext1_HSGetConstantBuffers(context, 0, 1, &tmp_cb); + todo_wine ok(!tmp_cb, "Got unexpected buffer %p.\n", tmp_cb); + if (tmp_cb) ID3D11Buffer_Release(tmp_cb); + tmp_sampler = (ID3D11SamplerState *)0xdeadbeef; + ID3D11DeviceContext1_HSGetSamplers(context, 0, 1, &tmp_sampler); + todo_wine ok(!tmp_sampler, "Got unexpected sampler %p.\n", tmp_sampler); + if (tmp_sampler) ID3D11SamplerState_Release(tmp_sampler); + tmp_hs = (ID3D11HullShader *)0xdeadbeef; + ID3D11DeviceContext1_HSGetShader(context, &tmp_hs, NULL, NULL); + if (hs) todo_wine ok(!tmp_hs, "Got unexpected shader %p.\n", tmp_hs); + if (tmp_hs) ID3D11HullShader_Release(tmp_hs); + tmp_srv = (ID3D11ShaderResourceView *)0xdeadbeef; + ID3D11DeviceContext1_HSGetShaderResources(context, 0, 1, &tmp_srv); + todo_wine ok(!tmp_srv, "Got unexpected srv %p.\n", tmp_srv); + if (tmp_srv) ID3D11ShaderResourceView_Release(tmp_srv); + /* 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); @@ -6995,6 +7072,14 @@ static void test_device_context_state(void) ID3D11DeviceContext1_DSGetConstantBuffers(context, 0, 1, &tmp_cb); ok(tmp_cb == cb, "Got buffer %p, expected %p.\n", tmp_cb, cb); ID3D11Buffer_Release(tmp_cb); + tmp_hs = (ID3D11HullShader *)0xdeadbeef; + ID3D11DeviceContext1_HSGetShader(context, &tmp_hs, NULL, NULL); + ok(tmp_hs == hs, "Got shader %p, expected %p.\n", tmp_hs, hs); + if (hs) ID3D11HullShader_Release(tmp_hs); + tmp_srv = (ID3D11ShaderResourceView *)0xdeadbeef; + ID3D11DeviceContext1_HSGetShaderResources(context, 0, 1, &tmp_srv); + ok(tmp_srv == srv, "Got srv %p, expected %p.\n", tmp_srv, srv); + ID3D11ShaderResourceView_Release(tmp_srv);
tmp_sampler = (ID3D11SamplerState *)0xdeadbeef; ID3D11DeviceContext1_CSGetSamplers(context, 0, 1, &tmp_sampler); @@ -7045,12 +7130,6 @@ static void test_device_context_state(void) todo_wine ok(!tmp_sampler, "Got unexpected sampler %p.\n", tmp_sampler); if (tmp_sampler) ID3D11SamplerState_Release(tmp_sampler);
- ID3D11DeviceContext1_HSSetSamplers(context, 0, 1, &sampler); - tmp_sampler = (ID3D11SamplerState *)0xdeadbeef; - ID3D11DeviceContext1_HSGetSamplers(context, 0, 1, &tmp_sampler); - todo_wine ok(!tmp_sampler, "Got unexpected sampler %p.\n", tmp_sampler); - if (tmp_sampler) ID3D11SamplerState_Release(tmp_sampler); - ID3D11DeviceContext1_VSSetConstantBuffers(context, 0, 1, &cb); ID3D11DeviceContext1_VSSetSamplers(context, 0, 1, &sampler); ID3D11DeviceContext1_VSSetShader(context, vs, NULL, 0); @@ -7127,10 +7206,27 @@ static void test_device_context_state(void) todo_wine ok(!tmp_cb, "Got unexpected buffer %p.\n", tmp_cb); if (tmp_cb) ID3D11Buffer_Release(tmp_cb);
+ ID3D11DeviceContext1_HSSetConstantBuffers(context, 0, 1, &cb); + ID3D11DeviceContext1_HSSetSamplers(context, 0, 1, &sampler); + ID3D11DeviceContext1_HSSetShader(context, hs, NULL, 0); + ID3D11DeviceContext1_HSSetShaderResources(context, 0, 1, &srv); + tmp_cb = (ID3D11Buffer *)0xdeadbeef; ID3D11DeviceContext1_HSGetConstantBuffers(context, 0, 1, &tmp_cb); todo_wine ok(!tmp_cb, "Got unexpected buffer %p.\n", tmp_cb); - if (tmp_cb) ID3D11Buffer_Release(tmp_cb); + if (tmp_cb && tmp_cb != (ID3D11Buffer *)0xdeadbeef) ID3D11Buffer_Release(tmp_cb); + tmp_sampler = (ID3D11SamplerState *)0xdeadbeef; + ID3D11DeviceContext1_HSGetSamplers(context, 0, 1, &tmp_sampler); + todo_wine ok(!tmp_sampler, "Got unexpected sampler %p.\n", tmp_sampler); + if (tmp_sampler && tmp_sampler != (ID3D11SamplerState *)0xdeadbeef) ID3D11SamplerState_Release(tmp_sampler); + tmp_hs = (ID3D11HullShader *)0xdeadbeef; + ID3D11DeviceContext1_HSGetShader(context, &tmp_hs, NULL, NULL); + if (hs) todo_wine ok(!tmp_hs, "Got unexpected shader %p.\n", tmp_hs); + if (tmp_hs && tmp_hs != (ID3D11HullShader *)0xdeadbeef) ID3D11HullShader_Release(tmp_hs); + tmp_srv = (ID3D11ShaderResourceView *)0xdeadbeef; + ID3D11DeviceContext1_HSGetShaderResources(context, 0, 1, &tmp_srv); + todo_wine ok(!tmp_srv, "Got unexpected srv %p.\n", tmp_srv); + if (tmp_srv && tmp_srv != (ID3D11ShaderResourceView *)0xdeadbeef) ID3D11ShaderResourceView_Release(tmp_srv);
check_interface(device, &IID_ID3D10Device, TRUE, FALSE); check_interface(device, &IID_ID3D10Device1, TRUE, FALSE); @@ -7195,9 +7291,27 @@ static void test_device_context_state(void) ok(tmp_srv == srv, "Got srv %p, expected %p.\n", tmp_srv, srv); ID3D11ShaderResourceView_Release(tmp_srv);
+ tmp_sampler = (ID3D11SamplerState *)0xdeadbeef; + ID3D11DeviceContext1_HSGetSamplers(context, 0, 1, &tmp_sampler); + ok(tmp_sampler == sampler, "Got sampler %p, expected %p.\n", tmp_sampler, sampler); + ID3D11SamplerState_Release(tmp_sampler); + tmp_cb = (ID3D11Buffer *)0xdeadbeef; + ID3D11DeviceContext1_HSGetConstantBuffers(context, 0, 1, &tmp_cb); + ok(tmp_cb == cb, "Got buffer %p, expected %p.\n", tmp_cb, cb); + ID3D11Buffer_Release(tmp_cb); + tmp_hs = (ID3D11HullShader *)0xdeadbeef; + ID3D11DeviceContext1_HSGetShader(context, &tmp_hs, NULL, NULL); + ok(tmp_hs == hs, "Got shader %p, expected %p.\n", tmp_hs, hs); + if (hs) ID3D11HullShader_Release(tmp_hs); + tmp_srv = (ID3D11ShaderResourceView *)0xdeadbeef; + ID3D11DeviceContext1_HSGetShaderResources(context, 0, 1, &tmp_srv); + ok(tmp_srv == srv, "Got srv %p, expected %p.\n", tmp_srv, srv); + ID3D11ShaderResourceView_Release(tmp_srv); + check_interface(device, &IID_ID3D10Device, TRUE, FALSE); check_interface(device, &IID_ID3D10Device1, TRUE, FALSE);
+ if (hs) ID3D11HullShader_Release(hs); ID3D11PixelShader_Release(ps); ID3D11GeometryShader_Release(gs); ID3D11VertexShader_Release(vs);
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=84643
Your paranoid android.
=== w2008s64 (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. 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. d3d11.c:5893: Test failed: Got unexpected hr 0x1. d3d11.c:5913: Test failed: Got unexpected hr 0x1.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/d3d11/tests/d3d11.c | 119 +++++++++++++++++++++++++++++++-------- 1 file changed, 96 insertions(+), 23 deletions(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index c0dd5bd546c..4a0001e700c 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -6672,6 +6672,24 @@ static void test_device_context_state(void) 0x01000073, 0x04000067, 0x00102012, 0x00000003, 0x00000014, 0x05000036, 0x00102012, 0x00000003, 0x00004001, 0x3f800000, 0x0100003e, }; + static const DWORD simple_ds[] = + { + 0x43425844, 0xb7e35b82, 0x1b930ff2, 0x48d3a0f2, 0x375219ed, 0x00000001, 0x000001e0, 0x00000004, + 0x00000030, 0x00000064, 0x000000f8, 0x0000012c, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, + 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000f0f, 0x505f5653, 0x7469736f, + 0x006e6f69, 0x47534350, 0x0000008c, 0x00000004, 0x00000008, 0x00000068, 0x00000000, 0x0000000d, + 0x00000003, 0x00000000, 0x00000001, 0x00000068, 0x00000001, 0x0000000d, 0x00000003, 0x00000001, + 0x00000001, 0x00000068, 0x00000002, 0x0000000d, 0x00000003, 0x00000002, 0x00000001, 0x00000076, + 0x00000000, 0x0000000e, 0x00000003, 0x00000003, 0x00000001, 0x545f5653, 0x46737365, 0x6f746361, + 0x56530072, 0x736e495f, 0x54656469, 0x46737365, 0x6f746361, 0xabab0072, 0x4e47534f, 0x0000002c, + 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, + 0x505f5653, 0x7469736f, 0x006e6f69, 0x58454853, 0x000000ac, 0x00040050, 0x0000002b, 0x01001893, + 0x01001095, 0x0100086a, 0x0200005f, 0x0001c072, 0x0400005f, 0x002190f2, 0x00000003, 0x00000000, + 0x04000067, 0x001020f2, 0x00000000, 0x00000001, 0x02000068, 0x00000001, 0x07000038, 0x001000f2, + 0x00000000, 0x0001c556, 0x00219e46, 0x00000001, 0x00000000, 0x09000032, 0x001000f2, 0x00000000, + 0x0001c006, 0x00219e46, 0x00000000, 0x00000000, 0x00100e46, 0x00000000, 0x09000032, 0x001020f2, + 0x00000000, 0x0001caa6, 0x00219e46, 0x00000002, 0x00000000, 0x00100e46, 0x00000000, 0x0100003e, + }; #if 0 struct gs_out { @@ -6741,6 +6759,7 @@ static void test_device_context_state(void) D3D11_SAMPLER_DESC sampler_desc; D3D_FEATURE_LEVEL feature_level; ID3D11GeometryShader *tmp_gs, *gs; + ID3D11DomainShader *tmp_ds, *ds; ID3D11VertexShader *tmp_vs, *vs, *vs2; ID3D11PixelShader *tmp_ps, *ps; ID3D11HullShader *tmp_hs, *hs; @@ -6794,12 +6813,6 @@ static void test_device_context_state(void) ok(tmp_sampler == sampler, "Got sampler %p, expected %p.\n", tmp_sampler, sampler); ID3D11SamplerState_Release(tmp_sampler);
- ID3D11DeviceContext1_DSSetSamplers(context, 0, 1, &sampler); - tmp_sampler = NULL; - ID3D11DeviceContext1_DSGetSamplers(context, 0, 1, &tmp_sampler); - ok(tmp_sampler == sampler, "Got sampler %p, expected %p.\n", tmp_sampler, sampler); - ID3D11SamplerState_Release(tmp_sampler); - feature_level = min(feature_level, D3D_FEATURE_LEVEL_11_1); hr = ID3D11Device1_CreateDeviceContextState(device, 0, &feature_level, 1, D3D11_SDK_VERSION, &IID_ID3D11Device1, NULL, &context_state); @@ -6830,12 +6843,6 @@ static void test_device_context_state(void) ok(tmp_cb == cb, "Got buffer %p, expected %p.\n", tmp_cb, cb); ID3D11Buffer_Release(tmp_cb);
- ID3D11DeviceContext1_DSSetConstantBuffers(context, 0, 1, &cb); - tmp_cb = NULL; - ID3D11DeviceContext1_DSGetConstantBuffers(context, 0, 1, &tmp_cb); - ok(tmp_cb == cb, "Got buffer %p, expected %p.\n", tmp_cb, cb); - ID3D11Buffer_Release(tmp_cb); - hr = ID3D11Device1_CreateVertexShader(device, simple_vs, sizeof(simple_vs), NULL, &vs); ok(SUCCEEDED(hr), "Failed to create vertex shader, hr %#x.\n", hr);
@@ -6852,6 +6859,13 @@ static void test_device_context_state(void) ok(SUCCEEDED(hr), "Failed to create hull shader, hr %#x.\n", hr); }
+ if (feature_level < D3D_FEATURE_LEVEL_11_0) ds = NULL; + else + { + hr = ID3D11Device1_CreateDomainShader(device, simple_ds, sizeof(simple_ds), NULL, &ds); + ok(SUCCEEDED(hr), "Failed to create domain shader, hr %#x.\n", hr); + } + srv_desc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT; srv_desc.ViewDimension = D3D11_SRV_DIMENSION_BUFFER; U(srv_desc).Buffer.ElementOffset = 0; @@ -6882,6 +6896,11 @@ static void test_device_context_state(void) ID3D11DeviceContext1_HSSetShader(context, hs, NULL, 0); ID3D11DeviceContext1_HSSetShaderResources(context, 0, 1, &srv);
+ ID3D11DeviceContext1_DSSetConstantBuffers(context, 0, 1, &cb); + ID3D11DeviceContext1_DSSetSamplers(context, 0, 1, &sampler); + ID3D11DeviceContext1_DSSetShader(context, ds, NULL, 0); + ID3D11DeviceContext1_DSSetShaderResources(context, 0, 1, &srv); + previous_context_state = (ID3DDeviceContextState *)0xdeadbeef; ID3D11DeviceContext1_SwapDeviceContextState(context, NULL, &previous_context_state); todo_wine ok(previous_context_state == NULL, "Got unexpected state pointer.\n"); @@ -6951,6 +6970,23 @@ static void test_device_context_state(void) todo_wine ok(!tmp_srv, "Got unexpected srv %p.\n", tmp_srv); if (tmp_srv) ID3D11ShaderResourceView_Release(tmp_srv);
+ tmp_cb = (ID3D11Buffer *)0xdeadbeef; + ID3D11DeviceContext1_DSGetConstantBuffers(context, 0, 1, &tmp_cb); + todo_wine ok(!tmp_cb, "Got unexpected buffer %p.\n", tmp_cb); + if (tmp_cb) ID3D11Buffer_Release(tmp_cb); + tmp_sampler = (ID3D11SamplerState *)0xdeadbeef; + ID3D11DeviceContext1_DSGetSamplers(context, 0, 1, &tmp_sampler); + todo_wine ok(!tmp_sampler, "Got unexpected sampler %p.\n", tmp_sampler); + if (tmp_sampler) ID3D11SamplerState_Release(tmp_sampler); + tmp_ds = (ID3D11DomainShader *)0xdeadbeef; + ID3D11DeviceContext1_DSGetShader(context, &tmp_ds, NULL, NULL); + if (ds) todo_wine ok(!tmp_ds, "Got unexpected shader %p.\n", tmp_ds); + if (tmp_ds) ID3D11DomainShader_Release(tmp_ds); + tmp_srv = (ID3D11ShaderResourceView *)0xdeadbeef; + ID3D11DeviceContext1_DSGetShaderResources(context, 0, 1, &tmp_srv); + todo_wine ok(!tmp_srv, "Got unexpected srv %p.\n", tmp_srv); + if (tmp_srv) ID3D11ShaderResourceView_Release(tmp_srv); + /* 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); @@ -7046,6 +7082,14 @@ static void test_device_context_state(void) ID3D11DeviceContext1_PSGetConstantBuffers(context, 0, 1, &tmp_cb); ok(tmp_cb == cb, "Got buffer %p, expected %p.\n", tmp_cb, cb); ID3D11Buffer_Release(tmp_cb); + tmp_ds = (ID3D11DomainShader *)0xdeadbeef; + ID3D11DeviceContext1_DSGetShader(context, &tmp_ds, NULL, NULL); + ok(tmp_ds == ds, "Got shader %p, expected %p.\n", tmp_ds, ds); + if (ds) ID3D11DomainShader_Release(tmp_ds); + tmp_srv = (ID3D11ShaderResourceView *)0xdeadbeef; + ID3D11DeviceContext1_DSGetShaderResources(context, 0, 1, &tmp_srv); + ok(tmp_srv == srv, "Got srv %p, expected %p.\n", tmp_srv, srv); + ID3D11ShaderResourceView_Release(tmp_srv);
tmp_sampler = (ID3D11SamplerState *)0xdeadbeef; ID3D11DeviceContext1_HSGetSamplers(context, 0, 1, &tmp_sampler); @@ -7124,12 +7168,6 @@ static void test_device_context_state(void) todo_wine ok(!tmp_sampler, "Got unexpected sampler %p.\n", tmp_sampler); if (tmp_sampler) ID3D11SamplerState_Release(tmp_sampler);
- ID3D11DeviceContext1_DSSetSamplers(context, 0, 1, &sampler); - tmp_sampler = (ID3D11SamplerState *)0xdeadbeef; - ID3D11DeviceContext1_DSGetSamplers(context, 0, 1, &tmp_sampler); - todo_wine ok(!tmp_sampler, "Got unexpected sampler %p.\n", tmp_sampler); - if (tmp_sampler) ID3D11SamplerState_Release(tmp_sampler); - ID3D11DeviceContext1_VSSetConstantBuffers(context, 0, 1, &cb); ID3D11DeviceContext1_VSSetSamplers(context, 0, 1, &sampler); ID3D11DeviceContext1_VSSetShader(context, vs, NULL, 0); @@ -7201,11 +7239,6 @@ static void test_device_context_state(void) todo_wine ok(!tmp_cb, "Got unexpected buffer %p.\n", tmp_cb); if (tmp_cb) ID3D11Buffer_Release(tmp_cb);
- tmp_cb = (ID3D11Buffer *)0xdeadbeef; - ID3D11DeviceContext1_DSGetConstantBuffers(context, 0, 1, &tmp_cb); - todo_wine ok(!tmp_cb, "Got unexpected buffer %p.\n", tmp_cb); - if (tmp_cb) ID3D11Buffer_Release(tmp_cb); - ID3D11DeviceContext1_HSSetConstantBuffers(context, 0, 1, &cb); ID3D11DeviceContext1_HSSetSamplers(context, 0, 1, &sampler); ID3D11DeviceContext1_HSSetShader(context, hs, NULL, 0); @@ -7228,6 +7261,28 @@ static void test_device_context_state(void) todo_wine ok(!tmp_srv, "Got unexpected srv %p.\n", tmp_srv); if (tmp_srv && tmp_srv != (ID3D11ShaderResourceView *)0xdeadbeef) ID3D11ShaderResourceView_Release(tmp_srv);
+ ID3D11DeviceContext1_DSSetConstantBuffers(context, 0, 1, &cb); + ID3D11DeviceContext1_DSSetSamplers(context, 0, 1, &sampler); + ID3D11DeviceContext1_DSSetShader(context, ds, NULL, 0); + ID3D11DeviceContext1_DSSetShaderResources(context, 0, 1, &srv); + + tmp_cb = (ID3D11Buffer *)0xdeadbeef; + ID3D11DeviceContext1_DSGetConstantBuffers(context, 0, 1, &tmp_cb); + todo_wine ok(!tmp_cb, "Got unexpected buffer %p.\n", tmp_cb); + if (tmp_cb && tmp_cb != (ID3D11Buffer *)0xdeadbeef) ID3D11Buffer_Release(tmp_cb); + tmp_sampler = (ID3D11SamplerState *)0xdeadbeef; + ID3D11DeviceContext1_DSGetSamplers(context, 0, 1, &tmp_sampler); + todo_wine ok(!tmp_sampler, "Got unexpected sampler %p.\n", tmp_sampler); + if (tmp_sampler && tmp_sampler != (ID3D11SamplerState *)0xdeadbeef) ID3D11SamplerState_Release(tmp_sampler); + tmp_ds = (ID3D11DomainShader *)0xdeadbeef; + ID3D11DeviceContext1_DSGetShader(context, &tmp_ds, NULL, NULL); + if (ds) todo_wine ok(!tmp_ds, "Got unexpected shader %p.\n", tmp_ds); + if (tmp_ds && tmp_ds != (ID3D11DomainShader *)0xdeadbeef) ID3D11DomainShader_Release(tmp_ds); + tmp_srv = (ID3D11ShaderResourceView *)0xdeadbeef; + ID3D11DeviceContext1_DSGetShaderResources(context, 0, 1, &tmp_srv); + todo_wine ok(!tmp_srv, "Got unexpected srv %p.\n", tmp_srv); + if (tmp_srv && tmp_srv != (ID3D11ShaderResourceView *)0xdeadbeef) ID3D11ShaderResourceView_Release(tmp_srv); + check_interface(device, &IID_ID3D10Device, TRUE, FALSE); check_interface(device, &IID_ID3D10Device1, TRUE, FALSE);
@@ -7308,9 +7363,27 @@ static void test_device_context_state(void) ok(tmp_srv == srv, "Got srv %p, expected %p.\n", tmp_srv, srv); ID3D11ShaderResourceView_Release(tmp_srv);
+ tmp_sampler = (ID3D11SamplerState *)0xdeadbeef; + ID3D11DeviceContext1_DSGetSamplers(context, 0, 1, &tmp_sampler); + ok(tmp_sampler == sampler, "Got sampler %p, expected %p.\n", tmp_sampler, sampler); + ID3D11SamplerState_Release(tmp_sampler); + tmp_cb = (ID3D11Buffer *)0xdeadbeef; + ID3D11DeviceContext1_DSGetConstantBuffers(context, 0, 1, &tmp_cb); + ok(tmp_cb == cb, "Got buffer %p, expected %p.\n", tmp_cb, cb); + ID3D11Buffer_Release(tmp_cb); + tmp_ds = (ID3D11DomainShader *)0xdeadbeef; + ID3D11DeviceContext1_DSGetShader(context, &tmp_ds, NULL, NULL); + ok(tmp_ds == ds, "Got shader %p, expected %p.\n", tmp_ds, ds); + if (ds) ID3D11DomainShader_Release(tmp_ds); + tmp_srv = (ID3D11ShaderResourceView *)0xdeadbeef; + ID3D11DeviceContext1_DSGetShaderResources(context, 0, 1, &tmp_srv); + ok(tmp_srv == srv, "Got srv %p, expected %p.\n", tmp_srv, srv); + ID3D11ShaderResourceView_Release(tmp_srv); + check_interface(device, &IID_ID3D10Device, TRUE, FALSE); check_interface(device, &IID_ID3D10Device1, TRUE, FALSE);
+ if (ds) ID3D11DomainShader_Release(ds); if (hs) ID3D11HullShader_Release(hs); ID3D11PixelShader_Release(ps); ID3D11GeometryShader_Release(gs);
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=84644
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.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/d3d11/tests/d3d11.c | 144 ++++++++++++++++++++++++++++++++------- 1 file changed, 120 insertions(+), 24 deletions(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 4a0001e700c..c5c2e16e716 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -6749,16 +6749,30 @@ static void test_device_context_state(void) 0x03001062, 0x001010f2, 0x00000000, 0x03000065, 0x001020f2, 0x00000000, 0x05000036, 0x001020f2, 0x00000000, 0x00101e46, 0x00000000, 0x0100003e, }; +#if 0 + [numthreads(1, 1, 1)] + void main() { } +#endif + static const DWORD simple_cs[] = + { + 0x43425844, 0x1acc3ad0, 0x71c7b057, 0xc72c4306, 0xf432cb57, 0x00000001, 0x00000074, 0x00000003, + 0x0000002c, 0x0000003c, 0x0000004c, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, + 0x00000008, 0x00000000, 0x00000008, 0x58454853, 0x00000020, 0x00050050, 0x00000008, 0x0100086a, + 0x0400009b, 0x00000001, 0x00000001, 0x00000001, 0x0100003e, + };
ID3DDeviceContextState *context_state, *previous_context_state, *tmp_context_state, *context_state2; ID3D11SamplerState *sampler, *tmp_sampler; + D3D11_UNORDERED_ACCESS_VIEW_DESC uav_desc; D3D11_SHADER_RESOURCE_VIEW_DESC srv_desc; + ID3D11UnorderedAccessView *tmp_uav, *uav; ID3D11ShaderResourceView *tmp_srv, *srv; D3D11_DEVICE_CONTEXT_TYPE context_type; ID3D11DeviceContext1 *context = NULL, *context2; D3D11_SAMPLER_DESC sampler_desc; D3D_FEATURE_LEVEL feature_level; ID3D11GeometryShader *tmp_gs, *gs; + ID3D11ComputeShader *tmp_cs, *cs; ID3D11DomainShader *tmp_ds, *ds; ID3D11VertexShader *tmp_vs, *vs, *vs2; ID3D11PixelShader *tmp_ps, *ps; @@ -6766,7 +6780,7 @@ static void test_device_context_state(void) ID3D11Device *d3d11_device, *d3d11_device2; ID3D11Device1 *device, *device2; struct vec4 constant; - ID3D11Buffer *cb, *srvb, *tmp_cb; + ID3D11Buffer *cb, *srvb, *uavb, *tmp_cb; ULONG refcount; HRESULT hr;
@@ -6807,12 +6821,6 @@ static void test_device_context_state(void) hr = ID3D11Device1_CreateSamplerState(device, &sampler_desc, &sampler); ok(SUCCEEDED(hr), "Failed to create sampler state, hr %#x.\n", hr);
- ID3D11DeviceContext1_CSSetSamplers(context, 0, 1, &sampler); - tmp_sampler = NULL; - ID3D11DeviceContext1_CSGetSamplers(context, 0, 1, &tmp_sampler); - ok(tmp_sampler == sampler, "Got sampler %p, expected %p.\n", tmp_sampler, sampler); - ID3D11SamplerState_Release(tmp_sampler); - feature_level = min(feature_level, D3D_FEATURE_LEVEL_11_1); hr = ID3D11Device1_CreateDeviceContextState(device, 0, &feature_level, 1, D3D11_SDK_VERSION, &IID_ID3D11Device1, NULL, &context_state); @@ -6836,12 +6844,7 @@ 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); - - ID3D11DeviceContext1_CSSetConstantBuffers(context, 0, 1, &cb); - tmp_cb = NULL; - ID3D11DeviceContext1_CSGetConstantBuffers(context, 0, 1, &tmp_cb); - ok(tmp_cb == cb, "Got buffer %p, expected %p.\n", tmp_cb, cb); - ID3D11Buffer_Release(tmp_cb); + uavb = create_buffer((ID3D11Device *)device, D3D11_BIND_UNORDERED_ACCESS, 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); @@ -6866,6 +6869,13 @@ static void test_device_context_state(void) ok(SUCCEEDED(hr), "Failed to create domain shader, hr %#x.\n", hr); }
+ if (feature_level < D3D_FEATURE_LEVEL_11_0) cs = NULL; + else + { + hr = ID3D11Device1_CreateComputeShader(device, simple_cs, sizeof(simple_cs), NULL, &cs); + ok(SUCCEEDED(hr), "Failed to create compute shader, hr %#x.\n", hr); + } + srv_desc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT; srv_desc.ViewDimension = D3D11_SRV_DIMENSION_BUFFER; U(srv_desc).Buffer.ElementOffset = 0; @@ -6874,6 +6884,15 @@ static void test_device_context_state(void) ok(SUCCEEDED(hr), "Failed to create shader resource view, hr %#x.\n", hr); ID3D11Buffer_Release(srvb);
+ uav_desc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT; + uav_desc.ViewDimension = D3D11_UAV_DIMENSION_BUFFER; + U(uav_desc).Buffer.FirstElement = 0; + U(uav_desc).Buffer.NumElements = 4; + U(uav_desc).Buffer.Flags = 0; + hr = ID3D11Device1_CreateUnorderedAccessView(device, (ID3D11Resource *)uavb, &uav_desc, &uav); + ok(hr == S_OK, "Failed to create unordered access view, hr %#x.\n", hr); + ID3D11Buffer_Release(uavb); + ID3D11DeviceContext1_VSSetConstantBuffers(context, 0, 1, &cb); ID3D11DeviceContext1_VSSetSamplers(context, 0, 1, &sampler); ID3D11DeviceContext1_VSSetShader(context, vs, NULL, 0); @@ -6901,6 +6920,12 @@ static void test_device_context_state(void) ID3D11DeviceContext1_DSSetShader(context, ds, NULL, 0); ID3D11DeviceContext1_DSSetShaderResources(context, 0, 1, &srv);
+ ID3D11DeviceContext1_CSSetConstantBuffers(context, 0, 1, &cb); + 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); + previous_context_state = (ID3DDeviceContextState *)0xdeadbeef; ID3D11DeviceContext1_SwapDeviceContextState(context, NULL, &previous_context_state); todo_wine ok(previous_context_state == NULL, "Got unexpected state pointer.\n"); @@ -6987,6 +7012,27 @@ static void test_device_context_state(void) todo_wine ok(!tmp_srv, "Got unexpected srv %p.\n", tmp_srv); if (tmp_srv) ID3D11ShaderResourceView_Release(tmp_srv);
+ tmp_cb = (ID3D11Buffer *)0xdeadbeef; + ID3D11DeviceContext1_CSGetConstantBuffers(context, 0, 1, &tmp_cb); + todo_wine ok(!tmp_cb, "Got unexpected buffer %p.\n", tmp_cb); + if (tmp_cb) ID3D11Buffer_Release(tmp_cb); + tmp_sampler = (ID3D11SamplerState *)0xdeadbeef; + ID3D11DeviceContext1_CSGetSamplers(context, 0, 1, &tmp_sampler); + todo_wine ok(!tmp_sampler, "Got unexpected sampler %p.\n", tmp_sampler); + if (tmp_sampler) ID3D11SamplerState_Release(tmp_sampler); + tmp_cs = (ID3D11ComputeShader *)0xdeadbeef; + ID3D11DeviceContext1_CSGetShader(context, &tmp_cs, NULL, NULL); + if (cs) todo_wine ok(!tmp_cs, "Got unexpected shader %p.\n", tmp_cs); + if (tmp_cs) ID3D11ComputeShader_Release(tmp_cs); + tmp_srv = (ID3D11ShaderResourceView *)0xdeadbeef; + ID3D11DeviceContext1_CSGetShaderResources(context, 0, 1, &tmp_srv); + todo_wine ok(!tmp_srv, "Got unexpected srv %p.\n", tmp_srv); + if (tmp_srv) ID3D11ShaderResourceView_Release(tmp_srv); + tmp_uav = (ID3D11UnorderedAccessView *)0xdeadbeef; + ID3D11DeviceContext1_CSGetUnorderedAccessViews(context, 0, 1, &tmp_uav); + todo_wine ok(!tmp_uav, "Got unexpected uav %p.\n", tmp_uav); + if (tmp_uav) ID3D11UnorderedAccessView_Release(tmp_uav); + /* 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); @@ -7073,6 +7119,18 @@ static void test_device_context_state(void) ID3D11DeviceContext1_GSGetConstantBuffers(context, 0, 1, &tmp_cb); ok(tmp_cb == cb, "Got buffer %p, expected %p.\n", tmp_cb, cb); ID3D11Buffer_Release(tmp_cb); + tmp_cs = (ID3D11ComputeShader *)0xdeadbeef; + ID3D11DeviceContext1_CSGetShader(context, &tmp_cs, NULL, NULL); + ok(tmp_cs == cs, "Got shader %p, expected %p.\n", tmp_cs, cs); + if (cs) ID3D11ComputeShader_Release(tmp_cs); + tmp_srv = (ID3D11ShaderResourceView *)0xdeadbeef; + ID3D11DeviceContext1_CSGetShaderResources(context, 0, 1, &tmp_srv); + ok(tmp_srv == srv, "Got srv %p, expected %p.\n", tmp_srv, srv); + ID3D11ShaderResourceView_Release(tmp_srv); + tmp_uav = (ID3D11UnorderedAccessView *)0xdeadbeef; + ID3D11DeviceContext1_CSGetUnorderedAccessViews(context, 0, 1, &tmp_uav); + ok(tmp_uav == uav, "Got uav %p, expected %p.\n", tmp_uav, uav); + ID3D11UnorderedAccessView_Release(tmp_uav);
tmp_sampler = (ID3D11SamplerState *)0xdeadbeef; ID3D11DeviceContext1_PSGetSamplers(context, 0, 1, &tmp_sampler); @@ -7162,12 +7220,6 @@ static void test_device_context_state(void) context_type = ID3D11DeviceContext1_GetType(context); ok(context_type == D3D11_DEVICE_CONTEXT_IMMEDIATE, "Unexpected context type %u.\n", context_type);
- ID3D11DeviceContext1_CSSetSamplers(context, 0, 1, &sampler); - tmp_sampler = (ID3D11SamplerState *)0xdeadbeef; - ID3D11DeviceContext1_CSGetSamplers(context, 0, 1, &tmp_sampler); - todo_wine ok(!tmp_sampler, "Got unexpected sampler %p.\n", tmp_sampler); - if (tmp_sampler) ID3D11SamplerState_Release(tmp_sampler); - ID3D11DeviceContext1_VSSetConstantBuffers(context, 0, 1, &cb); ID3D11DeviceContext1_VSSetSamplers(context, 0, 1, &sampler); ID3D11DeviceContext1_VSSetShader(context, vs, NULL, 0); @@ -7234,11 +7286,6 @@ static void test_device_context_state(void) todo_wine ok(!tmp_srv, "Got unexpected srv %p.\n", tmp_srv); if (tmp_srv && tmp_srv != (ID3D11ShaderResourceView *)0xdeadbeef) ID3D11ShaderResourceView_Release(tmp_srv);
- tmp_cb = (ID3D11Buffer *)0xdeadbeef; - ID3D11DeviceContext1_CSGetConstantBuffers(context, 0, 1, &tmp_cb); - todo_wine ok(!tmp_cb, "Got unexpected buffer %p.\n", tmp_cb); - if (tmp_cb) ID3D11Buffer_Release(tmp_cb); - ID3D11DeviceContext1_HSSetConstantBuffers(context, 0, 1, &cb); ID3D11DeviceContext1_HSSetSamplers(context, 0, 1, &sampler); ID3D11DeviceContext1_HSSetShader(context, hs, NULL, 0); @@ -7283,6 +7330,32 @@ static void test_device_context_state(void) todo_wine ok(!tmp_srv, "Got unexpected srv %p.\n", tmp_srv); if (tmp_srv && tmp_srv != (ID3D11ShaderResourceView *)0xdeadbeef) ID3D11ShaderResourceView_Release(tmp_srv);
+ ID3D11DeviceContext1_CSSetConstantBuffers(context, 0, 1, &cb); + ID3D11DeviceContext1_CSSetSamplers(context, 0, 1, &sampler); + ID3D11DeviceContext1_CSSetShader(context, cs, NULL, 0); + ID3D11DeviceContext1_CSSetShaderResources(context, 0, 1, &srv); + + tmp_cb = (ID3D11Buffer *)0xdeadbeef; + ID3D11DeviceContext1_CSGetConstantBuffers(context, 0, 1, &tmp_cb); + todo_wine ok(!tmp_cb, "Got unexpected buffer %p.\n", tmp_cb); + if (tmp_cb && tmp_cb != (ID3D11Buffer *)0xdeadbeef) ID3D11Buffer_Release(tmp_cb); + tmp_sampler = (ID3D11SamplerState *)0xdeadbeef; + ID3D11DeviceContext1_CSGetSamplers(context, 0, 1, &tmp_sampler); + todo_wine ok(!tmp_sampler, "Got unexpected sampler %p.\n", tmp_sampler); + if (tmp_sampler && tmp_sampler != (ID3D11SamplerState *)0xdeadbeef) ID3D11SamplerState_Release(tmp_sampler); + tmp_cs = (ID3D11ComputeShader *)0xdeadbeef; + ID3D11DeviceContext1_CSGetShader(context, &tmp_cs, NULL, NULL); + if (cs) todo_wine ok(!tmp_cs, "Got unexpected shader %p.\n", tmp_cs); + if (tmp_cs && tmp_cs != (ID3D11ComputeShader *)0xdeadbeef) ID3D11ComputeShader_Release(tmp_cs); + tmp_srv = (ID3D11ShaderResourceView *)0xdeadbeef; + ID3D11DeviceContext1_CSGetShaderResources(context, 0, 1, &tmp_srv); + todo_wine ok(!tmp_srv, "Got unexpected srv %p.\n", tmp_srv); + if (tmp_srv && tmp_srv != (ID3D11ShaderResourceView *)0xdeadbeef) ID3D11ShaderResourceView_Release(tmp_srv); + tmp_uav = (ID3D11UnorderedAccessView *)0xdeadbeef; + ID3D11DeviceContext1_CSGetUnorderedAccessViews(context, 0, 1, &tmp_uav); + todo_wine ok(!tmp_uav, "Got unexpected uav %p.\n", tmp_uav); + if (tmp_uav && tmp_uav != (ID3D11UnorderedAccessView *)0xdeadbeef) ID3D11UnorderedAccessView_Release(tmp_uav); + check_interface(device, &IID_ID3D10Device, TRUE, FALSE); check_interface(device, &IID_ID3D10Device1, TRUE, FALSE);
@@ -7380,9 +7453,31 @@ static void test_device_context_state(void) ok(tmp_srv == srv, "Got srv %p, expected %p.\n", tmp_srv, srv); ID3D11ShaderResourceView_Release(tmp_srv);
+ tmp_sampler = (ID3D11SamplerState *)0xdeadbeef; + ID3D11DeviceContext1_CSGetSamplers(context, 0, 1, &tmp_sampler); + ok(tmp_sampler == sampler, "Got sampler %p, expected %p.\n", tmp_sampler, sampler); + ID3D11SamplerState_Release(tmp_sampler); + tmp_cb = (ID3D11Buffer *)0xdeadbeef; + ID3D11DeviceContext1_CSGetConstantBuffers(context, 0, 1, &tmp_cb); + ok(tmp_cb == cb, "Got buffer %p, expected %p.\n", tmp_cb, cb); + ID3D11Buffer_Release(tmp_cb); + tmp_cs = (ID3D11ComputeShader *)0xdeadbeef; + ID3D11DeviceContext1_CSGetShader(context, &tmp_cs, NULL, NULL); + ok(tmp_cs == cs, "Got shader %p, expected %p.\n", tmp_cs, cs); + if (cs) ID3D11ComputeShader_Release(tmp_cs); + tmp_srv = (ID3D11ShaderResourceView *)0xdeadbeef; + ID3D11DeviceContext1_CSGetShaderResources(context, 0, 1, &tmp_srv); + ok(tmp_srv == srv, "Got srv %p, expected %p.\n", tmp_srv, srv); + ID3D11ShaderResourceView_Release(tmp_srv); + tmp_uav = (ID3D11UnorderedAccessView *)0xdeadbeef; + ID3D11DeviceContext1_CSGetUnorderedAccessViews(context, 0, 1, &tmp_uav); + ok(tmp_uav == uav, "Got uav %p, expected %p.\n", tmp_uav, uav); + ID3D11UnorderedAccessView_Release(tmp_uav); + check_interface(device, &IID_ID3D10Device, TRUE, FALSE); check_interface(device, &IID_ID3D10Device1, TRUE, FALSE);
+ if (cs) ID3D11ComputeShader_Release(cs); if (ds) ID3D11DomainShader_Release(ds); if (hs) ID3D11HullShader_Release(hs); ID3D11PixelShader_Release(ps); @@ -7390,6 +7485,7 @@ static void test_device_context_state(void) ID3D11VertexShader_Release(vs); ID3D11Buffer_Release(cb); ID3D11ShaderResourceView_Release(srv); + ID3D11UnorderedAccessView_Release(uav); ID3D11SamplerState_Release(sampler); ID3D11DeviceContext1_Release(context); refcount = ID3D11Device1_Release(device);
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=84645
Your paranoid android.
=== w10pro64 (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.
=== w2008s64 (64 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.
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=84642
Your paranoid android.
=== w2008s64 (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.
=== 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.
=== wvistau64 (64 bit report) ===
d3d11: d3d11.c:6134: Test failed: Got unexpected NumPrimitivesWritten: 4291757856. d3d11.c:6137: Test failed: Got unexpected PrimitivesStorageNeeded: 4229233976.
On Wed, 27 Jan 2021 at 20:50, Rémi Bernon rbernon@codeweavers.com wrote:
- /* context states may be used with other devices instances too */
- d3d11_device2 = create_device(NULL);
- ok(!!d3d11_device2, "Failed to create device.\n");
- hr = ID3D11Device_QueryInterface(d3d11_device2, &IID_ID3D11Device1, (void **)&device2);
- ok(SUCCEEDED(hr), "Failed to query device interface, hr %#x.\n", hr);
- ID3D11Device_Release(d3d11_device2);
- ID3D11Device1_GetImmediateContext1(device2, &context2);
- ok(!!context2, "Failed to get immediate context.\n");
- ID3D11DeviceContext1_SwapDeviceContextState(context2, context_state, &tmp_context_state);
- ok(!!tmp_context_state, "Failed to get context state.\n");
- tmp_vs = (ID3D11VertexShader *)0xdeadbeef;
- ID3D11DeviceContext1_VSGetShader(context, &tmp_vs, NULL, NULL);
- todo_wine ok(tmp_vs == vs2, "Got shader %p, expected %p.\n", tmp_vs, vs2);
This (only) tests the vertex shader set on the original device context, is that intentional? It may be at least as interesting to test which vertex shader is set on the new device context. This also raises the question whether updates to context2 would be (immediately) visible to the first context. E.g., consider the following sequence:
ID3D11Device1_CreateDeviceContextState(device1, ..., &state); ... ID3D11DeviceContext1_VSSetShader(context1, vs1, NULL, 0); ID3D11DeviceContext1_VSSetShader(context2, vs2, NULL, 0); /* context1: vs1, context2: vs2 */ ID3D11DeviceContext1_SwapDeviceContextState(context1, state, NULL); ID3D11DeviceContext1_VSSetShader(context1, vs3, NULL, 0); /* context1: vs3, context2: vs2 */ ID3D11DeviceContext1_SwapDeviceContextState(context2, state, NULL); /* context1: vs3, does context2 also have vs3 set now? */ ID3D11DeviceContext1_VSSetShader(context2, vs1, NULL, 0); /* context2: vs1, does context1 also have vs1 set now? */
In particular, since the current tests never change or test the state of context2, it would be possible to make them pass by only capturing/applying state on context state swaps when the device matches the device used to create the context state, or even by always applying state to the context corresponding to the device used to create the device context state, regardless of what context ID3D11DeviceContext1_SwapDeviceContextState() was called on.