Mesa supports GL_ARB_transform_feedback2 only for gen7+, and i wonder what the reason is, since the functionality is present in OpenGL ES 3.0 which is supported by gen6. It sadly prevents my Chromium/Firefox from supporting WebGL 2.0, since they use an OpenGL context instead of an OpenGL ES context and therefore depend on this extension to get required transform feedback functionality.
Looking at this again, we apparently never implemented Pause and ResumeTransformFeedback() driver hooks...which meant that we actually failed to restore the streamout buffer writing location during [Pause A -> Bind B -> ... -> Bind A -> Resume A] situations.
Honestly, I think we forgot that this was a part of ES 3.0...there aren't any failing tests for this in the CTS, so it looked like everything was working. There is a failing Piglit test, which I'm guessing came about after we had done ES 3.0 and moved on.
I remember looking at implementing GL_ARB_transform_feedback2 back in the day. I saw the lack of MI_LOAD_REGISTER_MEM and figured Pause/Resume would be painful to implement. Of course, I failed to notice that there's a command to do this...but the hard part is that there isn't a register to read, making it hard to obtain the value at Pause time.
Of course, this is part of ES 3.0, so we have to do it anyway. I've found a solution that seems to work, and should fix those problems.
At that point, GL_ARB_transform_feedback2 only has one feature over and above ES 3.0 - glDrawTransformFeedback(). However...that's easy. The mechanism for the above bug fix makes this just work with no additional code.
So I think we can turn it on. I have no idea how well WebGL 2.0 will work...
Patches on mesa-dev:
Fixed on master by:
Author: Kenneth Graunke <email@example.com>
Date: Thu Feb 16 20:05:39 2017 -0800
i965: Enable ARB_transform_feedback2 on Sandybridge.
And covered in news by:
Nice work, Thanks!