glShaderBinary
来源:互联网 发布:java中int几个字节 编辑:程序博客网 时间:2024/05/22 00:34
Name
glShaderBinary — load a precompiled shader binary
C Specification
void glShaderBinary(GLsizei n, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length);
Parameters
n Specifies the number of shader object handles present in shaders.
shaders Specifies a pointer to an array of shader object handles into which the shader binary will be loaded.
binaryformat Specifies the shader binary format.
binary Specifies a pointer to the shader binary data in client memory.
length Specifies the length of the shader binary data in bytes.DescriptionFor implementations that support them,
shaders contains a list of n
shader object handles. Each handle refers to a unique shader type (vertex shader or
fragment shader). binary points to precompiled binary
shader code in client memory, and binaryformat denotes
the format of the pre-compiled code.The binary image is decoded according to the extension
specification defining the specified binaryformat.
OpenGL ES defines no specific binary formats, but does provide a mechanism
to obtain symbolic constants for such formats provided by extensions. The
number of shader binary formats supported can be obtained by querying the
value of GL_NUM_SHADER_BINARY_FORMATS. The list of
specific binary formats supported can be obtained by querying the value of
GL_SHADER_BINARY_FORMATS.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.If glShaderBinary fails, the old state of shader
objects for which the binary was being loaded will not be restored.NotesShader binary support is optional and thus must be queried
before use by calling glGet
with arguments GL_NUM_SHADER_BINARY_FORMATS and
GL_SHADER_BINARY_FORMATS. glShaderBinary
generates GL_INVALID_OPERATION on implementations
that do not support any shader binary formats. Such implementations instead
offer the glShaderSource
alternative for supplying OpenGL ES Shading Language shader source for compilation.If shader binary formats are supported, then an implementation may
require that an optimized pair of vertex and fragment shader
binaries that were compiled together to be specified to
glLinkProgram.
Not specifying an optimized pair my cause
glLinkProgram
to fail. Such a restriction, if it exists, will be documented in
the extension specification defining binaryformat.OpenGL copies the shader binary data when
glShaderBinary is called, so an application
may free its copy of the data immediately after
the function returns.ErrorsGL_INVALID_ENUM is generated if
binaryformat is not a supported format returned in
GL_SHADER_BINARY_FORMATS.GL_INVALID_VALUE is generated if any value in
shaders is not a vlue generated by OpenGL.GL_INVALID_VALUE is generated if the format of the
data pointed to by binary does not match
binaryformat.GL_INVALID_VALUE is generated if n
or length is negative.GL_INVALID_OPERATION is generated if any value in
shaders is not a shader object, or if there
is more than one vertex shader object handle or more than one fragment shader
object handle in shaders.
NAME
glShaderBinary - load pre-compiled shader binaries
C SPECIFICATION
void glShaderBinary(GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length);
PARAMETERS
count Specifies the number of shader object handles contained in shaders. shaders Specifies the address of an array of shader handles into which to load pre-compiled shader binaries. binaryFormat Specifies the format of the shader binaries contained in binary. binary Specifies the address of an array of bytes containing pre-compiled binary shader code. length Specifies the length of the array whose address is given in binary.
DESCRIPTION
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. binaryFormat specifies the format of the pre-compiled code. The binary image contained in binary will be decoded according to the extension specification defining the specified binaryFormat token. OpenGL does not define any specific binary formats, but it does provide a mechanism to obtain token vaues for such formats provided by such extensions. 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.
ERRORS
GL_INVALID_OPERATION is generated if more than one of the handles in shaders refers to the same shader object. 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.
- glShaderBinary
- 第一章 文件IO的操作
- 使用 Jersey 和 Apache Tomcat 构建 RESTful Web 服务
- MySQL常用的HINT
- 平衡PCB层叠PCB设计的方法
- KissXml——xml解析库
- glShaderBinary
- 数据库的事务日志已满。若要查明无法重用日志中的空间的原因
- 使用Spring注解完成Bean的定义
- 浅谈Linux用户权限管理之三(文件与权限的设定)
- Debug Android and Linux suspend and resume (中文)
- 我理解的敏捷测试
- 平衡PCB层叠PCB设计的方法
- 序列化 对象 JOSN 互转
- 无声的语言 编队骑行常用手势