diff options
author | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-01 21:50:59 +0000 |
---|---|---|
committer | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-01 21:50:59 +0000 |
commit | 78b514be30c67dad84bb8e2b6dfac3cfb15c79ff (patch) | |
tree | dd7d62dafa82bd6fbe087fb6f4de8148939c34ee /third_party/khronos/GLES2/gl2ext.h | |
parent | 107d6e00cece1fb1545f5403193576f822e93a09 (diff) | |
download | chromium_src-78b514be30c67dad84bb8e2b6dfac3cfb15c79ff.zip chromium_src-78b514be30c67dad84bb8e2b6dfac3cfb15c79ff.tar.gz chromium_src-78b514be30c67dad84bb8e2b6dfac3cfb15c79ff.tar.bz2 |
Allow textures to be moved from one GL context group to another.
The function glProduceTexture(target, mailbox) removes a texture from a context group and puts it in a "mailbox" that is accessible to all context groups on the same channel.
Then glConsumeTexture(target, mailbox) adds the texture to a context group, possibly a different one, if the caller knows the name of the mailbox.
From the point of view of the caller, the texture objects themselves do not move, just the texels. In terms of the underlying GL, the TextureInfo service IDs are reassigned as necessary.
A texture in a mailbox is destroyed when the context group that put it there is destroyed.
Expected usage is:
// Context 1
glBindTexture(GL_TEXTURE_2D, foo);
glProduceTexture(GL_TEXTURE_2D, secret_name);
glFlush();
// Context 2
glBindTexture(GL_TEXTURE_2D, bar);
glConsumeTexture(GL_TEXTURE_2D, secret_name);
Review URL: http://codereview.chromium.org/10106015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134791 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/khronos/GLES2/gl2ext.h')
-rw-r--r-- | third_party/khronos/GLES2/gl2ext.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/third_party/khronos/GLES2/gl2ext.h b/third_party/khronos/GLES2/gl2ext.h index 8effd30..45943a0 100644 --- a/third_party/khronos/GLES2/gl2ext.h +++ b/third_party/khronos/GLES2/gl2ext.h @@ -1982,6 +1982,26 @@ typedef void (GL_APIENTRYP PFNGLCOPYTEXTURECHROMIUM) (GLenum target, GLenum sour #define GL_COMMANDS_ISSUED_CHROMIUM 0x84F2 #endif +/* GL_CHROMIUM_texture_mailbox */ +#ifndef GL_CHROMIUM_texture_mailbox +#define GL_CHROMIUM_texture_mailbox 1 +#define GL_MAILBOX_SIZE_CHROMIUM 64 +#ifdef GL_GLEXT_PROTOTYPES +#define glGenMailboxCHROMIUM GLES2_GET_FUN(GenMailboxCHROMIUM) +#define glProduceTextureCHROMIUM GLES2_GET_FUN(ProduceTextureCHROMIUM) +#define glConsumeTextureCHROMIUM GLES2_GET_FUN(ConsumeTextureCHROMIUM) +#if !defined(GLES2_USE_CPP_BINDINGS) +GL_APICALL void GL_APIENTRY glGenMailboxCHROMIUM (GLbyte* mailbox); +GL_APICALL void GL_APIENTRY glProduceTextureCHROMIUM (GLenum target, const GLbyte* mailbox); +GL_APICALL void GL_APIENTRY glConsumeTextureCHROMIUM (GLenum target, const GLbyte* mailbox); +#endif +#else +typedef void (GL_APIENTRYP PFNGLGENMAILBOXCHROMIUM) (GLbyte* mailbox); +typedef void (GL_APIENTRYP PFNGLPRODUCETEXTURECHROMIUM) (GLenum target, const GLbyte* mailbox); +typedef void (GL_APIENTRYP PFNGLCONSUMETEXTURECHROMIUM) (GLenum target, const GLbyte* mailbox); +#endif +#endif + #ifdef __cplusplus } #endif |