glShaderBinary Function
GL_APICALL void GL_APIENTRY glShaderBinary(
GLint n,
const GLuint * shaders,
GLenum binaryformat,
const void * binary,
GLint length
);
| 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. |
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. The address specified in binary must be 4-byte aligned.
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. (Note that this does not include shader assembly code that consists of only subroutines and contains no main label.)
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 shaders with multiple geometry shaders.
This function generates the following errors.
GL_INVALID_VALUE | n 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_ENUM | The binaryformat argument was set to an invalid value. |
GL_INVALID_OPERATION | The 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_MEMORY | Failed to allocate the management region. |
GL_INVALID_OPERATION | The type of shader object specified with shaders differs from the type in the shader assembly language in the shader binary. |
CONFIDENTIAL