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 inshaders, 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 insidebinary. 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 inbinary.
π¦ 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_OPERATIONis generated if more than one of the handles inshadersrefers to the same shader object. girl, no duplicates, that's not the vibe πGL_INVALID_ENUMis generated ifbinaryFormatis not an accepted value.GL_INVALID_VALUEis generated if the data pointed to bybinarydoes not match the format specified bybinaryFormat. mismatch era = not slaying π
π₯ ASSOCIATED GETS π₯
glGet()with parameterGL_NUM_SHADER_BINARY_FORMATS.glGet()with parameterGL_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.
glShaderBinaryin2.0β-(nope)glShaderBinaryin2.1β-(nope)glShaderBinaryin3.0β-(nope)glShaderBinaryin3.1β-(nope)glShaderBinaryin3.2β-(nope)glShaderBinaryin3.3β-(nope)glShaderBinaryin4.0β-(nope)glShaderBinaryin4.1ββ(we're so back)glShaderBinaryin4.2ββglShaderBinaryin4.3ββglShaderBinaryin4.4ββglShaderBinaryin4.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 π
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
- 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