wined3d: Get rid of redundant ARB_occlusion_query checks.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2016-07-21 15:58:00 +02:00 committed by Alexandre Julliard
parent d18ff87af9
commit a02c7ce751
1 changed files with 45 additions and 60 deletions

View File

@ -337,14 +337,6 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
return S_FALSE; return S_FALSE;
} }
if (!gl_info->supported[ARB_OCCLUSION_QUERY])
{
WARN("%p Occlusion queries not supported. Returning 1.\n", query);
samples = 1;
fill_query_data(data, size, &samples, sizeof(samples));
return S_OK;
}
if (oq->context->tid != GetCurrentThreadId()) if (oq->context->tid != GetCurrentThreadId())
{ {
FIXME("%p Wrong thread, returning 1.\n", query); FIXME("%p Wrong thread, returning 1.\n", query);
@ -461,17 +453,15 @@ static HRESULT wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD
static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD flags) static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD flags)
{ {
struct wined3d_occlusion_query *oq = query->extendedData;
struct wined3d_device *device = query->device; struct wined3d_device *device = query->device;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
struct wined3d_context *context;
TRACE("query %p, flags %#x.\n", query, flags); TRACE("query %p, flags %#x.\n", query, flags);
if (gl_info->supported[ARB_OCCLUSION_QUERY]) /* This is allowed according to MSDN and our tests. Reset the query and
{ * restart. */
struct wined3d_occlusion_query *oq = query->extendedData;
struct wined3d_context *context;
/* This is allowed according to msdn and our tests. Reset the query and restart */
if (flags & WINED3DISSUE_BEGIN) if (flags & WINED3DISSUE_BEGIN)
{ {
if (query->state == QUERY_BUILDING) if (query->state == QUERY_BUILDING)
@ -494,7 +484,8 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW
} }
else else
{ {
if (oq->context) context_free_occlusion_query(oq); if (oq->context)
context_free_occlusion_query(oq);
context = context_acquire(query->device, NULL); context = context_acquire(query->device, NULL);
context_alloc_occlusion_query(context, oq); context_alloc_occlusion_query(context, oq);
} }
@ -506,10 +497,9 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW
} }
if (flags & WINED3DISSUE_END) if (flags & WINED3DISSUE_END)
{ {
/* Msdn says _END on a non-building occlusion query returns an error, but /* MSDN says END on a non-building occlusion query returns an error,
* our tests show that it returns OK. But OpenGL doesn't like it, so avoid * but our tests show that it returns OK. But OpenGL doesn't like it,
* generating an error * so avoid generating an error. */
*/
if (query->state == QUERY_BUILDING) if (query->state == QUERY_BUILDING)
{ {
if (oq->context->tid != GetCurrentThreadId()) if (oq->context->tid != GetCurrentThreadId())
@ -527,11 +517,6 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW
} }
} }
} }
}
else
{
FIXME("%p Occlusion queries not supported.\n", query);
}
if (flags & WINED3DISSUE_BEGIN) if (flags & WINED3DISSUE_BEGIN)
query->state = QUERY_BUILDING; query->state = QUERY_BUILDING;