GLGETTRANSFORMFEEDBA(3G)
πΈ GLGETTRANSFORMFEEDBA(3G) πΈ
okay bestie so real talk β this one is from the 3G manual (the OpenGL family of pages, iykyk), and it's basically the "hey what's going on with my transform feedback rn" page. it's all about querying state, not setting it. no cap, it's giving investigator energy ππ
β¨ NAME β¨
glGetTransformFeedbackiv β literally just: query the state of a transform feedback object. that's it, that's the whole vibe π«Ά
β¨ C SPECIFICATION β¨
here's the exact tea, copy it character for character bestie:
void glGetTransformFeedbackiv(GLuint xfb, GLenum pname, GLint *param);
void glGetTransformFeedbacki_v(GLuint xfb, GLenum pname, GLuint index,
GLint *param);
void glGetTransformFeedbacki64_v(GLuint xfb, GLenum pname, GLuint index,
GLint64 *param);
three (3) separate divas, all serving the same general purpose π
π PARAMETERS π
xfbβ the name of an existing transform feedback object β¨ or zero, which means the default transform feedback object (the fallback bestie, we respect her).pnameβ which property you're querying. must be one of these, no substitutions allowed:GL_TRANSFORM_FEEDBACK_BUFFER_BINDING,GL_TRANSFORM_FEEDBACK_BUFFER_START,GL_TRANSFORM_FEEDBACK_BUFFER_SIZE,GL_TRANSFORM_FEEDBACK_PAUSED,GL_TRANSFORM_FEEDBACK_ACTIVE.indexβ the index of the transform feedback stream (this is for the indexed state, the fancy stuff π ).paramβ the address of a buffer where the requested state info gets written. it's an output, so keep your eyes on it π
π¦ DESCRIPTION π¦
so. to actually use Transform Feedback, you gotta configure the Transform Feedback Buffer indexed bindings first. and there are two ways to do that, both iconic:
- use
glBindBufferBaseorglBindBuffersBaseto associate whole buffer object storage with one of the Transform Feedback Binding Points, or - call
glBindBufferRangeorglBindBuffersRangeto use just a region of a buffer object's storage for the binding.
you also may want to β but are not required to β bind a Transform Feedback Object first, in order to cache the binding configuration. why would you? because it usually lets you restore the TF configuration faster than if you had to execute a whole list of API calls just to set up the Transform Feedback state of your liking. it's the "save your progress" of GL, fr fr πΎβ¨
now this reference page discusses two types of getters that operate on Transform Feedback Objects and their bindings. two flavors, one obsession π
π class one: the general binding point girlies
the first class operates on the general Transform Feedback binding point and includes the glGetTransformFeedbackiv function. glGetTransformFeedbackiv can be used to retrieve info about the Transform Feedback object bound to the general Transform Feedback binding point, as configured with a glBindTransformFeedback call. in this case you can check:
- what the ID of the currently bound Transform Feedback Object is β (
GL_TRANSFORM_FEEDBACK_BUFFER_BINDING) - whether the Transform Feedback process is currently paused β (
GL_TRANSFORM_FEEDBACK_PAUSED) - whether the Transform Feedback process has been begun and is currently undergoing β (
GL_TRANSFORM_FEEDBACK_ACTIVE)
π class two: the per-binding investigative squad
the latter class β which includes glGetTransformFeedbacki_v and glGetTransformFeedbacki64_v β can be used to check what the current configuration of each of the buffer object regions bound to Transform Feedback Buffer binding points is. this lets you query for the following info:
glGetTransformFeedbacki_vonly: what the ID of the Buffer Object bound to a Transform Feedback Binding Point of user-specified index is β (GL_TRANSFORM_FEEDBACK_BUFFER_BINDING)glGetTransformFeedbacki64_vonly: what the start offset configured for the binding is β (GL_TRANSFORM_FEEDBACK_BUFFER_START)glGetTransformFeedbacki64_vonly: what the length of the region used for the binding is β (GL_TRANSFORM_FEEDBACK_BUFFER_SIZE)
π₯ ERRORS π₯
bestie, this is the part where GL gets EXTREMELY loud at you. read carefully, these are the vibes it will throw:
GL_INVALID_OPERATIONis generated ifxfbis not zero or the name of an existing transform feedback object. (so, like, don't make up names. she will know. π)GL_INVALID_ENUMis generated byglGetTransformFeedbackivifpnameis notGL_TRANSFORM_FEEDBACK_PAUSEDorGL_TRANSFORM_FEEDBACK_ACTIVE.GL_INVALID_ENUMis generated byglGetTransformFeedbacki_vifpnameis notGL_TRANSFORM_FEEDBACK_BUFFER_BINDING.GL_INVALID_ENUMis generated byglGetTransformFeedbacki64_vifpnameis notGL_TRANSFORM_FEEDBACK_BUFFER_STARTorGL_TRANSFORM_FEEDBACK_BUFFER_SIZE.GL_INVALID_VALUEis generated byglGetTransformFeedbacki_vandglGetTransformFeedbacki64_vifindexis greater than or equal to the number of binding points for transform feedback (which is the value ofGL_MAX_TRANSFORM_FEEDBACK_BUFFERS). π
ngl every single one of these is a "wrong dial, try again" situation. pick the right pname for the right function or the error generator is gonna eat you alive.
β VERSION SUPPORT β
okay the original had this whole giant grid (a table, which we do not do here, so we're serving it as a list instead β same facts, more personality π ). the columns are OpenGL versions 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5. every function below is a whole lot of "nope" until 4.5, which is a big fat yes:
glGetTransformFeedbackivβ 2.0:-, 2.1:-, 3.0:-, 3.1:-, 3.2:-, 3.3:-, 4.0:-, 4.1:-, 4.2:-, 4.3:-, 4.4:-, 4.5: βglGetTransformFeedbacki_vβ 2.0:-, 2.1:-, 3.0:-, 3.1:-, 3.2:-, 3.3:-, 4.0:-, 4.1:-, 4.2:-, 4.3:-, 4.4:-, 4.5: βglGetTransformFeedbacki64vβ 2.0:-, 2.1:-, 3.0:-, 3.1:-, 3.2:-, 3.3:-, 4.0:-, 4.1:-, 4.2:-, 4.3:-, 4.4:-, 4.5: β
(and yes, the version support table spells the third one glGetTransformFeedbacki64v without the underscore while the C spec says glGetTransformFeedbacki64_v β that's exactly how the original rolls it, so we're preserving the chaos π« )
π SEE ALSO π
go read these next, they're the friend group:
glBindBufferBase()glBindBufferRange()glBindBuffersBase()glBindBuffersRange()glBindTransformFeedback()
π COPYRIGHT π
Copyright Β© 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 (again, she said it twice) π
Copyright Β© 2014 Khronos Group
π§ sign-off time π§ and that's the page bestie!! it came from[FIXME: source], dated08/09/2021, and it lives atGLGETTRANSFORMFEEDBA(3G)in the [FIXME: manual]. go forth and query your transform feedback state correctly, you absolute icon π β¨πΈ
π¦ 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