GLSHADERBINARY(3G)

πŸ’… NAME πŸ’…

glShaderBinary β€” okay bestie, this is the one that loads pre-compiled shader binaries, no cap ✨

(also hi, you're reading the glShaderBinary page from manual section 3G, welcome to the group chat 🫢)


✨ C SPECIFICATION ✨

void glShaderBinary(GLsizei count, const GLuint *shaders,
                    GLenum binaryFormat, const void *binary,
                    GLsizei length);

πŸŽ€ PARAMETERS πŸŽ€

  • count β€” how many shader object handles are sitting in shaders, literally just the count, she counts.
  • shaders β€” the address of an array of shader handles, aka the little VIP list of shader objects that are gonna receive the pre-compiled shader binaries 🌸
  • binaryFormat β€” the format of the shader binaries living inside binary. it's giving "what am I even looking at" energy, so specify it pls.
  • binary β€” the address of an array of bytes holding the pre-compiled binary shader code πŸ’–
  • length β€” the length of the array whose address you handed over in binary.

πŸ¦‹ DESCRIPTION πŸ¦‹

so glShaderBinary loads pre-compiled shader binary code into the count shader objects whose handles are given in shaders. binary points to length bytes of binary shader code stored in client memory, and binaryFormat specifies the format of that pre-compiled code. iconic behavior honestly.

the binary image contained in binary gets decoded according to the extension specification that defines the specified binaryFormat token. and here's the tea: OpenGL does not define any specific binary formats, but it does provide a mechanism to obtain token values for such formats provided by such extensions. so like, the vibes are extension-defined, iykyk πŸ‘‘

depending on the types of the shader objects in shaders, glShaderBinary will individually load binary vertex or fragment shaders, or load an executable binary that contains an optimized pair of vertex and fragment shaders stored in the same binary. main character energy either way ⭐


πŸ’€ ERRORS πŸ’€

  • GL_INVALID_OPERATION is generated if more than one of the handles in shaders refers to the same shader object. girl, no duplicates, that's not the vibe πŸ™ˆ
  • GL_INVALID_ENUM is generated if binaryFormat is not an accepted value.
  • GL_INVALID_VALUE is generated if the data pointed to by binary does not match the format specified by binaryFormat. mismatch era = not slaying 😭

πŸ”₯ ASSOCIATED GETS πŸ”₯

  • glGet() with parameter GL_NUM_SHADER_BINARY_FORMATS.
  • glGet() with parameter GL_SHADER_BINARY_FORMATS.

πŸ‘‘ VERSION SUPPORT πŸ‘‘

the original page had a whole grid for this (tables are so not the aesthetic here), so let me just tell you the lore: the columns were the 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 β€” and the row was for the function/feature name glShaderBinary.

  • glShaderBinary in 2.0 β€” - (nope)
  • glShaderBinary in 2.1 β€” - (nope)
  • glShaderBinary in 3.0 β€” - (nope)
  • glShaderBinary in 3.1 β€” - (nope)
  • glShaderBinary in 3.2 β€” - (nope)
  • glShaderBinary in 3.3 β€” - (nope)
  • glShaderBinary in 4.0 β€” - (nope)
  • glShaderBinary in 4.1 β€” βœ” (we're so back)
  • glShaderBinary in 4.2 β€” βœ”
  • glShaderBinary in 4.3 β€” βœ”
  • glShaderBinary in 4.4 β€” βœ”
  • glShaderBinary in 4.5 β€” βœ”

so basically: 4.1 and up only, periodt πŸ’…


🌈 SEE ALSO 🌈

  • glGetProgram()
  • glGetProgramBinary()
  • glProgramBinary()

go read those next bestie, they're lowkey the sibling pages 🧚


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, love u, go compile something gorgeous πŸ’–βœ¨πŸŽ€ source: [FIXME: source], dated 08/09/2021 β€” mwah, see u in the next manpage 🫢🌸

πŸ“¦ where this page comes from