Some GL extensions aren't advertised by the driver

I’ve been having issues with a certain game recently to due to a change in Wine. A bug was submitted here regarding what is seems like a regression in Wine at first glance. However, I have to agree with the developers that it’s not a regression but probably what Wine should have done all along.

The issue is that a a single set of brackets and a return statement added here has caused some functionality issues. Prior to the change, Wine simply warned that a particular OpenGL call that was attempting to be made wasn’t supported. Now, it returns if it’s not supported – why try it if it’s not supported? It makes sense.

The extension in question, however is GL_EXT_copy_texture introduced in 1995. While one can reasonably assume that all video cards these days support this specific feature, the Wine developers shouldn’t have to start making specific exceptions because certain seemingly common-sense extensions aren’t advertised by the driver.

Indeed, glxgears -info (both 64 and 32-bit) neither report this extension.

Of course, I have no idea if this is a recent regression since a change to a third party program is what brought this to light in the first place. However, I assume it has been this way for a while. Either way, I agree with the Wine developers that it’s a problem that Nvidia should address as it’s the only driver that seems to be affected by this particular problem.

I can’t speak for the person who filed the original bug in Wine, but I’m using the latest non-beta 64-bit Linux drivers.

In the bug report, Sebastian Lackner cobbled together a fairly sizeable list of supported but unreported extensions in the 346.59 driver: http://pastebin.com/raw.php?i=C61vk8rH. Due to the way Wine’s OpenGL implementation works, they would have to work around each of these specifically for Nvidia’s OpenGL driver.

Some of these are expected. E.g., the functions from GL_NV_video_capture and GL_NV_present_video are still implemented in the driver and will still be returned by glXGetProcAddress, but the extensions themselves won’t be advertised unless the corresponding Digital Video Pipeline hardware is present in the system. Some of the rest look like they correspond to extensions that were picked up by later OpenGL core versions so I think it’s expected that those extensions won’t be present, but I’ve asked the resident OpenGL experts to find out for sure.

The reply I got is that the assert in Wine is backwards: GetProcAddress provides no guarantee that it will return NULL for names of functions that aren’t defined in the list of supported extensions. Wine should be first checking the extension string and then complaining if GetProcAddress returns NULL for a function in an extension that is listed as supported.

For the particular case of GL_EXT_copy_texture, the extension cannot be listed as supported because the driver doesn’t implement all of the functions defined by that extension.