GLUNIFORMSUBROUTINES(3G)

okay so welcome to GLUNIFORMSUBROUTINES(3G), bestie β€” this is the page about loading active subroutine uniforms, and yes it’s giving very β€œgraphics pipeline main character” energy πŸ’…βœ¨

🌸 NAME 🌸

glUniformSubroutines β€” load active subroutine uniforms. That’s the whole quest, no cap πŸŽ€

✨ C SPECIFICATION ✨

void glUniformSubroutinesuiv(GLenum shadertype, GLsizei count,
                             const GLuint *indices);

πŸ¦‹ PARAMETERS πŸ¦‹

  • shadertype β€” tells you which shader stage to query for the subroutine uniform index. It must be one of GL_VERTEX_SHADER, GL_TESS_CONTROL_SHADER, GL_TESS_EVALUATION_SHADER, GL_GEOMETRY_SHADER or GL_FRAGMENT_SHADER. Like, those are the only accepted vibes here πŸ‘‘
  • count β€” the number of uniform indices stored in indices. Literally how many we’re working with πŸ”’
  • indices β€” the address of an array holding the indices to load into the shader subroutine variables. This is the little array carrying the lore πŸ“

πŸ’– DESCRIPTION πŸ’–

glUniformSubroutines loads all active subroutine uniforms for shader stage shadertype of the current program with subroutine indices from indices, storing indices[i] into the uniform at location i.

count must be equal to the value of GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS for the program currently in use at shader stage shadertype. That’s a hard requirement, not a casual suggestion, bestie 😭

Furthermore, all values in indices must be less than the value of GL_ACTIVE_SUBROUTINES for the shader stage. So yeah β€” vibe check those values before you send them 🌈

πŸ’€ ERRORS πŸ’€

  • GL_INVALID_OPERATION is generated if no program object is current. Not me showing up with no current program πŸ™ˆ
  • GL_INVALID_VALUE is generated if count is not equal to the value of GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS for the shader stage shadertype of the current program.
  • GL_INVALID_VALUE is generated if any value in indices is geater than or equal to the value of GL_ACTIVE_SUBROUTINES for the shader stage shadertype of the current program. (Yes, geater β€” preserving the original spelling exactly, because rules are rules 🫢)
  • GL_INVALID_ENUM is generated if shadertype is not one of the accepted values.

πŸ”₯ ASSOCIATED GETS πŸ”₯

  • glGetProgramStage() with argument GL_ACTIVE_SUBROUTINES
  • glGetProgramStage() with argument GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS

πŸ‘‘ VERSION SUPPORT πŸ‘‘

The support grid is literally this, bestie:

  • Function / Feature Name: glUniformSubroutinesuiv
  • OpenGL Version columns: 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5
  • glUniformSubroutinesuiv entry: - for 2.0, 2.1, 3.0, 3.1, 3.2, 3.3; βœ” for 4.0, 4.1, 4.2, 4.3, 4.4, 4.5

So the little checkmark era starts at 4.0 and keeps slaying through 4.5 ✨

🧚 SEE ALSO 🧚

  • glGetProgram()
  • glGetActiveSubroutineUniform()
  • glGetActiveSubroutineUniformName()
  • glGetProgramStage()

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.


cute sign-off time: source is [FIXME: source], date is 08/09/2021, and the manual name is GLUNIFORMSUBROUTINES(3G) β€” periodt πŸ’œπŸ¦‹

πŸ“¦ where this page comes from