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(a)codeweavers.com>
---
v3: Fix size of created constant buffers. Make description a bit more
specific.
---
dlls/d3d11/device.c | 4 ++--
dlls/d3d11/tests/d3d11.c | 36 ++++++++++++++++++++++++++++++++++++
2 files changed, 38 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..90dadf84149 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -30062,6 +30062,41 @@ 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, 0xdeadbeef, 0xdeadbeef,
0xdeadbeef,
+ 0xbaadf00d, 0xbaadf00d, 0xbaadf00d, 0xbaadf00d};
+ ID3D11DeviceContext *immediate_context;
+ ID3D11CommandList *command_list;
+ 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[0] = create_buffer(device, D3D11_BIND_CONSTANT_BUFFER, 16,
&buffer_contents[0]);
+ buffer[1] = create_buffer(device, D3D11_BIND_CONSTANT_BUFFER, 16,
&buffer_contents[4]);
+
+ 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 +30260,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();
}
--
2.24.0