Roderick Colenbrander wrote:
There's this check: if ((!WineGLInfo.glxDirect && !strcmp("1.2", WineGLInfo.glxServerVersion)) || (WineGLInfo.glxDirect && !strcmp("1.2", WineGLInfo.glxClientVersion)))
This is not the correct way of loading opengl functions or deciding whether they are available or not. According to the GLX_ARB_get_proc_address spec, we need to check _only_ glXQueryExtensionsString() and glXQueryVersion() and it's not correct to make assumptions based on server/client versions or extension strings.
This patch removes all the client/server code and replaces it with the correct checks. The patch fixes the code in has_opengl() (and also replaces one wine_dlsym() with pglXGetProcAddressARB()) as well as the helper function glxRequireExtension() and fixes the code that decices whether pbuffers are available. Pbuffers are part of GLX 1.3, so if the GLX version is 1.3 we _have_ pbuffers, no need to check for the GLX_SGIX_pbuffers extension anymore (&& -> ||)
If this patch works with ATI drivers, I don't know, but that's certainly the correct way of querying functions.
tom
Tomas carnecky wrote:
This is not the correct way of loading opengl functions or deciding whether they are available or not. According to the GLX_ARB_get_proc_address spec, we need to check _only_ glXQueryExtensionsString() and glXQueryVersion()
The spec: http://www.opengl.org/registry/specs/ARB/get_proc_address.txt Section: 3.3.12 Obtaining Extension Function Pointers
---------------------
A non-NULL return value for glXGetProcAddressARB does not guarantee that an extension function is actually supported at runtime. The client must must also query glGetString(GL_EXTENSIONS) or glXQueryExtensionsString to determine if an extension is supported by a particular context.
[snip]
glXGetProcAddressARB may be queried for all of the following functions:
- All GL and GLX extension functions supported by the implementation (whether those extensions are supported by the current context or not).
- All core (non-extension) functions in GL and GLX from version 1.0 up to and including the versions of those specifications supported by the implementation, as determined by glGetString(GL_VERSION) and glXQueryVersion queries.
---------------------
If the function is part of GLX version 'X' and glXQueryVersion returns 'X' or higher OR if the function is part of an extension that is included in glXQueryExtensionsString THEN glXGetProcAddressARB returns a valid function.
I hope that clears things up :)
tom