glShaderBinary

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,

    glShaderBinary loads precompiled shader binaries.
    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.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值