[Mesa-users] Transform Feedback and gl_PrimitiveID

Brian Paul brianp at vmware.com
Tue Dec 1 16:40:21 PST 2015


On 11/21/2015 10:02 AM, Sven-Kristofer Pilz wrote:
> 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? :-)

Hard to say.  Can you provide a simple test program to demonstrate the 
issue?

-Brian




More information about the mesa-users mailing list