Signed-off-by: Jan Sikorski jsikorski@codeweavers.com --- dlls/d3d11/tests/d3d11.c | 23 +++++++++++++++++++++++ dlls/wined3d/cs.c | 4 ++++ 2 files changed, 27 insertions(+)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 0f8e59573ed..d8c10ab054c 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -32888,6 +32888,29 @@ static void test_deferred_context_rendering(void) ID3D11CommandList_Release(list1); ID3D11DeviceContext_Release(deferred);
+ /* Command lists do not inherit state from the immediate context. */ + + hr = ID3D11Device_CreateDeferredContext(device, 0, &deferred); + ok(hr == S_OK, "Failed to create deferred context, hr %#x.\n", hr); + + ID3D11DeviceContext_ClearRenderTargetView(immediate, test_context.backbuffer_rtv, black); + + ID3D11DeviceContext_OMSetRenderTargets(deferred, 1, &test_context.backbuffer_rtv, NULL); + set_viewport(deferred, 0.0f, 0.0f, 640.0f, 480.0f, 0.0f, 1.0f); + test_context.immediate_context = deferred; + draw_color_quad(&test_context, &white); + test_context.immediate_context = immediate; + hr = ID3D11DeviceContext_FinishCommandList(deferred, FALSE, &list1); + ok(hr == S_OK, "Failed to create command list, hr %#x.\n", hr); + + ID3D11DeviceContext_OMSetBlendState(immediate, green_blend, NULL, D3D11_DEFAULT_SAMPLE_MASK); + ID3D11DeviceContext_ExecuteCommandList(immediate, list1, FALSE); + color = get_texture_color(test_context.backbuffer, 320, 240); + ok(color == 0xffffffff, "Got unexpected color %#08x.\n", color); + + ID3D11CommandList_Release(list1); + ID3D11DeviceContext_Release(deferred); + /* The clearing of state done by FinishCommandList is captured by a * subsequent call to FinishCommandList... */
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 1f03833e0ed..2d295d4660e 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -3637,6 +3637,10 @@ HRESULT CDECL wined3d_deferred_context_create(struct wined3d_device *device, str object->c.ops = &wined3d_deferred_context_ops; object->c.device = device;
+ /* Make sure the first command list gets the state reset when executed. + * Resets for subsequent command lists are encoded in wined3d_deferred_context_record_command_list(). */ + wined3d_device_context_emit_reset_state(&object->c, true); + TRACE("Created deferred context %p.\n", object); *context = &object->c;
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=98929
Your paranoid android.
=== w1064v1809 (32 bit report) ===
d3d11: d3d11.c:5920: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5921: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5922: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5925: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5926: Test failed: Got unexpected CPrimitives count: 0.
=== w1064 (32 bit report) ===
d3d11: d3d11.c:5920: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5921: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5922: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5925: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5926: Test failed: Got unexpected CPrimitives count: 0.
=== w10pro64 (32 bit report) ===
d3d11: d3d11.c:5920: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5921: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5922: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5925: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5926: Test failed: Got unexpected CPrimitives count: 0.
=== debiant2 (32 bit Chinese:China report) ===
d3d11: d3d11.c:9770: Test failed: d3d11.c:15222: Test marked todo: Test 60: Got unexpected color 0xff00ff00 at (2, 0). d3d11.c:9770: Test failed: Got hr 0 for WRITE_DISCARD.