Commit d2daa8b9 authored by Jan Sikorski's avatar Jan Sikorski Committed by Alexandre Julliard

wined3d: Return error when GetData() is called from a deferred context.

parent fbecfaec
...@@ -1038,6 +1038,7 @@ static void STDMETHODCALLTYPE d3d11_device_context_End(ID3D11DeviceContext1 *ifa ...@@ -1038,6 +1038,7 @@ static void STDMETHODCALLTYPE d3d11_device_context_End(ID3D11DeviceContext1 *ifa
static HRESULT STDMETHODCALLTYPE d3d11_device_context_GetData(ID3D11DeviceContext1 *iface, static HRESULT STDMETHODCALLTYPE d3d11_device_context_GetData(ID3D11DeviceContext1 *iface,
ID3D11Asynchronous *asynchronous, void *data, UINT data_size, UINT data_flags) ID3D11Asynchronous *asynchronous, void *data, UINT data_size, UINT data_flags)
{ {
struct d3d11_device_context *context = impl_from_ID3D11DeviceContext1(iface);
struct d3d_query *query = unsafe_impl_from_ID3D11Asynchronous(asynchronous); struct d3d_query *query = unsafe_impl_from_ID3D11Asynchronous(asynchronous);
unsigned int wined3d_flags; unsigned int wined3d_flags;
HRESULT hr; HRESULT hr;
...@@ -1045,6 +1046,9 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_context_GetData(ID3D11DeviceContex ...@@ -1045,6 +1046,9 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_context_GetData(ID3D11DeviceContex
TRACE("iface %p, asynchronous %p, data %p, data_size %u, data_flags %#x.\n", TRACE("iface %p, asynchronous %p, data %p, data_size %u, data_flags %#x.\n",
iface, asynchronous, data, data_size, data_flags); iface, asynchronous, data, data_size, data_flags);
if (context->type != D3D11_DEVICE_CONTEXT_IMMEDIATE)
return DXGI_ERROR_INVALID_CALL;
if (!data && data_size) if (!data && data_size)
return E_INVALIDARG; return E_INVALIDARG;
......
...@@ -33091,6 +33091,11 @@ static void test_deferred_context_queries(void) ...@@ -33091,6 +33091,11 @@ static void test_deferred_context_queries(void)
ID3D11DeviceContext_ExecuteCommandList(immediate, list, FALSE); ID3D11DeviceContext_ExecuteCommandList(immediate, list, FALSE);
hr = ID3D11DeviceContext_GetData(deferred, query, &data, sizeof(data), 0);
ok(hr == DXGI_ERROR_INVALID_CALL, "Got unexpected hr %#x.\n", hr);
hr = ID3D11DeviceContext_GetData(deferred, query, NULL, 0, 0);
ok(hr == DXGI_ERROR_INVALID_CALL, "Got unexpected hr %#x.\n", hr);
get_query_data(immediate, query, &data, sizeof(data)); get_query_data(immediate, query, &data, sizeof(data));
ok(data.uint == 640 * 480, "Got unexpected query result 0x%08x%08x.\n", data.dword[1], data.dword[0]); ok(data.uint == 640 * 480, "Got unexpected query result 0x%08x%08x.\n", data.dword[1], data.dword[0]);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment