GLGETACTIVESUBROUTIN(3G)
π GLGETACTIVESUBROUTIN (3G) β the "what's ur subroutine's name bestie" page
okay so this is a page from the 3G manual section (that's the OpenGL one, iykyk) and it's literally all about getting the name of an active shader subroutine. sounds niche? it is. but it's also kinda iconic. let's go π«Ά
β¨ NAME β¨
glGetActiveSubroutineName β query the name of an active shader subroutine
π§Ύ C SPECIFICATION π§Ύ
bestie this is the actual signature, copy it exactly, no cap:
void glGetActiveSubroutineName(GLuint program, GLenum shadertype,
GLuint index, GLsizei bufSize,
GLsizei *length, GLchar *name);
π PARAMETERS π
programβ the name of the program that's holding your subroutine. like, which program are we even talking about.shadertypeβ which shader stage you're pulling the subroutine name out of.indexβ the index of the shader subroutine uniform. yes you need to know which one.bufSizeβ how big the buffer is, the one whose address you passed inname. keep it real, don't overflow πΈlengthβ address of a variable that's gonna receive the length of the shader subroutine uniform's name.nameβ address of an array where the shader subroutine uniform's name gets written. this is the whole point tbh π
π DESCRIPTION π
So glGetActiveSubroutineName queries the name of an active shader subroutine uniform from the program object you handed over in program. the index argument says which shader subroutine uniform you want, inside the shader stage given by stage, and it must be between zero and the value of GL_ACTIVE_SUBROUTINES minus one for that shader stage. read that again. minus one. periodt.
The name of the selected subroutine comes back as a null-terminated string in name. The actual number of characters written into name β not counting the null-terminator β gets returned in length. If length is NULL, then no length is returned, simple as that. The maximum number of characters that may be written into name, null-terminator included, is given by bufSize. budget ur bytes bestie π
π ERRORS π
GL_INVALID_VALUEgets generated ifindexis greater than or equal to the value ofGL_ACTIVE_SUBROUTINES. out of bounds = not the vibe.GL_INVALID_VALUEgets generated ifprogramis not the name of an existing program object. like, that program doesn't exist, babes π
π ASSOCIATED GETS π
glGetProgramStage()with argumentGL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH
π VERSION SUPPORT π
the original lays this out in a big table, but tables are so not terminal-core, so here's the tea in list form β same facts, zero spreadsheets π
Function / Feature Name: glGetActiveSubroutineName
OpenGL 2.0 β not supported (-) OpenGL 2.1 β not supported (-) OpenGL 3.0 β not supported (-) OpenGL 3.1 β not supported (-) OpenGL 3.2 β not supported (-) OpenGL 3.3 β not supported (-)
and then:
OpenGL 4.0 β supported (β) OpenGL 4.1 β supported (β) OpenGL 4.2 β supported (β) OpenGL 4.3 β supported (β) OpenGL 4.4 β supported (β) OpenGL 4.5 β supported (β)
so like, 4.0 and up only. glow up era only πβ¨
π¦ SEE ALSO π¦
glGetSubroutineIndex()glGetActiveSubroutineUniform()glGetProgramStage()
Β©οΈ 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 Β© 2010-2014 Khronos Group.
ngl the header up top saysGLGETACTIVESUBROUTIN(3G)and yeah β<rainbow>Khronos Group says hi, this is from [FIXME: source], dated 08/09/2021, and that's the whole manpage bestie π«Άπ</rainbow>
π¦ 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