1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE book PUBLIC
"-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3 "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4 <refentry id=
"glShaderBinary">
9 <holder>Khronos Group
</holder>
12 <refentrytitle>glShaderBinary
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glShaderBinary
</refname>
17 <refpurpose>load pre-compiled shader binaries
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glShaderBinary
</function></funcdef>
23 <paramdef>GLsizei
<parameter>count
</parameter></paramdef>
24 <paramdef>const GLuint *
<parameter>shaders
</parameter></paramdef>
25 <paramdef>GLenum
<parameter>binaryFormat
</parameter></paramdef>
26 <paramdef>const void *
<parameter>binary
</parameter></paramdef>
27 <paramdef>GLsizei
<parameter>length
</parameter></paramdef>
31 <refsect1 id=
"parameters"><title>Parameters
</title>
34 <term><parameter>count
</parameter></term>
37 Specifies the number of shader object handles contained in
<parameter>shaders
</parameter>.
42 <term><parameter>shaders
</parameter></term>
45 Specifies the address of an array of shader handles into which to load pre-compiled shader binaries.
50 <term><parameter>binaryFormat
</parameter></term>
53 Specifies the format of the shader binaries contained in
<parameter>binary
</parameter>.
58 <term><parameter>binary
</parameter></term>
61 Specifies the address of an array of bytes containing pre-compiled binary shader code.
66 <term><parameter>length
</parameter></term>
69 Specifies the length of the array whose address is given in
<parameter>binary
</parameter>.
75 <refsect1 id=
"description"><title>Description
</title>
77 <function>glShaderBinary
</function> loads pre-compiled shader binary code into the
<parameter>count
</parameter>
78 shader objects whose handles are given in
<parameter>shaders
</parameter>.
<parameter>binary
</parameter>
79 points to
<parameter>length
</parameter> bytes of binary shader code stored in client memory.
80 <parameter>binaryFormat
</parameter> specifies the format of the pre-compiled code.
83 The binary image contained in
<parameter>binary
</parameter> will be decoded according to the extension
84 specification defining the specified
<parameter>binaryFormat
</parameter> token. OpenGL
85 does not define any specific binary formats, but it does provide a mechanism to obtain token
86 vaues for such formats provided by such extensions.
89 Depending on the types of the shader objects in
<parameter>shaders
</parameter>,
<function>glShaderBinary
</function>
90 will individually load binary vertex or fragment shaders, or load an executable binary that contains an optimized
91 pair of vertex and fragment shaders stored in the same binary.
94 <refsect1 id=
"errors"><title>Errors
</title>
96 <constant>GL_INVALID_OPERATION
</constant> is generated if more than one of the handles in
97 <parameter>shaders
</parameter> refers to the same shader object.
100 <constant>GL_INVALID_ENUM
</constant> is generated if
<parameter>binaryFormat
</parameter> is not an
104 <constant>GL_INVALID_VALUE
</constant> is generated if the data pointed to by
<parameter>binary
</parameter>
105 does not match the format specified by
<parameter>binaryFormat
</parameter>.
108 <refsect1 id=
"associatedgets"><title>Associated Gets
</title>
110 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with parameter
<constant>GL_NUM_SHADER_BINARY_FORMATS
</constant>.
113 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with parameter
<constant>GL_SHADER_BINARY_FORMATS
</constant>.
116 <refsect1 id=
"seealso"><title>See Also
</title>
118 <citerefentry><refentrytitle>glGetProgram
</refentrytitle></citerefentry>,
119 <citerefentry><refentrytitle>glGetProgramBinary
</refentrytitle></citerefentry>,
120 <citerefentry><refentrytitle>glProgramBinary
</refentrytitle></citerefentry>
123 <refsect1 id=
"Copyright"><title>Copyright
</title>
125 Copyright
<trademark class=
"copyright"></trademark> 2010 Khronos Group.
126 This material may be distributed subject to the terms and conditions set forth in
127 the Open Publication License, v
1.0,
8 June
1999.
128 <ulink url=
"http://opencontent.org/openpub/">http://opencontent.org/openpub/
</ulink>.