PDA

View Full Version : AMD glVertexAttribPointer() invalid op



tksuoran
10-27-2010, 11:52 AM
I already posted this on AMD developer forums but just in case anyone else is having this issue:

glVertexAttribPointer() always fails for me on AMD (not on NVidia) if I do not use vertex array object in forward compatible context.

The specification text says:

"An INVALID_OPERATION error is generated under any of the following conditions:
...
* any of the *Pointer commands specifying the location and organization of vertex array data are called while zero is bound to the ARRAY_BUFFER buffer object binding point (see section 2.9.6), and the pointer argument is not NULL."

I have a proper VBO bound to ARRAY_BUFFER with glBindBuffer().

If I remove the forward compatible flag from the context, my application works fine. To me, this looks like a driver bug: The checks added into forward compatible config incorrectly checks if VAO is bound, instead of checking that VBO is bound.

Note that GL_ARRAY_BUFFER is VBO buffer, not VAO buffer.

skynet
10-27-2010, 12:09 PM
see here:
http://www.opengl.org/discussion_boards/...true#Post284553 (http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=284553&Searchpa ge=1&Main=54959&Words=vao&Search=true#Post284553)

tksuoran
10-27-2010, 02:12 PM
Edit: Oops, I didn't read it quite well enough. Checking..

Second edit: The specification contradicts itself. E.2 mentions invalid operation which is not in 2.8.

Alfonse Reinheart
10-27-2010, 02:22 PM
I read it, but I still think that the specification text I quoted clearly (well, after reading it very carefully several times) is about VBO and not about VAO.

Yes it is. But it's not the only text in the spec on this subject.


Does the specification somewhere explicitly say that default vertex array object (0) is deprecated?

No. The core GL specification clearly says that there is no VAO number 0:


Calling VertexAttribPointer when no buffer object or no vertex array object is bound will generate an INVALID_OPERATION error, as will calling any array drawing command when no vertex array object is bound.

Deprecated means "marked for removal"; deprecated functionality still exists, but may not in later versions. Removed means removed. Things were deprecated in GL 3.0. They were removed in 3.1.

tksuoran
10-27-2010, 02:30 PM
Apologies for editing my post while people were already quoting it.

Still I think the deprecation and removing and specifically the invalid operation - if really intended - should be mentioned in 2.8 and not only in E.2. Also, 'vertex array object' could be interpreted to mean VBO vertex array buffer object as in 2.8.

Alfonse Reinheart
10-27-2010, 03:39 PM
Still I think the deprecation and removing and specifically the invalid operation - if really intended - should be mentioned in 2.8 and not only in E.2.

I agree, but the GL drivers forum probably isn't the best place to mention this ;)


Also, 'vertex array object' could be interpreted to mean VBO vertex array buffer object as in 2.8.

There's no such thing as a "vertex array buffer object". There is a such thing as a "vertex array object." So clearly that's what they're talking about.

tksuoran
10-27-2010, 03:48 PM
Well this started when I investigated why my test program didn't render anything on AMD, and after reading 2.8 I figured maybe it was a driver thing.

There is "2.9.6 Vertex Arrays in Buffer Objects" ...

tksuoran
10-28-2010, 01:21 AM
Okay, after reading the specifications again I*have to admit that the specification seems to be fine, as well as AMD*implementation.

Apparently the body of the specification does not really cover the forward compatible context. If you want to use the forward compatible context you have to carefully read both the body text and the appendix E. I*kind of wish that the main text had at least footnotes in the places that are affected by forward compatibility.