GLGETACTIVESUBROUTIN(3G)
π NAME π
glGetActiveSubroutineUniform β bestie, this is how you query a property of an active shader subroutine uniform β¨ (yes, the page header says GLGETACTIVESUBROUTIN(3G), section 3G, so you know exactly where you are π«Ά)
β¨ C SPECIFICATION β¨
void glGetActiveSubroutineUniformiv(GLuint program, GLenum shadertype,
GLuint index, GLenum pname,
GLint *values);
π PARAMETERS π
programβ the name of the program that's holding your subroutine, like the group chat that contains the vibe πshadertypeβ which shader stage you're querying the subroutine parameter from, and it literally must be one ofGL_VERTEX_SHADER,GL_TESS_CONTROL_SHADER,GL_TESS_EVALUATION_SHADER,GL_GEOMETRY_SHADER, orGL_FRAGMENT_SHADER. no substitutions, no "close enough" π ββοΈindexβ the index of the shader subroutine uniform. it's giving "which one of these is it" energy π₯pnameβ the parameter of the shader subroutine uniform you wanna look up, and it must beGL_NUM_COMPATIBLE_SUBROUTINES,GL_COMPATIBLE_SUBROUTINES,GL_UNIFORM_SIZE, orGL_UNIFORM_NAME_LENGTHβ¨valuesβ the address of a thing into which the queried value or values get placed. it's the drop-off spot, the little mailbox where your answer lands π¬
πΈ DESCRIPTION πΈ
So glGetActiveSubroutineUniform queries a parameter of an active shader subroutine uniform β that's the whole assignment, that's the task π
program contains the name of the program containing the uniform. shadertype specifies the stage for which the uniform location, given by index, is valid. And index must be between zero and the value of GL_ACTIVE_SUBROUTINE_UNIFORMS minus one for the shader stage. no cap, that's the range, don't push it π
Now, what you get back depends on pname, so let's break it down bestie:
- If
pnameisGL_NUM_COMPATIBLE_SUBROUTINES, a single integer is returned invalues, indicating the number of subroutines that can be assigned to the uniform. just a count, a little headcount π - If
pnameisGL_COMPATIBLE_SUBROUTINES, an array of integers is returned invalues, and each integer specifies the index of an active subroutine that can be assigned to the selected subroutine uniform. The number of integers returned is the same as the value returned forGL_NUM_COMPATIBLE_SUBROUTINESβ so like, they match, they're in sync, iconic π₯ - If
pnameisGL_UNIFORM_SIZE, a single integer is returned invalues. If the selected subroutine uniform is an array, the declared size of the array is returned; otherwise, one is returned. simple as that β¨ - If
pnameisGL_UNIFORM_NAME_LENGTH, a single integer specifying the length of the subroutine uniform name (including the terminating null character) is returned invalues. yes, the null character counts, she's part of the family π
π ERRORS π
GL_INVALID_ENUMis generated ifshadertypeorpnameis not one of the accepted values. read the list, bestie πGL_INVALID_VALUEis generated ifindexis greater than or equal to the value ofGL_ACTIVE_SUBROUTINES. out of bounds = instant no πGL_INVALID_VALUEis generated ifprogramis not the name of an existing program object. like, it has to exist, you can't just make one up π«Ά
β ASSOCIATED GETS β
glGetProgramStage() with argument GL_ACTIVE_SUBROUTINE_UNIFORMS β that's the side quest that goes with this one π§
π VERSION SUPPORT π
The table in the original is very "spreadsheet main character energy", so here it is as a glow-up β¨ β same facts, same numbers, no table:
Function / Feature Name: glGetActiveSubroutineUniformiv
- OpenGL 2.0 β
- - OpenGL 2.1 β
- - OpenGL 3.0 β
- - OpenGL 3.1 β
- - OpenGL 3.2 β
- - OpenGL 3.3 β
- - OpenGL 4.0 β
β - OpenGL 4.1 β
β - OpenGL 4.2 β
β - OpenGL 4.3 β
β - OpenGL 4.4 β
β - OpenGL 4.5 β
β
So she shows up at 4.0 and stays slaying through 4.5. periodt π
π¦ SEE ALSO π¦
glGetSubroutineIndex()glGetActiveSubroutineUniformName()glGetProgramStage()
go read those too, iykyk π
π 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.
okay that's the whole page, you ate that π before you go: this gem came from the [FIXME: source] era, dated 08/09/2021, and it's filed under GLGETACTIVESUBROUTIN(3G) β mwah, go write some shaders bestie πΈπ
π«Ά
π¦ 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