PDA

View Full Version : Do Vertex Array Objects 'group' also glUniform?



tobindax
01-22-2011, 07:06 AM
Do Vertex Array Objects 'group' also glUniform uploads? (e.g. what one uploads to a shader?)

I'm almost certain they don't since the documentation is that they only gather whatever alters "Vertex Array State" which appears to be only what glVertexAttribPointer etc. are doing.

But I want to make sure.

Alfonse Reinheart
01-22-2011, 10:16 AM
Do Vertex Array Objects 'group' also glUniform uploads?

Uniforms are program state, not VAO state.


I'm almost certain they don't since the documentation is that they only gather whatever alters "Vertex Array State" which appears to be only what glVertexAttribPointer etc. are doing.

The OpenGL spec is very clear about these kinds of things. It doesn't leave any ambiguity about what state is set by which functions or what state is encapsulated by what object. If it gives a list of state that VAOs encapsulate, then they encapsulate exactly and only that state.

tobindax
01-22-2011, 03:01 PM
Uniforms are program state, not VAO state.
That's a very clear way to think of it. I wished the spec or at least web resources had introductions about it.

e.g. googling 'program state opengl' doesn't bring up anything clear about what it is.

Alfonse Reinheart
01-22-2011, 04:16 PM
Section 6.2 of any version of the OpenGL specification lists all of OpenGL's state and what objects (if any) that state belongs to.

Alternatively, from the OpenGL wiki article on GLSL Uniforms (http://www.opengl.org/wiki/GLSL_Uniforms): "They are stored in a program object." It's generally considered something to be so obvious that nobody has to say it.

tobindax
01-23-2011, 07:45 AM
Section 6.2 of any version of the OpenGL specification lists all of OpenGL's state and what objects (if any) that state belongs to.

Alternatively, from the OpenGL wiki article on GLSL Uniforms (http://www.opengl.org/wiki/GLSL_Uniforms): "They are stored in a program object." It's generally considered something to be so obvious that nobody has to say it.
It could be in the introductory sections of the spec because it (the spec) is very clear about several concepts up to a certain point in the text.

Of course I'm well aware, that's not the job of a spec, it does not have to be an introductory text necessarily but it is already one for several concepts in its introductory passages.