From 6fbb93a3a1b832a6cea59ff4feba2a75db19e9d3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B3zef=20Kucia?= Date: Mon, 21 Nov 2016 15:15:55 +0100 Subject: [PATCH] wined3d: Use glGetQueryObjectui64v() for occlusion queries when available. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/query.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c index d95d21f947c..77dad45e00d 100644 --- a/dlls/wined3d/query.c +++ b/dlls/wined3d/query.c @@ -386,10 +386,20 @@ static BOOL wined3d_occlusion_query_ops_poll(struct wined3d_query *query) if (available) { - GLuint result; - GL_EXTCALL(glGetQueryObjectuiv(oq->id, GL_QUERY_RESULT, &result)); - checkGLcall("glGetQueryObjectuiv(GL_QUERY_RESULT)"); - oq->samples = result; + if (gl_info->supported[ARB_TIMER_QUERY]) + { + GLuint64 result; + GL_EXTCALL(glGetQueryObjectui64v(oq->id, GL_QUERY_RESULT, &result)); + checkGLcall("glGetQueryObjectui64v(GL_QUERY_RESULT)"); + oq->samples = result; + } + else + { + GLuint result; + GL_EXTCALL(glGetQueryObjectuiv(oq->id, GL_QUERY_RESULT, &result)); + checkGLcall("glGetQueryObjectuiv(GL_QUERY_RESULT)"); + oq->samples = result; + } TRACE("Returning 0x%s samples.\n", wine_dbgstr_longlong(oq->samples)); } -- 2.11.4.GIT