diff --git a/dlls/d3d11/async.c b/dlls/d3d11/async.c index 3b9bb812134..1e96fb3516b 100644 --- a/dlls/d3d11/async.c +++ b/dlls/d3d11/async.c @@ -303,7 +303,7 @@ struct d3d_query *unsafe_impl_from_ID3D10Query(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) { HRESULT hr; diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h index 722f2666312..fcd47421a37 100644 --- a/dlls/d3d11/d3d11_private.h +++ b/dlls/d3d11/d3d11_private.h @@ -363,8 +363,6 @@ struct d3d_query 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, struct d3d_query **query) DECLSPEC_HIDDEN; struct d3d_query *unsafe_impl_from_ID3D10Query(ID3D10Query *iface) DECLSPEC_HIDDEN; diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index f5aca827b7e..5f567abe7e3 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -1583,11 +1583,20 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateSamplerState(ID3D11Device *i } 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, @@ -3726,17 +3735,9 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateQuery(ID3D10Device1 *iface, TRACE("iface %p, desc %p, query %p.\n", iface, desc, query); - if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*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); + if (FAILED(hr = d3d_query_create(device, (const D3D11_QUERY_DESC *)desc, FALSE, &object))) return hr; - } - TRACE("Created query %p.\n", object); *query = &object->ID3D10Query_iface; return S_OK;