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

d3d11: Implement d3d11_device_CreateQuery().

parent e958d49b
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
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