Name

    CHROMIUM_texture_mailbox

Name Strings

    GL_CHROMIUM_texture_mailbox

Version

    Last Modifed Date: August 3, 2016

Dependencies

    OpenGL ES 2.0 is required.

Overview

    This extension defines a way of sharing texture image data between texture
    objects in different contexts where the contexts would not normally share
    texture resources. Five new functions are exported. glGenMailboxCHROMIUM
    generates a name that can be used to identify texture image data outside
    the scope of a context group. glProduceTextureDirectCHROMIUM associates a
    texture object with a global mailbox name. glCreateAndConsumeTextureCHROMIUM
    associates the texture object referenced by a mailbox name to a texture
    name.

New Procedures and Functions

    void glGenMailboxCHROMIUM (GLbyte *mailbox)

    Generates a unique name identifying a mailbox. The name is generated using
    a cryptographic random number generator and is intended to be difficult to
    guess. The scope of the name is implementation specific, for example it
    might not span multiple displays.

    <mailbox> returns a GL_MAILBOX_SIZE_CHROMIUM byte sized name

    void glProduceTextureDirectCHROMIUM (GLuint texture, const GLbyte *mailbox)

    Associates the specified texture object with the mailbox name.  A given
    texture object can be associated with several mailbox names. If a
    mailbox name was previously associated with a texture object, that
    previous association is broken.

    This operation does not change the texture bindings or alter the bound
    texture in any way. If <texture> is 0 then any previous association of the
    mailbox with a texture object is broken and no new association is created.

    <texture> Specifies the name of a texture.

    <mailbox> identifies a GL_MAILBOX_SIZE_CHROMIUM byte sized name returned by
    glGenMailboxCHROMIUM.

    INVALID_OPERATION is generated if <texture> is not a valid texture.

    INVALID_OPERATION is generated if <mailbox> is invalid.


    GLuint glCreateAndConsumeTextureCHROMIUM (const GLbyte *mailbox)

    Returns a new texture name pointing to the texture object associated with
    the mailbox name. Does not alter the texture bindings or alter the currently
    bound texture in any way. All the contexts that have consumed the texture
    object, as well as produced it share the texture object, as if the contexts
    were part of the share group. The texture object is deleted once all
    contexts have deleted the texture name associated with the texture object,
    and detached it from all framebuffer objects as well as texture unit
    bindings. See Appendix C of the OpenGL ES 2.0 specification for details
    relative to visibility in one context of changes to the shared texture
    object in another context.

    If glCreateAndConsumeTextureCHROMIUM generates an error, the new texture
    name remains unbound.  It is treated in the same way as a new texture name
    returned by GenTextures.

    INVALID_OPERATION is generated if <mailbox> is invalid.

    INVALID_OPERATION is generated if <mailbox> is not associated with a texture
    object.

New Tokens

    The size of a mailbox name in bytes.

        GL_MAILBOX_SIZE_CHROMIUM                             64

Errors

    None.

New Tokens

    None.

New State

    None.

Revision History

    4/25/2011    Documented the extension
    5/23/2013    Major revision in Produce/Consume semantics, introducing
                 sharing.
    6/02/2014    Added glProduceTextureDirectCHROMIUM and
                 glCreateAndConsumeTextureCHROMIUM definitions.
    8/03/2016    Allow unbinding mailbox using glProduceTextureDirectCHROMIUM.
    10/20/2017   Remove glConsumeTextureCHROMIUM and update
                 glCreateAndConsumeTextureCHROMIUM definition.
    11/20/2017   Remove glProduceTextureCHROMIUM.  Removed <target> arguments
                 from glProduceTextureDirectCHROMIUM and
                 glCreateAndConsumeTextureCHROMIUM, and updated definition.
