This is only used with deferred contexts to record all commands thus far submitted to a command list object. It has no effect on immediate contexts.
Signed-off-by: Chip Davis cdavis@codeweavers.com --- v2: Add tests. Reword description. --- dlls/d3d11/device.c | 4 ++-- dlls/d3d11/tests/d3d11.c | 50 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 7544bc86f4b..01b32002408 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -2416,9 +2416,9 @@ static UINT STDMETHODCALLTYPE d3d11_immediate_context_GetContextFlags(ID3D11Devi static HRESULT STDMETHODCALLTYPE d3d11_immediate_context_FinishCommandList(ID3D11DeviceContext1 *iface, BOOL restore, ID3D11CommandList **command_list) { - FIXME("iface %p, restore %#x, command_list %p stub!\n", iface, restore, command_list); + WARN("iface %p, restore %#x, command_list %p called on immediate context.\n", iface, restore, command_list);
- return E_NOTIMPL; + return DXGI_ERROR_INVALID_CALL; }
static void STDMETHODCALLTYPE d3d11_immediate_context_CopySubresourceRegion1(ID3D11DeviceContext1 *iface, diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 3ae05537a1e..41e7ca7aa23 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -30062,6 +30062,55 @@ static void test_dual_source_blend(void) release_test_context(&test_context); }
+static void test_deferred_methods_on_immediate_context(void) +{ + static const unsigned int buffer_contents[] = {0xdeadbeef, 0xbaadf00d}; + ID3D11DeviceContext *immediate_context; + D3D11_SUBRESOURCE_DATA buffer_data; + ID3D11CommandList *command_list; + D3D11_BUFFER_DESC buffer_desc; + ID3D11Buffer *buffer[2]; + ID3D11Device *device; + HRESULT hr; + + if (!(device = create_device(NULL))) + { + skip("Failed to create device.\n"); + return; + } + + ID3D11Device_GetImmediateContext(device, &immediate_context); + + hr = ID3D11DeviceContext_FinishCommandList(immediate_context, FALSE, &command_list); + ok(hr == DXGI_ERROR_INVALID_CALL, "Immediate FinishCommandList returned hr %#x.\n", hr); + + buffer_desc.ByteWidth = 4; + buffer_desc.Usage = D3D11_USAGE_DEFAULT; + buffer_desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; + buffer_desc.CPUAccessFlags = 0; + buffer_desc.MiscFlags = 0; + buffer_desc.StructureByteStride = 0; + + buffer_data.pSysMem = &buffer_contents[0]; + buffer_data.SysMemPitch = buffer_data.SysMemSlicePitch = 0; + hr = ID3D11Device_CreateBuffer(device, &buffer_desc, &buffer_data, &buffer[0]); + ok(hr == S_OK, "Failed to create buffer, hr %#x.\n", hr); + + buffer_data.pSysMem = &buffer_contents[1]; + hr = ID3D11Device_CreateBuffer(device, &buffer_desc, &buffer_data, &buffer[1]); + ok(hr == S_OK, "Failed to create buffer, hr %#x.\n", hr); + + ID3D11DeviceContext_CopyResource(immediate_context, buffer[1], buffer[0]); + + hr = ID3D11DeviceContext_FinishCommandList(immediate_context, FALSE, &command_list); + ok(hr == DXGI_ERROR_INVALID_CALL, "Immediate FinishCommandList returned hr %#x.\n", hr); + + ID3D11DeviceContext_Release(immediate_context); + ID3D11Buffer_Release(buffer[0]); + ID3D11Buffer_Release(buffer[1]); + ID3D11Device_Release(device); +} + START_TEST(d3d11) { unsigned int argc, i; @@ -30225,6 +30274,7 @@ START_TEST(d3d11) queue_test(test_color_mask); queue_test(test_independent_blend); queue_test(test_dual_source_blend); + queue_test(test_deferred_methods_on_immediate_context);
run_queued_tests(); }
This returns the flags that were passed to ID3D11Device::CreateDeferredContext(). It has no meaning for immediate contexts, and there are no flags defined anyway.
Signed-off-by: Chip Davis cdavis@codeweavers.com --- v2: Add tests. Reword description. --- dlls/d3d11/device.c | 2 +- dlls/d3d11/tests/d3d11.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 01b32002408..207d3869c27 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -2408,7 +2408,7 @@ static D3D11_DEVICE_CONTEXT_TYPE STDMETHODCALLTYPE d3d11_immediate_context_GetTy
static UINT STDMETHODCALLTYPE d3d11_immediate_context_GetContextFlags(ID3D11DeviceContext1 *iface) { - FIXME("iface %p stub!\n", iface); + WARN("iface %p called on immediate context.\n", iface);
return 0; } diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 41e7ca7aa23..a732d19d08e 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -30071,6 +30071,7 @@ static void test_deferred_methods_on_immediate_context(void) D3D11_BUFFER_DESC buffer_desc; ID3D11Buffer *buffer[2]; ID3D11Device *device; + unsigned int flags; HRESULT hr;
if (!(device = create_device(NULL))) @@ -30081,6 +30082,9 @@ static void test_deferred_methods_on_immediate_context(void)
ID3D11Device_GetImmediateContext(device, &immediate_context);
+ flags = ID3D11DeviceContext_GetContextFlags(immediate_context); + ok(flags == 0, "Immediate context has flags %#x.\n", flags); + hr = ID3D11DeviceContext_FinishCommandList(immediate_context, FALSE, &command_list); ok(hr == DXGI_ERROR_INVALID_CALL, "Immediate FinishCommandList returned hr %#x.\n", hr);
Signed-off-by: Chip Davis cdavis@codeweavers.com --- v2: Unchanged. --- dlls/wined3d/device.c | 7 +++++++ dlls/wined3d/wined3d.spec | 1 + include/wine/wined3d.h | 1 + 3 files changed, 9 insertions(+)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 1711014c8d2..1325b5d6036 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4834,6 +4834,13 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device) } }
+void CDECL wined3d_device_flush(struct wined3d_device *device) +{ + TRACE("device %p.\n", device); + + wined3d_cs_emit_flush(device->cs); +} + static void update_swapchain_flags(struct wined3d_texture *texture) { unsigned int flags = texture->swapchain->state.desc.flags; diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 22a9a9dd740..75c0163c258 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -53,6 +53,7 @@ @ cdecl wined3d_device_draw_primitive_instanced_indirect(ptr ptr long) @ cdecl wined3d_device_end_scene(ptr) @ cdecl wined3d_device_evict_managed_resources(ptr) +@ cdecl wined3d_device_flush(ptr) @ cdecl wined3d_device_get_available_texture_mem(ptr) @ cdecl wined3d_device_get_blend_state(ptr ptr) @ cdecl wined3d_device_get_clip_status(ptr ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index d3eb8100cd8..a53d862602d 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2333,6 +2333,7 @@ void __cdecl wined3d_device_draw_primitive_instanced_indirect(struct wined3d_dev struct wined3d_buffer *buffer, unsigned int offset); HRESULT __cdecl wined3d_device_end_scene(struct wined3d_device *device); void __cdecl wined3d_device_evict_managed_resources(struct wined3d_device *device); +void __cdecl wined3d_device_flush(struct wined3d_device *device); UINT __cdecl wined3d_device_get_available_texture_mem(const struct wined3d_device *device); struct wined3d_blend_state * __cdecl wined3d_device_get_blend_state(const struct wined3d_device *device, struct wined3d_color *blend_factor);
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=71757
Your paranoid android.
=== debiant (32 bit report) ===
d3d11: d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30105: Test failed: Failed to create buffer, hr 0x80070057. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x65168a2d).
Report validation errors: d3d11:d3d11 crashed (c0000005)
=== debiant (32 bit Chinese:China report) ===
d3d11: d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30105: Test failed: Failed to create buffer, hr 0x80070057. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x65168a2d).
Report validation errors: d3d11:d3d11 crashed (c0000005)
=== debiant (32 bit WoW report) ===
d3d11: d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30105: Test failed: Failed to create buffer, hr 0x80070057. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x65168a2d).
Report validation errors: d3d11:d3d11 crashed (c0000005)
=== debiant (64 bit WoW report) ===
d3d11: d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30105: Test failed: Failed to create buffer, hr 0x80070057. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x65168a2d).
Report validation errors: d3d11:d3d11 crashed (c0000005)
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=71756
Your paranoid android.
=== w2008s64 (32 bit report) ===
d3d11: d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30105: Test failed: Failed to create buffer, hr 0x80070057. 0390:d3d11: unhandled exception c0000005 at 004021C5
=== w8 (32 bit report) ===
d3d11: d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30105: Test failed: Failed to create buffer, hr 0x80070057. 0c78:d3d11: unhandled exception c0000005 at 004021C5
=== w8adm (32 bit report) ===
d3d11: d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30105: Test failed: Failed to create buffer, hr 0x80070057. 0cf4:d3d11: unhandled exception c0000005 at 004021C5
=== w1064v1507 (32 bit report) ===
d3d11: d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30105: Test failed: Failed to create buffer, hr 0x80070057. 0fbc:d3d11: unhandled exception c0000005 at 004021C5
=== w1064v1809 (32 bit report) ===
d3d11: d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30105: Test failed: Failed to create buffer, hr 0x80070057. 1830:d3d11: unhandled exception c0000005 at 004021C5
=== w1064v1809_2scr (32 bit report) ===
d3d11: d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30105: Test failed: Failed to create buffer, hr 0x80070057.
=== w1064v1809_ar (32 bit report) ===
d3d11: d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30105: Test failed: Failed to create buffer, hr 0x80070057.
=== w1064v1809_he (32 bit report) ===
d3d11: d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30105: Test failed: Failed to create buffer, hr 0x80070057.
=== w1064v1809_ja (32 bit report) ===
d3d11: d3d11.c:5775: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5776: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5777: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5780: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5781: Test failed: Got unexpected CPrimitives count: 0. d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30105: Test failed: Failed to create buffer, hr 0x80070057.
=== w1064v1809_zh_CN (32 bit report) ===
d3d11: d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30105: Test failed: Failed to create buffer, hr 0x80070057.
=== w2008s64 (64 bit report) ===
d3d11: d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30105: Test failed: Failed to create buffer, hr 0x80070057. 06dc:d3d11: unhandled exception c0000005 at 00000000004020E5
=== w864 (64 bit report) ===
d3d11: d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30105: Test failed: Failed to create buffer, hr 0x80070057. 0c34:d3d11: unhandled exception c0000005 at 00000000004020E5
=== w1064v1507 (64 bit report) ===
d3d11: d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30105: Test failed: Failed to create buffer, hr 0x80070057. 0c68:d3d11: unhandled exception c0000005 at 00000000004020E5
=== w1064v1809 (64 bit report) ===
d3d11: d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30105: Test failed: Failed to create buffer, hr 0x80070057.
=== debiant (32 bit report) ===
d3d11: d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30105: Test failed: Failed to create buffer, hr 0x80070057. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x65168a2d).
Report validation errors: d3d11:d3d11 crashed (c0000005)
=== debiant (32 bit French report) ===
d3d11: d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30105: Test failed: Failed to create buffer, hr 0x80070057. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x65168a2d).
Report validation errors: d3d11:d3d11 crashed (c0000005)
=== debiant (32 bit Japanese:Japan report) ===
d3d11: d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30105: Test failed: Failed to create buffer, hr 0x80070057. Unhandled exception: page fault on execute access to 0xacc9accb in 32-bit code (0xacc9accb).
Report validation errors: d3d11:d3d11 crashed (c0000005)
=== debiant (32 bit Chinese:China report) ===
d3d11: d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30105: Test failed: Failed to create buffer, hr 0x80070057. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x65168a2d).
Report validation errors: d3d11:d3d11 crashed (c0000005)
=== debiant (32 bit WoW report) ===
d3d11: d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30105: Test failed: Failed to create buffer, hr 0x80070057. Unhandled exception: page fault on execute access to 0x00ad19c0 in 32-bit code (0x00ad19c0).
Report validation errors: d3d11:d3d11 crashed (c0000005)
=== debiant (64 bit WoW report) ===
d3d11: d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30105: Test failed: Failed to create buffer, hr 0x80070057. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x65168a2d).
Report validation errors: d3d11:d3d11 crashed (c0000005)
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=71755
Your paranoid android.
=== w2008s64 (32 bit report) ===
d3d11: d3d11.c:30097: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. 0390:d3d11: unhandled exception c0000005 at 00402183
=== w8 (32 bit report) ===
d3d11: d3d11.c:30097: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. 0c9c:d3d11: unhandled exception c0000005 at 00402183
=== w8adm (32 bit report) ===
d3d11: d3d11.c:30097: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. 0cfc:d3d11: unhandled exception c0000005 at 00402183
=== w1064v1507 (32 bit report) ===
d3d11: d3d11.c:30097: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. 0c80:d3d11: unhandled exception c0000005 at 00402183
=== w1064v1809 (32 bit report) ===
d3d11: d3d11.c:30097: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. 137c:d3d11: unhandled exception c0000005 at 00402183
=== w1064v1809_2scr (32 bit report) ===
d3d11: d3d11.c:30097: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057.
=== w1064v1809_ar (32 bit report) ===
d3d11: d3d11.c:5775: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5776: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5777: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5780: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5781: Test failed: Got unexpected CPrimitives count: 0. d3d11.c:30097: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057.
=== w1064v1809_he (32 bit report) ===
d3d11: d3d11.c:5775: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5776: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5777: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5780: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5781: Test failed: Got unexpected CPrimitives count: 0. d3d11.c:30097: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057.
=== w1064v1809_ja (32 bit report) ===
d3d11: d3d11.c:5775: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5776: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5777: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5780: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5781: Test failed: Got unexpected CPrimitives count: 0. d3d11.c:30097: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057.
=== w1064v1809_zh_CN (32 bit report) ===
d3d11: d3d11.c:30097: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057.
=== w2008s64 (64 bit report) ===
d3d11: d3d11.c:30097: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. 0390:d3d11: unhandled exception c0000005 at 00000000004020AE
=== w864 (64 bit report) ===
d3d11: d3d11.c:30097: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. 0e84:d3d11: unhandled exception c0000005 at 00000000004020AE
=== w1064v1507 (64 bit report) ===
d3d11: d3d11.c:30097: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. 0ffc:d3d11: unhandled exception c0000005 at 00000000004020AE
=== w1064v1809 (64 bit report) ===
d3d11: d3d11.c:30097: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057.
=== debiant (32 bit report) ===
d3d11: d3d11.c:30097: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. Unhandled exception: page fault on execute access to 0x00610054 in 32-bit code (0x00610054).
Report validation errors: d3d11:d3d11 crashed (c0000005)
=== debiant (32 bit French report) ===
d3d11: d3d11.c:30097: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x65168a2d).
Report validation errors: d3d11:d3d11 crashed (c0000005)
=== debiant (32 bit Japanese:Japan report) ===
d3d11: d3d11.c:30097: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x65168a2d).
Report validation errors: d3d11:d3d11 crashed (c0000005)
=== debiant (32 bit Chinese:China report) ===
d3d11: d3d11.c:30097: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057.
=== debiant (32 bit WoW report) ===
d3d11: d3d11.c:30097: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. Unhandled exception: page fault on read access to 0x00000000 in 32-bit code (0x65168a2d).
Report validation errors: d3d11:d3d11 crashed (c0000005)
=== debiant (64 bit WoW report) ===
d3d11: d3d11.c:30097: Test failed: Failed to create buffer, hr 0x80070057. d3d11.c:30101: Test failed: Failed to create buffer, hr 0x80070057. Unhandled exception: page fault on read access to 0x00000388 in 32-bit code (0x65168a36).
Report validation errors: d3d11:d3d11 crashed (c0000005)