1

After reading Jason Ekstrand's blog on adding the transform feedback extension to Vulkan, he points out that the primitives in the transform feedback buffer aren't guaranteed to reflect the order and count of primitives in the input buffer because of changes made in the geometry and tesselation shaders, and of the use of composite primitives, like GL_TRIANGLE_STRIP.

This makes total sense. But I just wanted to confirm that if:

  • you aren't using a geometry or tesselation shader and
  • you are only using the basic primitives of GL_POINTS, GL_LINES or GL_TRIANGLES

...then the order of vertices in the transform feedback are guaranteed to match the vertices in the source buffer. For example, culling and clipping would never be an issue in a single transform feedback pass, and also a triangle's front face would be preserved. Am I correct?

genpfault
  • 51,148
  • 11
  • 85
  • 139
Andrew
  • 14,204
  • 15
  • 60
  • 104

1 Answers1

1

The OpenGL wiki states:

Each primitive is written in the order it is given. Within a primitive, the order of the vertex data written is the the vertex order after primitive assembly. This means that, when drawing with triangle strips for example, the captured primitive will switch the order of two vertices every other triangle. This ensures that Face Culling will still respect the ordering provided in the initial array of vertex data.

BDL
  • 21,052
  • 22
  • 49
  • 55
  • I realize I'm probably being nitpicky here, but does "primitive assembly" here only change things when we're talking about composite primitive types (like `GL_LINE_STRIP`, `GL_TRIANGLE_FAN`, etc.)? Or can "primitive assembly" also affect the draw order of the basic primitives , `GL_POINTS`, `GL_LINES` and `GL_TRIANGLES`. Does it change things if you *don't* use a geometry or tesselation shader? That particular paragraph is the reason I'm asking this question. I've misread the wiki so many times it hurts and Ekstrand's blog increased my doubt. – Andrew Sep 06 '22 at 10:57
  • @Andrew: I don't see how the wiki or the blog supports the idea you're trying to suggest. Both of them give exceptions to the rule, and both of them give specific caveats about when those exceptions apply. – Nicol Bolas Sep 06 '22 at 13:24