Henri Verbeet : wined3d: Disable occlusion query support if the implementation has 0 counter bits.

Alexandre Julliard julliard at winehq.org
Tue Apr 23 13:52:23 CDT 2013


Module: wine
Branch: master
Commit: 6fe9e0f033ae072fe5fd6e2b6a09ad9a0bb21783
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6fe9e0f033ae072fe5fd6e2b6a09ad9a0bb21783

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Tue Apr 23 13:21:31 2013 +0200

wined3d: Disable occlusion query support if the implementation has 0 counter bits.

---

 dlls/wined3d/directx.c    |    9 +++++++++
 dlls/wined3d/wined3d_gl.h |    2 ++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 68016e0..392c7eb 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -2809,6 +2809,15 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter)
          * we never render to sRGB surfaces). */
         gl_info->supported[ARB_FRAMEBUFFER_SRGB] = FALSE;
     }
+    if (gl_info->supported[ARB_OCCLUSION_QUERY])
+    {
+        GLint counter_bits;
+
+        GL_EXTCALL(glGetQueryivARB(GL_SAMPLES_PASSED_ARB, GL_QUERY_COUNTER_BITS_ARB, &counter_bits));
+        TRACE("Occlusion query counter has %d bits.\n", counter_bits);
+        if (!counter_bits)
+            gl_info->supported[ARB_OCCLUSION_QUERY] = FALSE;
+    }
 
     wined3d_adapter_init_limits(gl_info);
 
diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h
index f68fdc7..9c4af05 100644
--- a/dlls/wined3d/wined3d_gl.h
+++ b/dlls/wined3d/wined3d_gl.h
@@ -251,8 +251,10 @@ enum wined3d_gl_extension
     USE_GL_FUNC(glDeleteQueriesARB) \
     USE_GL_FUNC(glEndQueryARB) \
     USE_GL_FUNC(glGenQueriesARB) \
+    USE_GL_FUNC(glGetQueryivARB) \
     USE_GL_FUNC(glGetQueryObjectivARB) \
     USE_GL_FUNC(glGetQueryObjectuivARB) \
+    USE_GL_FUNC(glIsQueryARB) \
     /* GL_ARB_point_parameters */ \
     USE_GL_FUNC(glPointParameterfARB) \
     USE_GL_FUNC(glPointParameterfvARB) \




More information about the wine-cvs mailing list