winex11.drv: Simplify test for pbuffer availability

Alexander Monakov amonakov at gmail.com
Sun Mar 31 10:31:56 CDT 2013


Wine's test for pbuffer availability is confusing: the comment correctly
claims that either GLX 1.3 or GLX_SGIX_pbuffer is enough, but then the code
checks that both are present.

Pbuffers are required functionality for GLX 1.3.  Eliminate testing for
GLX_SGIX_pbuffer extension, which is not 100% compatible (e.g.
glXCreateGLXPbufferSGIX argument list is different; Wine requires the GLX 1.3
function glXCreatePbuffer to be present).  Eliminate the confusing comment.

This allows to get pbuffer functionality in Wine when GLX is provided by an
OpenGL interposer library that supports GLX 1.3 but not GLX_SGIX_pbuffer.
-------------- next part --------------
From 27c95389d0ddd0e89b7d087b16fdc4a06edb4102 Mon Sep 17 00:00:00 2001
From: Alexander Monakov <amonakov at gmail.com>
Date: Sun, 31 Mar 2013 19:07:57 +0400
Subject: winex11.drv: Simplify test for pbuffer availability

Wine's test for pbuffer availability is confusing: the comment correctly
claims that either GLX 1.3 or GLX_SGIX_pbuffer is enough, but then the code
checks that both are present.

Pbuffers are required functionality for GLX 1.3.  Eliminate testing for
GLX_SGIX_pbuffer extension, which is not 100% compatible (e.g.
glXCreateGLXPbufferSGIX argument list is different; Wine requires the GLX 1.3
function glXCreatePbuffer to be present).  Eliminate the confusing comment.

This allows to get pbuffer functionality in Wine when GLX is provided by an
OpenGL interposer library that supports GLX 1.3 but not GLX_SGIX_pbuffer.
---
 dlls/winex11.drv/opengl.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index ee62402..37cc575 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -3006,10 +3006,7 @@ static void X11DRV_WineGL_LoadExtensions(void)
 
     if (has_extension( WineGLInfo.glxExtensions, "GLX_ARB_multisample")) register_extension( "WGL_ARB_multisample" );
 
-    /* In general pbuffer functionality requires support in the X-server. The functionality is
-     * available either when the GLX_SGIX_pbuffer is present or when the GLX server version is 1.3.
-     */
-    if ( glxRequireVersion(3) && has_extension( WineGLInfo.glxExtensions, "GLX_SGIX_pbuffer") )
+    if (glxRequireVersion(3))
     {
         register_extension( "WGL_ARB_pbuffer" );
         opengl_funcs.ext.p_wglCreatePbufferARB    = X11DRV_wglCreatePbufferARB;
@@ -3027,7 +3024,7 @@ static void X11DRV_WineGL_LoadExtensions(void)
 
     /* Support WGL_ARB_render_texture when there's support or pbuffer based emulation */
     if (has_extension( WineGLInfo.glxExtensions, "GLX_ARB_render_texture") ||
-        (glxRequireVersion(3) && has_extension( WineGLInfo.glxExtensions, "GLX_SGIX_pbuffer") && use_render_texture_emulation))
+        (glxRequireVersion(3) && use_render_texture_emulation))
     {
         register_extension( "WGL_ARB_render_texture" );
         opengl_funcs.ext.p_wglBindTexImageARB    = X11DRV_wglBindTexImageARB;
-- 
1.7.5.rc3


More information about the wine-patches mailing list