Commit 882a8f2b authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

d3d11: Implement d3d11_immediate_context_GetData().

parent 0f6c5444
......@@ -57,6 +57,7 @@ const char *debug_float4(const float *values) DECLSPEC_HIDDEN;
DXGI_FORMAT dxgi_format_from_wined3dformat(enum wined3d_format_id format) DECLSPEC_HIDDEN;
enum wined3d_format_id wined3dformat_from_dxgi_format(DXGI_FORMAT format) DECLSPEC_HIDDEN;
unsigned int wined3d_getdata_flags_from_d3d11_async_getdata_flags(unsigned int d3d11_flags) DECLSPEC_HIDDEN;
DWORD wined3d_usage_from_d3d11(UINT bind_flags, enum D3D11_USAGE usage) DECLSPEC_HIDDEN;
struct wined3d_resource *wined3d_resource_from_d3d11_resource(ID3D11Resource *resource) DECLSPEC_HIDDEN;
struct wined3d_resource *wined3d_resource_from_d3d10_resource(ID3D10Resource *resource) DECLSPEC_HIDDEN;
......
......@@ -520,10 +520,28 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_End(ID3D11DeviceContext *i
static HRESULT STDMETHODCALLTYPE d3d11_immediate_context_GetData(ID3D11DeviceContext *iface,
ID3D11Asynchronous *asynchronous, void *data, UINT data_size, UINT data_flags)
{
FIXME("iface %p, asynchronous %p, data %p, data_size %u, data_flags %#x stub!\n",
struct d3d_query *query = unsafe_impl_from_ID3D11Asynchronous(asynchronous);
unsigned int wined3d_flags;
HRESULT hr;
TRACE("iface %p, asynchronous %p, data %p, data_size %u, data_flags %#x.\n",
iface, asynchronous, data, data_size, data_flags);
return E_NOTIMPL;
wined3d_flags = wined3d_getdata_flags_from_d3d11_async_getdata_flags(data_flags);
wined3d_mutex_lock();
if (!data_size || wined3d_query_get_data_size(query->wined3d_query) == data_size)
{
hr = wined3d_query_get_data(query->wined3d_query, data, data_size, wined3d_flags);
}
else
{
WARN("Invalid data size %u.\n", data_size);
hr = E_INVALIDARG;
}
wined3d_mutex_unlock();
return hr;
}
static void STDMETHODCALLTYPE d3d11_immediate_context_SetPredication(ID3D11DeviceContext *iface,
......
......@@ -374,6 +374,17 @@ enum wined3d_format_id wined3dformat_from_dxgi_format(DXGI_FORMAT format)
}
}
unsigned int wined3d_getdata_flags_from_d3d11_async_getdata_flags(unsigned int d3d11_flags)
{
if (d3d11_flags & ~D3D11_ASYNC_GETDATA_DONOTFLUSH)
FIXME("Unhandled async getdata flags %#x.\n", d3d11_flags);
if (d3d11_flags & D3D11_ASYNC_GETDATA_DONOTFLUSH)
return 0;
return WINED3DGETDATA_FLUSH;
}
DWORD wined3d_usage_from_d3d11(UINT bind_flags, enum D3D11_USAGE usage)
{
static const DWORD handled = D3D11_BIND_SHADER_RESOURCE
......
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