glShaderBinary Function

Syntax

GL_APICALL void GL_APIENTRY glShaderBinary(
     GLint n,
     const GLuint * shaders,
     GLenum binaryformat,
     const void * binary,
     GLint length
);

Arguments

Name Description
in n Number of shader objects in the shaders array.
in shaders Array storing the shader objects.
in binaryformat Shader binary format.
in binary Pointer to the shader binary data.
in length Size (in bytes) of the shader binary data.

Return Values

No values are returned.

Description

Loads shader binaries.

Set shaders to an array storing n shader objects. Specify shader objects that have been generated by glCreateShader.

Set binaryformat to GL_PLATFORM_BINARY_DMP. Set binary to a shader binary output by ctr_VertexShaderLinker.

Set length to the size (in bytes) of binary.

The shader binary specified by binary is loaded into the shader objects specified by shaders. Shader binaries are loaded into the shader objects in shaders in the order in which they were specified to ctr_VertexShaderLinker when the shader binaries were linked. (Shader assemblers with only subroutines that do not include the main label are excluded.)

Vertex shaders must be loaded into shader objects created with the GL_VERTEX_SHADER type, and geometry shaders must be loaded into shader objects created with the GL_GEOMETRY_SHADER_DMP type.

A geometry shader binary cannot be loaded by itself. Geometry shaders must be loaded together with vertex shaders as a binary linked by ctr_VertexShaderLinker.

You can specify multiple vertex and geometry shader objects in shaders because ctr_VertexShaderLinker can link multiple vertex with multiple geometry shaders.

The following errors occur in this function.

GL_INVALID_VALUEn or length was set to a negative value; the data in binary uses a different format than binaryformat; or shaders was set to an invalid value.
GL_INVALID_ENUMThe binaryformat argument was set to an invalid value.
GL_INVALID_OPERATIONThe value specified for the length argument is smaller than the shader binary file, or the binary argument was set to a shader binary assembled with an incompatible version of ctr_VertexShaderAssembler.
GL_OUT_OF_MEMORYFailed to allocate the management region.
GL_INVALID_OPERATIONThe type of shader object specified with shaders differs from the type of shader assembler in the shader binary.

Revision History

2010/01/07
Initial version.

CONFIDENTIAL