[Mesa-users] Transform Feedback and gl_PrimitiveID

Sven-Kristofer Pilz sven.pilz+mailinglist at gmail.com
Sat Nov 21 09:02:10 PST 2015


Hi everybody!

I'm trying to use transform feedback on a program whose fragment
shader is using gl_PrimitiveID. Without transform feedback it works as
expected, but if it's enabled, gl_PrimitiveID always seems to be 0.

It's a 3.3 core profile context with Mesa 11.0.5 on Intel Sandybridge.
When running the same with NVIDIA's official blob on a Fermi card, it
works as expected.

Example vertex and fragment shader:
> void main() {
>    gl_Position = camera * vertex;
> }

> layout(location = 0) out uint id;
> void main() {
>    id = uint(gl_PrimitiveID + 1);
> }

Where gl_Position is captured and glDrawElements(GL_TRIANGLES, ...)
is used.

Is there something with transform feedback and gl_PrimitiveID, is this
maybe undefined behavior in 3.3?

What is going on? :-)


Thanks!
Sven


More information about the mesa-users mailing list