diff --git a/dlls/d3d11/async.c b/dlls/d3d11/async.c index 2e57ed6f451..fa384844a99 100644 --- a/dlls/d3d11/async.c +++ b/dlls/d3d11/async.c @@ -292,9 +292,27 @@ static void STDMETHODCALLTYPE d3d10_query_End(ID3D10Query *iface) static HRESULT STDMETHODCALLTYPE d3d10_query_GetData(ID3D10Query *iface, void *data, UINT data_size, UINT flags) { - FIXME("iface %p, data %p, data_size %u, flags %#x stub!\n", iface, data, data_size, flags); + struct d3d_query *query = impl_from_ID3D10Query(iface); + unsigned int wined3d_flags; + HRESULT hr; - return E_NOTIMPL; + TRACE("iface %p, data %p, data_size %u, flags %#x.\n", iface, data, data_size, flags); + + wined3d_flags = wined3d_getdata_flags_from_d3d11_async_getdata_flags(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 UINT STDMETHODCALLTYPE d3d10_query_GetDataSize(ID3D10Query *iface)