[PATCH 4/6] wined3d: Use glGetQueryObjectui64v() for occlusion queries when available.

Józef Kucia jkucia at codeweavers.com
Mon Nov 21 08:15:55 CST 2016


Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 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));
     }
 
-- 
2.7.3




More information about the wine-patches mailing list