d3d11: Implement d3d11_device_CreateQuery().

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2015-10-27 03:02:31 +01:00 committed by Alexandre Julliard
parent e958d49b06
commit bd1bb06d84
3 changed files with 14 additions and 15 deletions

View File

@ -303,7 +303,7 @@ struct d3d_query *unsafe_impl_from_ID3D10Query(ID3D10Query *iface)
return CONTAINING_RECORD(iface, struct d3d_query, ID3D10Query_iface); return CONTAINING_RECORD(iface, struct d3d_query, ID3D10Query_iface);
} }
HRESULT d3d_query_init(struct d3d_query *query, struct d3d_device *device, static HRESULT d3d_query_init(struct d3d_query *query, struct d3d_device *device,
const D3D11_QUERY_DESC *desc, BOOL predicate) const D3D11_QUERY_DESC *desc, BOOL predicate)
{ {
HRESULT hr; HRESULT hr;

View File

@ -363,8 +363,6 @@ struct d3d_query
ID3D11Device *device; ID3D11Device *device;
}; };
HRESULT d3d_query_init(struct d3d_query *query, struct d3d_device *device,
const D3D11_QUERY_DESC *desc, BOOL predicate) DECLSPEC_HIDDEN;
HRESULT d3d_query_create(struct d3d_device *device, const D3D11_QUERY_DESC *desc, BOOL predicate, HRESULT d3d_query_create(struct d3d_device *device, const D3D11_QUERY_DESC *desc, BOOL predicate,
struct d3d_query **query) DECLSPEC_HIDDEN; struct d3d_query **query) DECLSPEC_HIDDEN;
struct d3d_query *unsafe_impl_from_ID3D10Query(ID3D10Query *iface) DECLSPEC_HIDDEN; struct d3d_query *unsafe_impl_from_ID3D10Query(ID3D10Query *iface) DECLSPEC_HIDDEN;

View File

@ -1583,11 +1583,20 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateSamplerState(ID3D11Device *i
} }
static HRESULT STDMETHODCALLTYPE d3d11_device_CreateQuery(ID3D11Device *iface, static HRESULT STDMETHODCALLTYPE d3d11_device_CreateQuery(ID3D11Device *iface,
const D3D11_QUERY_DESC *desc, ID3D11Query **query) const D3D11_QUERY_DESC *desc, ID3D11Query **query)
{ {
FIXME("iface %p, desc %p, query %p stub!\n", iface, desc, query); struct d3d_device *device = impl_from_ID3D11Device(iface);
struct d3d_query *object;
HRESULT hr;
return E_NOTIMPL; TRACE("iface %p, desc %p, query %p.\n", iface, desc, query);
if (FAILED(hr = d3d_query_create(device, desc, FALSE, &object)))
return hr;
*query = &object->ID3D11Query_iface;
return S_OK;
} }
static HRESULT STDMETHODCALLTYPE d3d11_device_CreatePredicate(ID3D11Device *iface, const D3D11_QUERY_DESC *desc, static HRESULT STDMETHODCALLTYPE d3d11_device_CreatePredicate(ID3D11Device *iface, const D3D11_QUERY_DESC *desc,
@ -3726,17 +3735,9 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateQuery(ID3D10Device1 *iface,
TRACE("iface %p, desc %p, query %p.\n", iface, desc, query); TRACE("iface %p, desc %p, query %p.\n", iface, desc, query);
if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) if (FAILED(hr = d3d_query_create(device, (const D3D11_QUERY_DESC *)desc, FALSE, &object)))
return E_OUTOFMEMORY;
if (FAILED(hr = d3d_query_init(object, device, (const D3D11_QUERY_DESC *)desc, FALSE)))
{
WARN("Failed to initialize query, hr %#x.\n", hr);
HeapFree(GetProcessHeap(), 0, object);
return hr; return hr;
}
TRACE("Created query %p.\n", object);
*query = &object->ID3D10Query_iface; *query = &object->ID3D10Query_iface;
return S_OK; return S_OK;