Module: wine Branch: master Commit: 6fbb93a3a1b832a6cea59ff4feba2a75db19e9d3 URL: http://source.winehq.org/git/wine.git/?a=commit;h=6fbb93a3a1b832a6cea59ff4fe...
Author: Józef Kucia jkucia@codeweavers.com Date: Mon Nov 21 15:15:55 2016 +0100
wined3d: Use glGetQueryObjectui64v() for occlusion queries when available.
Signed-off-by: Józef Kucia jkucia@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
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 d95d21f..77dad45 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)); }