PDA

View Full Version : ATI & FORWARD_COMPATIBLE context



S.Seegel
03-29-2009, 02:24 PM
I've started to teach myself "modern" (read: 3.0+) OpenGL at the moment, so I wrote a small program only using non-deprecated features:
- using gen<Whatever> for object names
- vertice an colours interleaved in an vbo
- vertex and fragment shaders using glsl v1.30 (not using any deprecated build-in variables)

And then I got stuck with a problem I wasn't able to find anything about in the spec.

The mini-program ran fine on ubuntu 8.10 with Catalyst 9.2 on x86_64, at least as long as I don't create an FORWARD_COMPATIBLE context. If I created a forward compatible context, glBindBuffer() (and the following glBufferData()) failed with an GL_INVALID_OPERATION error.
I couldn't find a way to make it work.

Today I upgraded to ubuntu 9.04 beta, which (according to Linux Magazin (http://www.linux-magazine.com/online/news/proprietary_driver_for_ubuntu_9_04_fglrx_for_x_ser ver_1_6)) comes with an pre-release of Catalyst 9.4 (version 6.800 as opposed to Catalyst 9.3 which comes with version 6.593).
With this driver, the GL_INVALID_OPERATION error occured later on in my program on the two calls to glVertexAttribPointer().
I was able to work around this error by moving the corresponding glEnableVertexAttribArray() call before the call to glVertexAttribPointer().
It is remarkable, that it's sufficient to have one call to glEnableVertexAttribArray() before the first call to glVertexAttribPointer(), the second call no longer cause an error, even if preceding it's corresponding glEnableVertexAttribArray() call !

I suppose this is a quirk in the ATI driver, or am I missing something in the spec which should have told me to enable vertex attribute arrays before specifying their pointer ?

Stephen A
03-29-2009, 03:48 PM
It's more likely a quirk. Ati seem to be using a different driver path for forward-compatible compared to full contexts and it doesn't seem very stable at the moment.

These quirks will probably be fixed sooner or later.

Heiko
05-06-2009, 01:26 PM
I just spent hours finding the bug that segfaulted my small OpenGL 3.0 program... to find out in the end that I had exactly the same problem you described. Only I use the official Catalyst 9.4 release (not the preview one) and doing the glEnableVertexAttribArray() call doesn't help for me.

One other thing: if I don't use a forward compatible context, the glsl shader language version shows up as 120 instead of 130 (according to glGetString with GL_SHADING_LANGUAGE_VERSION). My shader programs with `#version 130' and using in / out qualifiers work fine though.

Perhaps the bug is part of glsl version 1.30?
Did anybody already commit this bug to the ati driver devs?

Brolingstanz
05-08-2009, 02:04 PM
>> One other thing: if I don't use a forward compatible context, the glsl shader language version shows up as 120 instead of 130 (according to glGetString with GL_SHADING_LANGUAGE_VERSION).

Now that you mention it I don't think it's specified how GLSL and core GL versions should pair. Theoretically I suppose you could have an implementation with a core GL verion of 10.0 and a GLSL version of 2.0 (if say you were trying to dissuade perspective buyers from trying your product).

Heiko
05-15-2009, 01:59 PM
Version 9.5 of the Linux catalyst driver still contains the same bug. However when using a non-forward compatible context the GLSL version is now correctly reported as 1.30 (instead of 1.20 with the previous driver).