GLDRAWTRANSFORMFEEDB(3G)

πŸ’… GLDRAWTRANSFORMFEEDB (3G) ✨

okay so real talk, this is a page from the 3G manual section β€” that's the OpenGL one, bestie, not the syscall one β€” and it's about glDrawTransformFeedback, which is genuinely one of the most "main character energy" draw calls in the whole API. let's get into it 🫢


🌸 NAME 🌸

glDrawTransformFeedback β€” draw primitives where the count comes straight from a transform feedback object. it's giving "the geometry tells you how much geometry to draw" ✨


πŸŽ€ C SPECIFICATION πŸŽ€

void glDrawTransformFeedback(GLenum mode, GLuint id);

two args, no notes, periodt.


πŸ¦‹ PARAMETERS πŸ¦‹

  • mode β€” what kind of primitives you're rendering. the accepted symbolic constants are GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_LINE_STRIP_ADJACENCY, GL_LINES_ADJACENCY, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_TRIANGLES, GL_TRIANGLE_STRIP_ADJACENCY, GL_TRIANGLES_ADJACENCY, and GL_PATCHES. yes, adjacency variants included, we love a fully specified list πŸ’…
  • id β€” the name of a transform feedback object, and we're pulling a primitive count out of it. that's the whole vibe.

πŸ”₯ DESCRIPTION πŸ”₯

so glDrawTransformFeedback draws primitives of the type you picked in mode, but the count comes from the transform feedback object named by id. icon behaviour, honestly.

here's the equivalence you need to lock into your brain:

Calling glDrawTransformFeedback is equivalent to calling glDrawArrays() with mode as specified, first set to zero, and count set to the number of vertices captured on vertex stream zero the last time transform feedback was active on the transform feedback object named by id.

read it twice, bestie, it's literally the whole function. first = zero. count = however many vertices stream zero captured last time TF was active on that object. that's it, that's the tea β˜•


😭 ERRORS 😭

every one of these is a whole mood, and yes you need all of them:

  • GL_INVALID_ENUM is generated if mode is not an accepted value. (check your mode, babe πŸ™ˆ)
  • GL_INVALID_VALUE is generated if id is not the name of a transform feedback object.
  • GL_INVALID_OPERATION is generated if a non-zero buffer object name is bound to an enabled array and the buffer object's data store is currently mapped. mapping and drawing at the same time is not the slay you think it is πŸ’€
  • GL_INVALID_OPERATION is generated if a geometry shader is active and mode is incompatible with the input primitive type of the geometry shader in the currently installed program object.
  • GL_INVALID_OPERATION is generated if mode is GL_PATCHES and no tessellation control shader is active.
  • GL_INVALID_OPERATION is generated if glEndTransformFeedback has never been called while the transform feedback object named by id was bound. like… you never finished a capture on that object. there's nothing to count. soz 😭

πŸ‘‘ VERSION SUPPORT πŸ‘‘

the original ships this as a big grid headed Function / Feature Name across the OpenGL Version columns, so here's that exact grid converted to a list (all the same data, just less spreadsheet-core):

  • glDrawTransformFeedback β€” OpenGL 2.0: -
  • glDrawTransformFeedback β€” OpenGL 2.1: -
  • glDrawTransformFeedback β€” OpenGL 3.0: -
  • glDrawTransformFeedback β€” OpenGL 3.1: -
  • glDrawTransformFeedback β€” OpenGL 3.2: -
  • glDrawTransformFeedback β€” OpenGL 3.3: -
  • glDrawTransformFeedback β€” OpenGL 4.0: βœ”
  • glDrawTransformFeedback β€” OpenGL 4.1: βœ”
  • glDrawTransformFeedback β€” OpenGL 4.2: βœ”
  • glDrawTransformFeedback β€” OpenGL 4.3: βœ”
  • glDrawTransformFeedback β€” OpenGL 4.4: βœ”
  • glDrawTransformFeedback β€” OpenGL 4.5: βœ”

so: nope all through 2.0–3.3, then from 4.0 onward it's a yes. ate and left no crumbs πŸ’…


🌈 SEE ALSO 🌈

go read these next, iykyk:

  • glDrawArrays()
  • glDrawArraysInstanced()
  • glDrawElements()
  • glDrawRangeElements()
  • glDrawTransformFeedbackStream()

Copyright Β© 2010-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/


Copyright Β© 2010-2014 Khronos Group.


<div align="center">πŸ’– ✨ πŸŽ€ πŸ¦‹ 🌸 πŸ’… 🫢 😭 πŸ”₯ πŸ‘‘ 🌈 ⭐ πŸ’€ πŸ™ˆ πŸ“ 🧚 πŸ’œ</div>

and that's the whole page bestie!! this one came from [FIXME: source] and it's dated 08/09/2021 β€” shoutout to whoever generated it, the [FIXME]s are still in there and honestly? relatable. go draw some triangles 🫢✨

πŸ“¦ where this page comes from