d3d10core: Create wined3d queries for queries.
This commit is contained in:
parent
23981241c1
commit
686546b6d3
|
@ -171,10 +171,42 @@ static const struct ID3D10QueryVtbl d3d10_query_vtbl =
|
|||
d3d10_query_GetDesc,
|
||||
};
|
||||
|
||||
HRESULT d3d10_query_init(struct d3d10_query *query, struct d3d10_device *device, BOOL predicate)
|
||||
HRESULT d3d10_query_init(struct d3d10_query *query, struct d3d10_device *device,
|
||||
const D3D10_QUERY_DESC *desc, BOOL predicate)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
static const enum wined3d_query_type query_type_map[] =
|
||||
{
|
||||
/* D3D10_QUERY_EVENT */ WINED3D_QUERY_TYPE_EVENT,
|
||||
/* D3D10_QUERY_OCCLUSION */ WINED3D_QUERY_TYPE_OCCLUSION,
|
||||
/* D3D10_QUERY_TIMESTAMP */ WINED3D_QUERY_TYPE_TIMESTAMP,
|
||||
/* D3D10_QUERY_TIMESTAMP_DISJOINT */ WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT,
|
||||
/* D3D10_QUERY_PIPELINE_STATISTICS */ WINED3D_QUERY_TYPE_PIPELINE_STATISTICS,
|
||||
/* D3D10_QUERY_OCCLUSION_PREDICATE */ WINED3D_QUERY_TYPE_OCCLUSION,
|
||||
/* D3D10_QUERY_SO_STATISTICS */ WINED3D_QUERY_TYPE_SO_STATISTICS,
|
||||
/* D3D10_QUERY_SO_OVERFLOW_PREDICATE */ WINED3D_QUERY_TYPE_SO_OVERFLOW,
|
||||
};
|
||||
|
||||
if (desc->Query > sizeof(query_type_map) / sizeof(*query_type_map))
|
||||
{
|
||||
FIXME("Unhandled query type %#x.\n", desc->Query);
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
if (desc->MiscFlags)
|
||||
FIXME("Ignoring MiscFlags %#x.\n", desc->MiscFlags);
|
||||
|
||||
query->ID3D10Query_iface.lpVtbl = &d3d10_query_vtbl;
|
||||
query->refcount = 1;
|
||||
|
||||
if (FAILED(hr = wined3d_query_create(device->wined3d_device,
|
||||
query_type_map[desc->Query], &query->wined3d_query)))
|
||||
{
|
||||
WARN("Failed to create wined3d query, hr %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
query->predicate = predicate;
|
||||
query->device = &device->ID3D10Device1_iface;
|
||||
ID3D10Device1_AddRef(query->device);
|
||||
|
|
|
@ -297,11 +297,13 @@ struct d3d10_query
|
|||
ID3D10Query ID3D10Query_iface;
|
||||
LONG refcount;
|
||||
|
||||
struct wined3d_query *wined3d_query;
|
||||
BOOL predicate;
|
||||
ID3D10Device1 *device;
|
||||
};
|
||||
|
||||
HRESULT d3d10_query_init(struct d3d10_query *query, struct d3d10_device *device, BOOL predicate) DECLSPEC_HIDDEN;
|
||||
HRESULT d3d10_query_init(struct d3d10_query *query, struct d3d10_device *device,
|
||||
const D3D10_QUERY_DESC *desc, BOOL predicate) DECLSPEC_HIDDEN;
|
||||
|
||||
/* IDirect3D10Device1 */
|
||||
struct d3d10_device
|
||||
|
|
|
@ -1722,7 +1722,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateQuery(ID3D10Device1 *iface,
|
|||
if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
if (FAILED(hr = d3d10_query_init(object, device, FALSE)))
|
||||
if (FAILED(hr = d3d10_query_init(object, device, desc, FALSE)))
|
||||
{
|
||||
WARN("Failed to initialize query, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
|
@ -1756,7 +1756,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreatePredicate(ID3D10Device1 *ifa
|
|||
if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
if (FAILED(hr = d3d10_query_init(object, device, TRUE)))
|
||||
if (FAILED(hr = d3d10_query_init(object, device, desc, TRUE)))
|
||||
{
|
||||
WARN("Failed to initialize predicate, hr %#x.\n", hr);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
|
|
|
@ -961,7 +961,8 @@ static void test_create_predicate(void)
|
|||
|
||||
query_desc.Query = D3D10_QUERY_SO_OVERFLOW_PREDICATE;
|
||||
hr = ID3D10Device_CreatePredicate(device, &query_desc, &predicate);
|
||||
ok(SUCCEEDED(hr), "Failed to create predicate, hr %#x.\n", hr);
|
||||
todo_wine ok(SUCCEEDED(hr), "Failed to create predicate, hr %#x.\n", hr);
|
||||
if (SUCCEEDED(hr))
|
||||
ID3D10Predicate_Release(predicate);
|
||||
|
||||
refcount = ID3D10Device_Release(device);
|
||||
|
|
|
@ -694,6 +694,9 @@ enum wined3d_pool
|
|||
|
||||
enum wined3d_query_type
|
||||
{
|
||||
WINED3D_QUERY_TYPE_PIPELINE_STATISTICS = 1,
|
||||
WINED3D_QUERY_TYPE_SO_STATISTICS = 2,
|
||||
WINED3D_QUERY_TYPE_SO_OVERFLOW = 3,
|
||||
WINED3D_QUERY_TYPE_VCACHE = 4,
|
||||
WINED3D_QUERY_TYPE_RESOURCE_MANAGER = 5,
|
||||
WINED3D_QUERY_TYPE_VERTEX_STATS = 6,
|
||||
|
|
Loading…
Reference in New Issue