From 521598560e95b4190367c9c09a45fcb559627150 Mon Sep 17 00:00:00 2001 From: Roderick Colenbrander Date: Wed, 11 Nov 2009 16:27:43 +0100 Subject: [PATCH] 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 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 9f97099a49e..6171f9b1f08 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);