Signed-off-by: Zebediah Figura z.figura12@gmail.com --- This does take up a lot of space in the CS queue, though. It may make more sense to add another CS op instead...
dlls/d3d11/tests/d3d11.c | 39 +++++++++++++-------------------------- dlls/wined3d/cs.c | 11 ++++------- 2 files changed, 17 insertions(+), 33 deletions(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index d799bed25f4..8da0cfaa8bf 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -32281,15 +32281,7 @@ static void test_deferred_context_state(void) ID3D11Buffer_Release(ret_buffer);
hr = ID3D11DeviceContext_FinishCommandList(deferred, TRUE, &list1); - todo_wine ok(hr == S_OK, "Failed to create command list, hr %#x.\n", hr); - if (hr != S_OK) - { - ID3D11DeviceContext_Release(deferred); - ID3D11Buffer_Release(blue_buffer); - ID3D11Buffer_Release(green_buffer); - release_test_context(&test_context); - return; - } + ok(hr == S_OK, "Failed to create command list, hr %#x.\n", hr);
ID3D11DeviceContext_PSGetConstantBuffers(deferred, 0, 1, &ret_buffer); ok(ret_buffer == blue_buffer, "Got unexpected buffer %p.\n", ret_buffer); @@ -32310,7 +32302,9 @@ static void test_deferred_context_state(void) ID3D11DeviceContext_PSSetConstantBuffers(immediate, 0, 1, &green_buffer); ID3D11DeviceContext_ExecuteCommandList(immediate, list1, FALSE); ID3D11DeviceContext_PSGetConstantBuffers(immediate, 0, 1, &ret_buffer); - ok(!ret_buffer, "Got unexpected buffer %p.\n", ret_buffer); + todo_wine ok(!ret_buffer, "Got unexpected buffer %p.\n", ret_buffer); + if (ret_buffer) + ID3D11Buffer_Release(ret_buffer);
ID3D11CommandList_Release(list2); ID3D11CommandList_Release(list1); @@ -32484,16 +32478,7 @@ static void test_deferred_context_rendering(void) ID3D11DeviceContext_ClearRenderTargetView(deferred, test_context.backbuffer_rtv, green);
hr = ID3D11DeviceContext_FinishCommandList(deferred, TRUE, &list1); - todo_wine ok(hr == S_OK, "Failed to create command list, hr %#x.\n", hr); - if (hr != S_OK) - { - ID3D11BlendState_Release(red_blend); - ID3D11BlendState_Release(green_blend); - ID3D11BlendState_Release(blue_blend); - ID3D11DeviceContext_Release(deferred); - release_test_context(&test_context); - return; - } + ok(hr == S_OK, "Failed to create command list, hr %#x.\n", hr);
hr = ID3D11DeviceContext_FinishCommandList(deferred, TRUE, &list2); ok(hr == S_OK, "Failed to create command list, hr %#x.\n", hr); @@ -32503,12 +32488,12 @@ static void test_deferred_context_rendering(void)
ID3D11DeviceContext_ExecuteCommandList(immediate, list1, TRUE); color = get_texture_color(test_context.backbuffer, 320, 240); - ok(color == 0xff00ff00, "Got unexpected color %#08x.\n", color); + todo_wine ok(color == 0xff00ff00, "Got unexpected color %#08x.\n", color);
ID3D11DeviceContext_ClearRenderTargetView(immediate, test_context.backbuffer_rtv, &white.x); ID3D11DeviceContext_ExecuteCommandList(immediate, list1, TRUE); color = get_texture_color(test_context.backbuffer, 320, 240); - ok(color == 0xff00ff00, "Got unexpected color %#08x.\n", color); + todo_wine ok(color == 0xff00ff00, "Got unexpected color %#08x.\n", color);
ID3D11DeviceContext_ClearRenderTargetView(immediate, test_context.backbuffer_rtv, &white.x); ID3D11DeviceContext_ExecuteCommandList(immediate, list2, TRUE); @@ -32524,7 +32509,7 @@ static void test_deferred_context_rendering(void) ID3D11DeviceContext_ClearRenderTargetView(immediate, test_context.backbuffer_rtv, &white.x); ID3D11DeviceContext_ExecuteCommandList(immediate, list2, TRUE); color = get_texture_color(test_context.backbuffer, 320, 240); - ok(color == 0xff00ff00, "Got unexpected color %#08x.\n", color); + todo_wine ok(color == 0xff00ff00, "Got unexpected color %#08x.\n", color);
ID3D11CommandList_Release(list2); ID3D11CommandList_Release(list1); @@ -32550,7 +32535,7 @@ static void test_deferred_context_rendering(void) ID3D11DeviceContext_ClearRenderTargetView(immediate, rtv, blue); ID3D11DeviceContext_ExecuteCommandList(immediate, list1, TRUE); color = get_texture_color(test_context.backbuffer, 320, 240); - ok(color == 0xffff0000, "Got unexpected color %#08x.\n", color); + todo_wine ok(color == 0xffff0000, "Got unexpected color %#08x.\n", color);
ID3D11CommandList_Release(list1); ID3D11DeviceContext_Release(deferred); @@ -32584,10 +32569,12 @@ static void test_deferred_context_rendering(void) set_viewport(immediate, 0.0f, 0.0f, 640.0f, 480.0f, 0.0f, 1.0f); draw_color_quad(&test_context, &white); color = get_texture_color(test_context.backbuffer, 320, 240); - ok(color == 0xffffffff, "Got unexpected color %#08x.\n", color); + todo_wine ok(color == 0xffffffff, "Got unexpected color %#08x.\n", color);
ID3D11DeviceContext_OMGetBlendState(immediate, &ret_blend, blend_factor, &sample_mask); - ok(!ret_blend, "Got unexpected blend state %p.\n", ret_blend); + todo_wine ok(!ret_blend, "Got unexpected blend state %p.\n", ret_blend); + if (ret_blend) + ID3D11BlendState_Release(ret_blend);
ID3D11CommandList_Release(list1); ID3D11DeviceContext_Release(deferred); diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 137f979ae4a..a3b7cebce2a 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -3396,12 +3396,6 @@ HRESULT CDECL wined3d_deferred_context_record_command_list(struct wined3d_device
TRACE("context %p, list %p.\n", context, list);
- if (restore) - { - FIXME("Restoring context state is not implemented.\n"); - return E_NOTIMPL; - } - if (!(object = heap_alloc_zero(sizeof(*object)))) return E_OUTOFMEMORY;
@@ -3430,7 +3424,10 @@ HRESULT CDECL wined3d_deferred_context_record_command_list(struct wined3d_device deferred->resource_count = 0;
/* This is in fact recorded into a subsequent command list. */ - wined3d_device_context_reset_state(&deferred->c); + if (restore) + wined3d_device_context_set_state(&deferred->c, deferred->c.state); + else + wined3d_device_context_reset_state(&deferred->c);
TRACE("Created command list %p.\n", object); *list = object;