Created attachment 112993 [details]
After a draw with a shader program that has transform feedback varyings set, and has a geometry shader that does not write to gl_Position, subsequent uses of transform feedback with interleaved transform feedback attributes can out write attributes in the wrong order, or with some missing. In every case of this I've seen, the space used for each vertex's attributes was correct but the offset within the vertex's data is wrong for some attributes.
The attached program demonstrates the problem. The second draw call writes three transform feedback attributes. They are a float, a vec3, and another float. When the transform feedback buffer is read back, the last component of the vec3 has the value that should have been written to the second float, and the second float ends up with 0. The output is in the correct order if the first draw call is removed, if the first draw's geometry shader is changed to write to gl_Position, or if the geometry shader for the second draw writes only compile time constants to the transform feedback attributes.
I this bug is consistently reproducible for me. I am using Intel Haswell graphics, x86_64 architecture, with Fedora 21 and mesa git b930ef1ce8222156464cfd1e744c9598ace5efbb master branch. The Fedora 21 mesa 10.4.1 and 10.4.2 packages also reproduce the bug.
This works for me on r600g but I see a crash in your reproducer on Intel (gen4) using both mesa 10.4.2. Problem might be specific to Intel.
This should be fixed in master now by:
Thanks Chris! This commit has fixed also rendering issues with some of the heavyweight UE4 demos where we had 'yellow tint' colors.
on Feb 24, 2017 at 03:40:52.
(provided by the Example extension).