glVertexAttribXX(0, #value#) is the same as a glVertexXX(#value#) in that it issues a vertex so can only be called inside glBegin/glEnd. The others should be okay to call outside glBegin/glEnd though.
glVertexAttribXX(0, #value#) is the same as a glVertexXX(#value#) in that it issues a vertex so can only be called inside glBegin/glEnd. The others should be okay to call outside glBegin/glEnd though.
That is true for Compatibility Profile.
It's not true for Core Profile, where all of the "Begin/End Paradigm" and "Array Element" language has been replaced with the much simpler "Transferring Array Elements" section.
In Core Profile, specifying vertex attrib zero no longer immediately submits a vertex, it just sets the generic attrib (and you can query the value, unlike Compatibility Profile.)
And how could we call glVertexAttrib between glBegin/glEnd if glBegin/glEnd are not supported in the Core profile?Originally Posted by Dan Bartlett
glVertexAttrib + glDrawArrays is working on AMD driver. I apologize for my previous mis-information.glVertexAttribXX(0, #value#) is the same as a glVertexXX(#value#) in that it issues a vertex so can only be called inside glBegin/glEnd.
Senior Engineer, OpenGL driver, AMD
I later had such an interesting observation about glVertexAttrib with AMD driver. Theoritically, the follow two code snippet should have the same rendering result; a point sprite on the left.
** Code snippet A
GLfloat v[] =
{
-0.5f, 0.0f, 0.0f,
};
glEnableVertexAttribArray(0);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, v);
glDrawArrays(GL_POINTS, 0, 1);
** Code snippet B
glVertexAttrib3f(0, -0.5f, 0.0f, 0.0f);
glDrawArrays(GL_POINTS, 0, 1);
However, code snippet B draws the point sprite at the center of the viewport, which means it has not passed data to shader.
Is it true on your Radeon cards? I am searching for more evidence. Thanks.
Senior Engineer, OpenGL driver, AMD
On this topic, I've got problems with transform feedback on an AMD GPU (see below for vendor, version and renderer). It works as expected on an NVIDIA GPU, but not on AMD. It works when I use just one output from the vertex shader, but if I add more the result is incorrect, even if the additional output is not specified using glTransformFeedbackVaryings.Originally Posted by aqnuep
I looked at your demo source and noticed that you use GL_INTERLEAVED_ATTRIBS. I use GL_SEPARATE_ATTRIBS, so was wondering if anyone out there have successfully used GL_SEPARATE_ATTRIBS on AMD for more than one output, and if there are any gotchas.
ATI Technologies Inc.
3.3.11399 Compatibility Profile Context
ATI Radeon HD 3200 Graphics
AMD Catalyst 12.1
If anyone cares to test this I can cook up a small repro case.
Cheers
.ola
If I change primitive mode in DrawTransformFeedback() to points (when transform feedback is capturing lines), it gives me invalid operation. Is this another bug in AMD*driver?
I think it should work.
I know there is a sentence "The error INVALID_OPERATION is generated by DrawArrays and the other drawing commands defined in section 2.8.3 if mode is not one of the allowed modes in table 2.14" in the specification. But the whole paragraph only talks about transform feedback being active.