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 areGL_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, andGL_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:
CallingglDrawTransformFeedbackis equivalent to callingglDrawArrays()withmodeas specified, first set to zero, andcountset to the number of vertices captured on vertex stream zero the last time transform feedback was active on the transform feedback object named byid.
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_ENUMis generated ifmodeis not an accepted value. (check yourmode, babe π)GL_INVALID_VALUEis generated ifidis not the name of a transform feedback object.GL_INVALID_OPERATIONis 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_OPERATIONis generated if a geometry shader is active andmodeis incompatible with the input primitive type of the geometry shader in the currently installed program object.GL_INVALID_OPERATIONis generated ifmodeisGL_PATCHESand no tessellation control shader is active.GL_INVALID_OPERATIONis generated ifglEndTransformFeedbackhas never been called while the transform feedback object named byidwas 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β OpenGL2.0:-glDrawTransformFeedbackβ OpenGL2.1:-glDrawTransformFeedbackβ OpenGL3.0:-glDrawTransformFeedbackβ OpenGL3.1:-glDrawTransformFeedbackβ OpenGL3.2:-glDrawTransformFeedbackβ OpenGL3.3:-glDrawTransformFeedbackβ OpenGL4.0:βglDrawTransformFeedbackβ OpenGL4.1:βglDrawTransformFeedbackβ OpenGL4.2:βglDrawTransformFeedbackβ OpenGL4.3:βglDrawTransformFeedbackβ OpenGL4.4:βglDrawTransformFeedbackβ OpenGL4.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 π
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 (yes, again) π§
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
- centos-stream 9: gl-manpages 1.1-24.20190306.el9 Β· MIT and Open Publication
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms