GLGETFRAGDATAINDEX(3G)

πŸŽ€ glGetFragDataIndex β€” a.k.a. the 3G girlies' guide to frag data indices πŸŽ€

okay bestie, so this is the manual page for glGetFragDataIndex (from the 3G section, iykyk) and it's literally just here to answer one question: which fragment color did my varying out variable get bound to?? no cap, that's the whole vibe.


✨ NAME ✨

glGetFragDataIndex β€” the function that queries the bindings of color indices to user-defined varying out variables πŸ’…


🌸 C SPECIFICATION 🌸

GLint glGetFragDataIndex(GLuint program, const char * name);

like, that's it. two args. go off. 🫢


πŸ“ PARAMETERS πŸ“

  • program β€” the name of the program containing the varying out variable whose binding you wanna query. this is your main character right here πŸ‘‘
  • name β€” the name of the user-defined varying out variable whose index you're asking about. the lil celeb you're tryna look up πŸŽ€

πŸ’– DESCRIPTION πŸ’–

so here's what happens: glGetFragDataIndex returns the index of the fragment color that the variable name was bound to when the program object program was last linked. past tense. the linking already happened, we're just reading the receipts 🧾✨

and if name is not a varying out variable of program, or if an error occurs? it returns -1. yeah. -1. that's the "girl, nothing here" answer πŸ’€


🌈 NOTES 🌈

glGetFragDataIndex is only available if the GL version is 3.3 or greater. no 3.3, no entry. gatekept and honestly valid πŸ™ˆ


πŸ”₯ ERRORS πŸ”₯

  • GL_INVALID_OPERATION gets generated if program is not the name of a program object. so like... give it a real program name or it WILL be mad at you 😭

⭐ VERSION SUPPORT ⭐

the chart, bestie. the chart. which OpenGL versions support glGetFragDataIndex? let's break it down πŸ’…

OpenGL Version β†’ supported or not, for the row Function / Feature Name:

  • 2.0 β€” - (nope πŸ™…)
  • 2.1 β€” - (still nope)
  • 3.0 β€” - (nope)
  • 3.1 β€” - (nope)
  • 3.2 β€” βœ” (wait... yes?? yes. iconic)
  • 3.3 β€” βœ” ✨
  • 4.0 β€” βœ” ✨
  • 4.1 β€” βœ” ✨
  • 4.2 β€” βœ” ✨
  • 4.3 β€” βœ” ✨
  • 4.4 β€” βœ” ✨
  • 4.5 β€” βœ” ✨

and the function name in that table is literally glGetFragDataIndex, in case anyone was wondering who ate πŸ’…βœ¨


πŸ¦‹ SEE ALSO πŸ¦‹

  • glCreateProgram()
  • glBindFragDataLocation()
  • glBindFragDataLocationIndexed()
  • glGetFragDataLocation()

go read those too, they're all in the same friend group fr fr 🫢


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


ok that's the whole page, no crumbs left, every single detail accounted for πŸ’―

and that's a wrap, bestie!! this came from [FIXME: source] and is dated 08/09/2021 β€” so like, it's giving vintage but make it cute πŸŒΈπŸ’œ mwah, study up and slay your shaders ✨

πŸ“¦ where this page comes from