Roderick Colenbrander : wgl: Fix a violation of the GLX specs in ConvertAttribWGLtoGLX.
Alexandre Julliard
julliard at winehq.org
Thu Nov 12 10:22:08 CST 2009
Module: wine
Branch: master
Commit: 521598560e95b4190367c9c09a45fcb559627150
URL: http://source.winehq.org/git/wine.git/?a=commit;h=521598560e95b4190367c9c09a45fcb559627150
Author: Roderick Colenbrander <thunderbird2k at gmail.com>
Date: Wed Nov 11 16:27:43 2009 +0100
wgl: Fix a violation of the GLX specs in ConvertAttribWGLtoGLX.
Nvidia and Mesa ignore GLX_RENDER_TYPE when it is set to an invalid
value like 0 but AMD for instance doesn't, which is legal.
---
dlls/winex11.drv/opengl.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index 9f97099..6171f9b 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -600,7 +600,7 @@ static int ConvertAttribWGLtoGLX(const int* iWGLAttr, int* oGLXAttr, Wine_GLPBuf
int pop;
int drawattrib = 0;
int nvfloatattrib = GLX_DONT_CARE;
- int pixelattrib = 0;
+ int pixelattrib = ~0;
/* The list of WGL attributes is allowed to be NULL. We don't return here for NULL
* because we need to do fixups for GLX_DRAWABLE_TYPE/GLX_RENDER_TYPE/GLX_FLOAT_COMPONENTS_NV. */
@@ -801,7 +801,9 @@ static int ConvertAttribWGLtoGLX(const int* iWGLAttr, int* oGLXAttr, Wine_GLPBuf
PUSH2(oGLXAttr, GLX_DRAWABLE_TYPE, drawattrib);
TRACE("pAttr[?] = GLX_DRAWABLE_TYPE: %#x\n", drawattrib);
- /* Set GLX_RENDER_TYPE all the time */
+ /* By default glXChooseFBConfig uses GLX_RGBA_BIT as the default value. Since wglChoosePixelFormatARB
+ * searches in all formats we have to do the same. For this reason we set GLX_RENDER_TYPE to ~0 unless
+ * it is overridden. */
PUSH2(oGLXAttr, GLX_RENDER_TYPE, pixelattrib);
TRACE("pAttr[?] = GLX_RENDER_TYPE: %#x\n", pixelattrib);
More information about the wine-cvs
mailing list