Comment 8 for bug 905456

(In reply to comment #3)
> (In reply to comment #2)
> > Sounds like a bug in the application to me. From the GLX 1.4 spec (though
> > that's certainly not new in 1.4):
> >
> > "A non-NULL return value for glXGetProcAddress does not guarantee that an
> > extension function is actually supported at runtime. The client must also query
> > glGetString() or glXQueryExtensionsString to determine if an extension is
> > supported by a particular context."
>
> I'm not sure what behaviour is correct. I relied on the the description of
> glXGetProcAddress:
> http://www.opengl.org/sdk/docs/man/xhtml/glXGetProcAddress.xml
>
> "A NULL pointer is returned if function requested is not suported in the
> implementation being queried."

There's no conflict between the quotes above. Getting a non-NULL pointer is no indication whatsoever about whether the extension is supported or not supported.

The reason is this: suppose the very first call in main() is glXGetProcAddress("glGenTransformFeedbacks"). At this point, the GL library can't determine whether the extension is supported because it hasn't even opened an X display connection. Depending on which display/GPU is used, the extension may or may not be supported. So if libGL implements the function (or can generate a dispatch stub for it) it must return the pointer for it right away.

Later on, the app has to check GL_EXTENSIONS to see if GL_ARB_transform_feedback2 is really supported. If the extension is not supported and the function is called anyway, things might blow up.

This is an application bug.