diff options
author | kaanb@chromium.org <kaanb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-16 10:46:01 +0000 |
---|---|---|
committer | kaanb@chromium.org <kaanb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-16 10:46:01 +0000 |
commit | e9ec4269f805d8abcb187890a6ec82c4fffb861a (patch) | |
tree | 4e46f3971b5e764ea795305a6010dad3abf2ff1c /gpu/GLES2 | |
parent | b9ed58f046141b4610c1bdc966d962d5fb95ac6b (diff) | |
download | chromium_src-e9ec4269f805d8abcb187890a6ec82c4fffb861a.zip chromium_src-e9ec4269f805d8abcb187890a6ec82c4fffb861a.tar.gz chromium_src-e9ec4269f805d8abcb187890a6ec82c4fffb861a.tar.bz2 |
GPU client side changes for GpuMemoryBuffers:
- Introduces a new GL extension CHROMIUM_map_image that contains Create/Destroy/Map/Unmap/GetImageParameteriv methods.
- A new data structure called GpuMemoryBufferTracker to track these buffers and images on the client side.
BUG=175012
Review URL: https://chromiumcodereview.appspot.com/14456004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200505 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/GLES2')
-rw-r--r-- | gpu/GLES2/extensions/CHROMIUM/CHROMIUM_map_image.txt | 107 | ||||
-rw-r--r-- | gpu/GLES2/gl2chromium_autogen.h | 6 | ||||
-rw-r--r-- | gpu/GLES2/gl2extchromium.h | 33 |
3 files changed, 146 insertions, 0 deletions
diff --git a/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_map_image.txt b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_map_image.txt new file mode 100644 index 0000000..6304fda --- /dev/null +++ b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_map_image.txt @@ -0,0 +1,107 @@ +Name + + CHROMIUM_map_image + +Name Strings + + GL_CHROMIUM_map_image + +Version + + Last Modifed Date: May 9, 2013 + +Dependencies + + OpenGL ES 2.0 is required. + +Overview + + This extension allows for more efficient uploading of texture data through + Chromium's OpenGL ES 2.0 implementation. + + For security reasons Chromium accesses the GPU from a separate process. User + processes are not allowed to access the GPU directly. This multi-process + architechure has the advantage that GPU operations can be secured and + pipelined but it has the disadvantage that all data that is going to be + passed to GPU must first be made available to the separate GPU process. + + This extension helps the application directly allocate and access texture + memory. + +Issues + + None + +New Tokens + + None + +New Procedures and Functions + + GLuint CreateImageCHROMIUM (GLsizei width, GLsizei height, + GLenum internalformat) + + Allocate an image with width equal to <width> and height equal + to <height> stored in format <internalformat>. + + Returns a unique identifier for the allocated image that could be used + in subsequent operations. + + INVALID_VALUE is generated if <width> or <height> is nonpositive. + + void DestroyImageCHROMIUM (GLuint image_id) + + Frees the image previously allocated by a call to CreateImageCHROMIUM. + + INVALID_OPERATION is generated if <image_id> is not a valid image id. + + void* MapImageCHROMIUM (GLuint image_id, GLenum access) + + Returns a pointer to in the user memory for the application to modify + the image. <access> parameter defines if the user will read or write the + pixels. + + INVALID_OPERATION is generated if <image_id> is not a valid image id. + + INVALID_OPERATION is generated if the image was already mapped by a previous + call to this method. + + INVALID_ENUM is generated if <access> is not one of WRITE_ONLY, READ_ONLY + and READ_WRITE. + + void UnmapImageCHROMIUM (GLuint image_id) + + Removes the mapping created by a call to MapImageCHROMIUM. + + Note that after calling UnmapImageCHROMIUM the application should assume + that the memory returned by MapImageCHROMIUM is off limits and is no longer + accessible by the application. Accessing it after calling + UnmapImageCHROMIUM will produce undefined results. + + INVALID_OPERATION is generated if <image_id> is not a valid image id. + + INVALID_OPERATION is generated if the image was not already mapped by a + previous call to MapImageCHROMIUM. + + void GetImageParameterivCHROMIUM(GLuint image_id, GLenum pname, + GLint* params) + + Sets <params> to the integer value of the parameter specified by <pname> + for the image specified by <image_id>. <params> is expected to be + properly allocated before calling this method. + + INVALID_OPERATION is generated if <image_id> is not a valid image id. + + INVALID_ENUM is generated if <pname> is not IMAGE_ROWBYTES_CHROMIUM. + +Errors + + None. + +New State + + None. + +Revision History + + 5/9/2013 Documented the extension diff --git a/gpu/GLES2/gl2chromium_autogen.h b/gpu/GLES2/gl2chromium_autogen.h index fa099e6..e8970e0 100644 --- a/gpu/GLES2/gl2chromium_autogen.h +++ b/gpu/GLES2/gl2chromium_autogen.h @@ -182,6 +182,8 @@ #define glEnableFeatureCHROMIUM GLES2_GET_FUN(EnableFeatureCHROMIUM) #define glMapBufferCHROMIUM GLES2_GET_FUN(MapBufferCHROMIUM) #define glUnmapBufferCHROMIUM GLES2_GET_FUN(UnmapBufferCHROMIUM) +#define glMapImageCHROMIUM GLES2_GET_FUN(MapImageCHROMIUM) +#define glUnmapImageCHROMIUM GLES2_GET_FUN(UnmapImageCHROMIUM) #define glMapBufferSubDataCHROMIUM GLES2_GET_FUN(MapBufferSubDataCHROMIUM) #define glUnmapBufferSubDataCHROMIUM GLES2_GET_FUN(UnmapBufferSubDataCHROMIUM) #define glMapTexSubImage2DCHROMIUM GLES2_GET_FUN(MapTexSubImage2DCHROMIUM) @@ -199,6 +201,10 @@ CreateStreamTextureCHROMIUM) #define glDestroyStreamTextureCHROMIUM GLES2_GET_FUN( \ DestroyStreamTextureCHROMIUM) +#define glCreateImageCHROMIUM GLES2_GET_FUN(CreateImageCHROMIUM) +#define glDestroyImageCHROMIUM GLES2_GET_FUN(DestroyImageCHROMIUM) +#define glGetImageParameterivCHROMIUM GLES2_GET_FUN( \ + GetImageParameterivCHROMIUM) #define glGetTranslatedShaderSourceANGLE GLES2_GET_FUN( \ GetTranslatedShaderSourceANGLE) #define glPostSubBufferCHROMIUM GLES2_GET_FUN(PostSubBufferCHROMIUM) diff --git a/gpu/GLES2/gl2extchromium.h b/gpu/GLES2/gl2extchromium.h index 9193467..d23191c 100644 --- a/gpu/GLES2/gl2extchromium.h +++ b/gpu/GLES2/gl2extchromium.h @@ -94,6 +94,39 @@ typedef GLboolean (GL_APIENTRY PFNGLUNMAPBUFFERCHROMIUM) (GLuint target); #endif #endif /* GL_CHROMIUM_pixel_transfer_buffer_object */ +/* GL_CHROMIUM_map_image */ +#ifndef GL_CHROMIUM_map_image +#define GL_CHROMIUM_map_image 1 + +#ifndef GL_IMAGE_ROWBYTES_CHROMIUM +#define GL_IMAGE_ROWBYTES_CHROMIUM 0x78F0 +#endif + +#ifndef GL_READ_WRITE +#define GL_READ_WRITE 0x88BA +#endif + +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL GLuint GL_APIENTRY glCreateImageCHROMIUM( + GLsizei width, GLsizei height, GLenum internalformat); +GL_APICALL void GL_APIENTRY glDestroyImageCHROMIUM(GLuint image_id); +GL_APICALL void GL_APIENTRY glGetImageParameterivCHROMIUM( + GLuint image_id, GLenum pname, GLint* params); +GL_APICALL void* GL_APIENTRY glMapImageCHROMIUM(GLuint image_id, GLenum access); +GL_APICALL void GL_APIENTRY glUnmapImageCHROMIUM(GLuint image_id); +#endif +typedef GLuint (GL_APIENTRYP PFNGLCREATEIMAGECHROMIUMPROC) ( + GLsizei width, GLsizei height, GLenum internalformat); +typedef void ( + GL_APIENTRYP PFNGLDESTROYIMAGECHROMIUMPROC) (GLuint image_id); +typedef void ( + GL_APIENTRYP PFNGLGETIMAGEPARAMETERIVCHROMIUMPROC) ( + GLuint image_id, GLenum pname, GLint* params); +typedef void* (GL_APIENTRYP PFNGLMAPIMAGECHROMIUMPROC) ( + GLuint image_id, GLenum access); +typedef void (GL_APIENTRYP PFNGLUNMAPIMAGECHROMIUMPROC) (GLuint image_id); +#endif /* GL_CHROMIUM_map_image */ + /* GL_CHROMIUM_map_sub */ #ifndef GL_CHROMIUM_map_sub #define GL_CHROMIUM_map_sub 1 |