diff options
-rw-r--r-- | gpu/GLES2/gl2chromium.h | 8 | ||||
-rw-r--r-- | gpu/GLES2/gl2extchromium.h | 478 | ||||
-rwxr-xr-x | gpu/command_buffer/build_gles2_cmd_buffer.py | 269 | ||||
-rw-r--r-- | gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h | 2 | ||||
-rw-r--r-- | third_party/khronos/GLES2/gl2ext.h | 379 |
5 files changed, 751 insertions, 385 deletions
diff --git a/gpu/GLES2/gl2chromium.h b/gpu/GLES2/gl2chromium.h index 7cc84f0..ff22141 100644 --- a/gpu/GLES2/gl2chromium.h +++ b/gpu/GLES2/gl2chromium.h @@ -6,12 +6,16 @@ // gpu/command_buffer/build_gles2_cmd_buffer.py // DO NOT EDIT! -// Because we are using both the real system GL and our own. -// emulated GL we need to use different names to avoid conflicts. +// This file contains Chromium-specific GLES2 declarations. #ifndef GPU_GLES2_GL2CHROMIUM_H_ #define GPU_GLES2_GL2CHROMIUM_H_ +#include <GLES2/gl2platform.h> +#define GL_CONTEXT_LOST 0x300E + +// Because we are using both the real system GL and our own +// emulated GL we need to use different names to avoid conflicts. #if defined(GLES2_USE_CPP_BINDINGS) #define GLES2_GET_FUN(name) gles2::GetGLContext()->name #else diff --git a/gpu/GLES2/gl2extchromium.h b/gpu/GLES2/gl2extchromium.h new file mode 100644 index 0000000..037c346 --- /dev/null +++ b/gpu/GLES2/gl2extchromium.h @@ -0,0 +1,478 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// This file is auto-generated from +// gpu/command_buffer/build_gles2_cmd_buffer.py +// DO NOT EDIT! + +// This file contains Chromium-specific GLES2 extensions declarations. + +#ifndef GPU_GLES2_GL2EXTCHROMIUM_H_ +#define GPU_GLES2_GL2EXTCHROMIUM_H_ + +#include <GLES2/gl2chromium.h> +#ifdef __cplusplus +extern "C" { +#endif + +/* GL_CHROMIUM_iosurface */ +#ifndef GL_CHROMIUM_iosurface +#define GL_CHROMIUM_iosurface 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glTexImageIOSurface2DCHROMIUM( + GLenum target, GLsizei width, GLsizei height, GLuint ioSurfaceId, + GLuint plane); +#endif +typedef void ( + GL_APIENTRYP PFNGLTEXIMAGEIOSURFACE2DCHROMIUMPROC) ( + GLenum target, GLsizei width, GLsizei height, GLuint ioSurfaceId, + GLuint plane); +#endif /* GL_CHROMIUM_iosurface */ + +/* GL_CHROMIUM_gpu_memory_manager */ +#ifndef GL_CHROMIUM_gpu_memory_manager +#define GL_CHROMIUM_gpu_memory_manager 1 + +#ifndef GL_TEXTURE_POOL_UNMANAGED_CHROMIUM +#define GL_TEXTURE_POOL_UNMANAGED_CHROMIUM 0x6002 +#endif + +#ifndef GL_TEXTURE_POOL_CHROMIUM +#define GL_TEXTURE_POOL_CHROMIUM 0x6000 +#endif + +#ifndef GL_TEXTURE_POOL_MANAGED_CHROMIUM +#define GL_TEXTURE_POOL_MANAGED_CHROMIUM 0x6001 +#endif +#endif /* GL_CHROMIUM_gpu_memory_manager */ + +/* GL_CHROMIUM_texture_mailbox */ +#ifndef GL_CHROMIUM_texture_mailbox +#define GL_CHROMIUM_texture_mailbox 1 + +#ifndef GL_MAILBOX_SIZE_CHROMIUM +#define GL_MAILBOX_SIZE_CHROMIUM 64 +#endif +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glGenMailboxCHROMIUM(GLbyte* mailbox); +#endif +typedef void (GL_APIENTRYP PFNGLGENMAILBOXCHROMIUMPROC) (GLbyte* mailbox); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glProduceTextureCHROMIUM( + GLenum target, const GLbyte* mailbox); +#endif +typedef void ( + GL_APIENTRYP PFNGLPRODUCETEXTURECHROMIUMPROC) ( + GLenum target, const GLbyte* mailbox); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glConsumeTextureCHROMIUM( + GLenum target, const GLbyte* mailbox); +#endif +typedef void ( + GL_APIENTRYP PFNGLCONSUMETEXTURECHROMIUMPROC) ( + GLenum target, const GLbyte* mailbox); +#endif /* GL_CHROMIUM_texture_mailbox */ + +/* GL_CHROMIUM_pixel_transfer_buffer_object */ +#ifndef GL_CHROMIUM_pixel_transfer_buffer_object +#define GL_CHROMIUM_pixel_transfer_buffer_object 1 + +#ifndef GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM +#define GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM 0x88EC +#endif + +#ifndef GL_PIXEL_UNPACK_TRANSFER_BUFFER_BINDING_CHROMIUM +#define GL_PIXEL_UNPACK_TRANSFER_BUFFER_BINDING_CHROMIUM 0x88EF +#endif +#endif /* GL_CHROMIUM_pixel_transfer_buffer_object */ + +/* GL_CHROMIUM_map_sub */ +#ifndef GL_CHROMIUM_map_sub +#define GL_CHROMIUM_map_sub 1 + +#ifndef GL_READ_ONLY +#define GL_READ_ONLY 0x88B8 +#endif + +#ifndef GL_WRITE_ONLY +#define GL_WRITE_ONLY 0x88B9 +#endif +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void* GL_APIENTRY glMapBufferSubDataCHROMIUM( + GLuint target, GLintptr offset, GLsizeiptr size, GLenum access); +#endif +typedef void* ( + GL_APIENTRYP PFNGLMAPBUFFERSUBDATACHROMIUMPROC) ( + GLuint target, GLintptr offset, GLsizeiptr size, GLenum access); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glUnmapBufferSubDataCHROMIUM(const void* mem); +#endif +typedef void ( + GL_APIENTRYP PFNGLUNMAPBUFFERSUBDATACHROMIUMPROC) (const void* mem); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void* GL_APIENTRY glMapTexSubImage2DCHROMIUM( + GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, + GLsizei height, GLenum format, GLenum type, GLenum access); +#endif +typedef void* ( + GL_APIENTRYP PFNGLMAPTEXSUBIMAGE2DCHROMIUMPROC) ( + GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, + GLsizei height, GLenum format, GLenum type, GLenum access); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glUnmapTexSubImage2DCHROMIUM(const void* mem); +#endif +typedef void ( + GL_APIENTRYP PFNGLUNMAPTEXSUBIMAGE2DCHROMIUMPROC) (const void* mem); +#endif /* GL_CHROMIUM_map_sub */ + +/* GL_CHROMIUM_request_extension */ +#ifndef GL_CHROMIUM_request_extension +#define GL_CHROMIUM_request_extension 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL const GLchar* GL_APIENTRY glGetRequestableExtensionsCHROMIUM(); +#endif +typedef const GLchar* ( + GL_APIENTRYP PFNGLGETREQUESTABLEEXTENSIONSCHROMIUMPROC) (); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glRequestExtensionCHROMIUM(const char* extension); +#endif +typedef void ( + GL_APIENTRYP PFNGLREQUESTEXTENSIONCHROMIUMPROC) (const char* extension); +#endif /* GL_CHROMIUM_request_extension */ + +/* GL_CHROMIUM_get_error_query */ +#ifndef GL_CHROMIUM_get_error_query +#define GL_CHROMIUM_get_error_query 1 + +#ifndef GL_GET_ERROR_QUERY_CHROMIUM +#define GL_GET_ERROR_QUERY_CHROMIUM 0x84F3 +#endif +#endif /* GL_CHROMIUM_get_error_query */ + +/* GL_CHROMIUM_texture_from_image */ +#ifndef GL_CHROMIUM_texture_from_image +#define GL_CHROMIUM_texture_from_image 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glBindTexImage2DCHROMIUM( + GLenum target, GLint imageId); +#endif +typedef void ( + GL_APIENTRYP PFNGLBINDTEXIMAGE2DCHROMIUMPROC) ( + GLenum target, GLint imageId); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glReleaseTexImage2DCHROMIUM( + GLenum target, GLint imageId); +#endif +typedef void ( + GL_APIENTRYP PFNGLRELEASETEXIMAGE2DCHROMIUMPROC) ( + GLenum target, GLint imageId); +#endif /* GL_CHROMIUM_texture_from_image */ + +/* GL_CHROMIUM_rate_limit_offscreen_context */ +#ifndef GL_CHROMIUM_rate_limit_offscreen_context +#define GL_CHROMIUM_rate_limit_offscreen_context 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glRateLimitOffscreenContextCHROMIUM(); +#endif +typedef void (GL_APIENTRYP PFNGLRATELIMITOFFSCREENCONTEXTCHROMIUMPROC) (); +#endif /* GL_CHROMIUM_rate_limit_offscreen_context */ + +/* GL_CHROMIUM_post_sub_buffer */ +#ifndef GL_CHROMIUM_post_sub_buffer +#define GL_CHROMIUM_post_sub_buffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glPostSubBufferCHROMIUM( + GLint x, GLint y, GLint width, GLint height); +#endif +typedef void ( + GL_APIENTRYP PFNGLPOSTSUBBUFFERCHROMIUMPROC) ( + GLint x, GLint y, GLint width, GLint height); +#endif /* GL_CHROMIUM_post_sub_buffer */ + +/* GL_CHROMIUM_bind_uniform_location */ +#ifndef GL_CHROMIUM_bind_uniform_location +#define GL_CHROMIUM_bind_uniform_location 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glBindUniformLocationCHROMIUM( + GLuint program, GLint location, const char* name); +#endif +typedef void ( + GL_APIENTRYP PFNGLBINDUNIFORMLOCATIONCHROMIUMPROC) ( + GLuint program, GLint location, const char* name); +#endif /* GL_CHROMIUM_bind_uniform_location */ + +/* GL_CHROMIUM_command_buffer_query */ +#ifndef GL_CHROMIUM_command_buffer_query +#define GL_CHROMIUM_command_buffer_query 1 + +#ifndef GL_COMMANDS_ISSUED_CHROMIUM +#define GL_COMMANDS_ISSUED_CHROMIUM 0x84F2 +#endif +#endif /* GL_CHROMIUM_command_buffer_query */ + +/* GL_EXT_framebuffer_multisample */ +#ifndef GL_EXT_framebuffer_multisample +#define GL_EXT_framebuffer_multisample 1 + +#ifndef GL_FRAMEBUFFER_BINDING_EXT +#define GL_FRAMEBUFFER_BINDING_EXT GL_FRAMEBUFFER_BINDING +#endif + +#ifndef GL_DRAW_FRAMEBUFFER_BINDING_EXT +#define GL_DRAW_FRAMEBUFFER_BINDING_EXT GL_DRAW_FRAMEBUFFER_BINDING +#endif + +#ifndef GL_RENDERBUFFER_BINDING_EXT +#define GL_RENDERBUFFER_BINDING_EXT GL_RENDERBUFFER_BINDING +#endif + +#ifndef GL_RENDERBUFFER_SAMPLES +#define GL_RENDERBUFFER_SAMPLES 0x8CAB +#endif + +#ifndef GL_READ_FRAMEBUFFER_EXT +#define GL_READ_FRAMEBUFFER_EXT GL_READ_FRAMEBUFFER +#endif + +#ifndef GL_RENDERBUFFER_SAMPLES_EXT +#define GL_RENDERBUFFER_SAMPLES_EXT GL_RENDERBUFFER_SAMPLES +#endif + +#ifndef GL_RENDERBUFFER_BINDING +#define GL_RENDERBUFFER_BINDING 0x8CA7 +#endif + +#ifndef GL_READ_FRAMEBUFFER_BINDING +#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA +#endif + +#ifndef GL_MAX_SAMPLES +#define GL_MAX_SAMPLES 0x8D57 +#endif + +#ifndef GL_READ_FRAMEBUFFER_BINDING_EXT +#define GL_READ_FRAMEBUFFER_BINDING_EXT GL_READ_FRAMEBUFFER_BINDING +#endif + +#ifndef GL_DRAW_FRAMEBUFFER_BINDING +#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6 +#endif + +#ifndef GL_MAX_SAMPLES_EXT +#define GL_MAX_SAMPLES_EXT GL_MAX_SAMPLES +#endif + +#ifndef GL_DRAW_FRAMEBUFFER +#define GL_DRAW_FRAMEBUFFER 0x8CA9 +#endif + +#ifndef GL_READ_FRAMEBUFFER +#define GL_READ_FRAMEBUFFER 0x8CA8 +#endif + +#ifndef GL_DRAW_FRAMEBUFFER_EXT +#define GL_DRAW_FRAMEBUFFER_EXT GL_DRAW_FRAMEBUFFER +#endif + +#ifndef GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 +#endif + +#ifndef GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE // NOLINT +#endif + +#ifndef GL_FRAMEBUFFER_BINDING +#define GL_FRAMEBUFFER_BINDING 0x8CA6 +#endif +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleEXT( + GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, + GLsizei height); +#endif +typedef void ( + GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) ( + GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, + GLsizei height); +#endif /* GL_EXT_framebuffer_multisample */ + +/* GL_CHROMIUM_texture_compression_dxt3 */ +#ifndef GL_CHROMIUM_texture_compression_dxt3 +#define GL_CHROMIUM_texture_compression_dxt3 1 + +#ifndef GL_COMPRESSED_RGBA_S3TC_DXT3_EXT +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#endif +#endif /* GL_CHROMIUM_texture_compression_dxt3 */ + +/* GL_CHROMIUM_texture_compression_dxt5 */ +#ifndef GL_CHROMIUM_texture_compression_dxt5 +#define GL_CHROMIUM_texture_compression_dxt5 1 + +#ifndef GL_COMPRESSED_RGBA_S3TC_DXT5_EXT +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 +#endif +#endif /* GL_CHROMIUM_texture_compression_dxt5 */ + +/* GL_CHROMIUM_async_pixel_transfers */ +#ifndef GL_CHROMIUM_async_pixel_transfers +#define GL_CHROMIUM_async_pixel_transfers 1 + +#ifndef GL_ASYNC_PIXEL_TRANSFERS_COMPLETED_CHROMIUM +#define GL_ASYNC_PIXEL_TRANSFERS_COMPLETED_CHROMIUM 0x84F5 +#endif +#endif /* GL_CHROMIUM_async_pixel_transfers */ + +/* GL_CHROMIUM_copy_texture */ +#ifndef GL_CHROMIUM_copy_texture +#define GL_CHROMIUM_copy_texture 1 + +#ifndef GL_UNPACK_COLORSPACE_CONVERSION_CHROMIUM +#define GL_UNPACK_COLORSPACE_CONVERSION_CHROMIUM 0x9243 +#endif + +#ifndef GL_UNPACK_UNPREMULTIPLY_ALPHA_CHROMIUM +#define GL_UNPACK_UNPREMULTIPLY_ALPHA_CHROMIUM 0x9242 +#endif + +#ifndef GL_UNPACK_PREMULTIPLY_ALPHA_CHROMIUM +#define GL_UNPACK_PREMULTIPLY_ALPHA_CHROMIUM 0x9241 +#endif +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glCopyTextureCHROMIUM( + GLenum target, GLenum source_id, GLenum dest_id, GLint level, + GLint internalformat); +#endif +typedef void ( + GL_APIENTRYP PFNGLCOPYTEXTURECHROMIUMPROC) ( + GLenum target, GLenum source_id, GLenum dest_id, GLint level, + GLint internalformat); +#endif /* GL_CHROMIUM_copy_texture */ + +/* GL_CHROMIUM_lose_context */ +#ifndef GL_CHROMIUM_lose_context +#define GL_CHROMIUM_lose_context 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glLoseContextCHROMIUM( + GLenum current, GLenum other); +#endif +typedef void ( + GL_APIENTRYP PFNGLLOSECONTEXTCHROMIUMPROC) (GLenum current, GLenum other); +#endif /* GL_CHROMIUM_lose_context */ + +/* GL_CHROMIUM_flipy */ +#ifndef GL_CHROMIUM_flipy +#define GL_CHROMIUM_flipy 1 + +#ifndef GL_UNPACK_FLIP_Y_CHROMIUM +#define GL_UNPACK_FLIP_Y_CHROMIUM 0x9240 +#endif +#endif /* GL_CHROMIUM_flipy */ + +/* GL_ARB_texture_rectangle */ +#ifndef GL_ARB_texture_rectangle +#define GL_ARB_texture_rectangle 1 + +#ifndef GL_SAMPLER_2D_RECT_ARB +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#endif + +#ifndef GL_TEXTURE_BINDING_RECTANGLE_ARB +#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 +#endif + +#ifndef GL_TEXTURE_RECTANGLE_ARB +#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 +#endif +#endif /* GL_ARB_texture_rectangle */ + +/* GL_CHROMIUM_enable_feature */ +#ifndef GL_CHROMIUM_enable_feature +#define GL_CHROMIUM_enable_feature 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL GLboolean GL_APIENTRY glEnableFeatureCHROMIUM(const char* feature); +#endif +typedef GLboolean ( + GL_APIENTRYP PFNGLENABLEFEATURECHROMIUMPROC) (const char* feature); +#endif /* GL_CHROMIUM_enable_feature */ + +/* GL_CHROMIUM_command_buffer_latency_query */ +#ifndef GL_CHROMIUM_command_buffer_latency_query +#define GL_CHROMIUM_command_buffer_latency_query 1 + +#ifndef GL_LATENCY_QUERY_CHROMIUM +#define GL_LATENCY_QUERY_CHROMIUM 0x84F4 +#endif +#endif /* GL_CHROMIUM_command_buffer_latency_query */ + +/* GL_ARB_robustness */ +#ifndef GL_ARB_robustness +#define GL_ARB_robustness 1 + +#ifndef GL_GUILTY_CONTEXT_RESET_ARB +#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 +#endif + +#ifndef GL_UNKNOWN_CONTEXT_RESET_ARB +#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 +#endif + +#ifndef GL_INNOCENT_CONTEXT_RESET_ARB +#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 +#endif +#endif /* GL_ARB_robustness */ + +/* GL_EXT_framebuffer_blit */ +#ifndef GL_EXT_framebuffer_blit +#define GL_EXT_framebuffer_blit 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glBlitFramebufferEXT( + GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, + GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#endif +typedef void ( + GL_APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) ( + GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, + GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#endif /* GL_EXT_framebuffer_blit */ + +/* GL_CHROMIUM_resize */ +#ifndef GL_CHROMIUM_resize +#define GL_CHROMIUM_resize 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glResizeCHROMIUM(GLuint width, GLuint height); +#endif +typedef void ( + GL_APIENTRYP PFNGLRESIZECHROMIUMPROC) (GLuint width, GLuint height); +#endif /* GL_CHROMIUM_resize */ + +/* GL_CHROMIUM_get_multiple */ +#ifndef GL_CHROMIUM_get_multiple +#define GL_CHROMIUM_get_multiple 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glGetMultipleIntegervCHROMIUM( + const GLenum* pnames, GLuint count, GLint* results, GLsizeiptr size); +#endif +typedef void ( + GL_APIENTRYP PFNGLGETMULTIPLEINTEGERVCHROMIUMPROC) ( + const GLenum* pnames, GLuint count, GLint* results, GLsizeiptr size); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glGetProgramInfoCHROMIUM( + GLuint program, GLsizei bufsize, GLsizei* size, void* info); +#endif +typedef void ( + GL_APIENTRYP PFNGLGETPROGRAMINFOCHROMIUMPROC) ( + GLuint program, GLsizei bufsize, GLsizei* size, void* info); +#endif /* GL_CHROMIUM_get_multiple */ + +/* GL_CHROMIUM_front_buffer_cached */ +#ifndef GL_CHROMIUM_front_buffer_cached +#define GL_CHROMIUM_front_buffer_cached 1 +#endif /* GL_CHROMIUM_front_buffer_cached */ +#ifdef __cplusplus +} +#endif + +#endif // GPU_GLES2_GL2EXTCHROMIUM_H_ + diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py index 9babf73..192bf30 100755 --- a/gpu/command_buffer/build_gles2_cmd_buffer.py +++ b/gpu/command_buffer/build_gles2_cmd_buffer.py @@ -2313,6 +2313,200 @@ _FUNCTION_INFO = { } +_CHROMIUM_SPECIFIC_CONSTANTS = { + 'GL_CONTEXT_LOST': '0x300E', # TODO(gman): What value? +} + + +_CHROMIUM_SPECIFIC_EXTENSIONS = { + 'GL_EXT_framebuffer_multisample': { + 'constants': { + 'GL_DRAW_FRAMEBUFFER_BINDING': '0x8CA6', + 'GL_DRAW_FRAMEBUFFER_BINDING_EXT': 'GL_DRAW_FRAMEBUFFER_BINDING', + 'GL_FRAMEBUFFER_BINDING': '0x8CA6', + 'GL_FRAMEBUFFER_BINDING_EXT': 'GL_FRAMEBUFFER_BINDING', + 'GL_RENDERBUFFER_BINDING': '0x8CA7', + 'GL_RENDERBUFFER_BINDING_EXT': 'GL_RENDERBUFFER_BINDING', + 'GL_READ_FRAMEBUFFER': '0x8CA8', + 'GL_READ_FRAMEBUFFER_EXT': 'GL_READ_FRAMEBUFFER', + 'GL_DRAW_FRAMEBUFFER': '0x8CA9', + 'GL_DRAW_FRAMEBUFFER_EXT': 'GL_DRAW_FRAMEBUFFER', + 'GL_READ_FRAMEBUFFER_BINDING': '0x8CAA', + 'GL_READ_FRAMEBUFFER_BINDING_EXT': 'GL_READ_FRAMEBUFFER_BINDING', + 'GL_RENDERBUFFER_SAMPLES': '0x8CAB', + 'GL_RENDERBUFFER_SAMPLES_EXT': 'GL_RENDERBUFFER_SAMPLES', + 'GL_MAX_SAMPLES': '0x8D57', + 'GL_MAX_SAMPLES_EXT': 'GL_MAX_SAMPLES', + 'GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE': '0x8D56', + 'GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT': + 'GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE', + }, + 'functions': [ + 'RenderbufferStorageMultisampleEXT', + ], + }, + 'GL_EXT_framebuffer_blit': { + 'functions': [ + 'BlitFramebufferEXT', + ], + }, + 'GL_CHROMIUM_map_sub': { + 'constants': { + 'GL_READ_ONLY': '0x88B8', + 'GL_WRITE_ONLY': '0x88B9', + }, + 'functions': [ + 'MapBufferSubDataCHROMIUM', + 'UnmapBufferSubDataCHROMIUM', + 'MapTexSubImage2DCHROMIUM', + 'UnmapTexSubImage2DCHROMIUM', + ], + }, + 'GL_CHROMIUM_resize': { + 'functions': [ + 'ResizeCHROMIUM', + ], + }, + 'GL_CHROMIUM_request_extension': { + 'functions': [ + 'GetRequestableExtensionsCHROMIUM', + 'RequestExtensionCHROMIUM', + ], + }, + 'GL_CHROMIUM_rate_limit_offscreen_context': { + 'functions': [ + 'RateLimitOffscreenContextCHROMIUM', + ], + }, + 'GL_CHROMIUM_get_multiple': { + 'functions': [ + 'GetMultipleIntegervCHROMIUM', + 'GetProgramInfoCHROMIUM', + ], + }, + 'GL_CHROMIUM_flipy': { + 'constants': { + 'GL_UNPACK_FLIP_Y_CHROMIUM': '0x9240', + }, + }, + 'GL_CHROMIUM_texture_compression_dxt3': { + 'constants': { + 'GL_COMPRESSED_RGBA_S3TC_DXT3_EXT': '0x83F2', + }, + }, + 'GL_CHROMIUM_texture_compression_dxt5': { + 'constants': { + 'GL_COMPRESSED_RGBA_S3TC_DXT5_EXT': '0x83F3', + }, + }, + 'GL_CHROMIUM_enable_feature': { + 'functions': [ + 'EnableFeatureCHROMIUM', + ], + }, + 'GL_CHROMIUM_post_sub_buffer': { + 'functions': [ + 'PostSubBufferCHROMIUM', + ], + }, + 'GL_CHROMIUM_front_buffer_cached': { + }, + 'GL_CHROMIUM_gpu_memory_manager': { + 'constants': { + 'GL_TEXTURE_POOL_CHROMIUM': '0x6000', + 'GL_TEXTURE_POOL_MANAGED_CHROMIUM': '0x6001', + 'GL_TEXTURE_POOL_UNMANAGED_CHROMIUM': '0x6002', + }, + }, + 'GL_ARB_robustness': { + 'constants': { + 'GL_GUILTY_CONTEXT_RESET_ARB': '0x8253', + 'GL_INNOCENT_CONTEXT_RESET_ARB': '0x8254', + 'GL_UNKNOWN_CONTEXT_RESET_ARB': '0x8255', + }, + }, + 'GL_ARB_texture_rectangle': { + 'constants': { + 'GL_TEXTURE_RECTANGLE_ARB': '0x84F5', + 'GL_TEXTURE_BINDING_RECTANGLE_ARB': '0x84F6', + 'GL_SAMPLER_2D_RECT_ARB': '0x8B63', + }, + }, + 'GL_CHROMIUM_iosurface': { + 'functions': [ + 'TexImageIOSurface2DCHROMIUM', + ], + }, + 'GL_CHROMIUM_copy_texture': { + 'constants': { + 'GL_UNPACK_PREMULTIPLY_ALPHA_CHROMIUM': '0x9241', + 'GL_UNPACK_UNPREMULTIPLY_ALPHA_CHROMIUM': '0x9242', + 'GL_UNPACK_COLORSPACE_CONVERSION_CHROMIUM': '0x9243', + }, + 'functions': [ + 'CopyTextureCHROMIUM', + ], + }, + 'GL_CHROMIUM_command_buffer_query': { + 'constants': { + # TODO(gman): Get official numbers for these constants. + 'GL_COMMANDS_ISSUED_CHROMIUM': '0x84F2', + }, + }, + 'GL_CHROMIUM_get_error_query': { + 'constants': { + # TODO(gman): Get official numbers for these constants. + 'GL_GET_ERROR_QUERY_CHROMIUM': '0x84F3', + }, + }, + 'GL_CHROMIUM_command_buffer_latency_query': { + 'constants': { + # TODO(gman): Get official numbers for these constants. + 'GL_LATENCY_QUERY_CHROMIUM': '0x84F4', + }, + }, + 'GL_CHROMIUM_texture_mailbox': { + 'constants': { + 'GL_MAILBOX_SIZE_CHROMIUM': '64', + }, + 'functions': [ + 'GenMailboxCHROMIUM', + 'ProduceTextureCHROMIUM', + 'ConsumeTextureCHROMIUM', + ], + }, + 'GL_CHROMIUM_bind_uniform_location': { + 'functions': [ + 'BindUniformLocationCHROMIUM', + ], + }, + 'GL_CHROMIUM_texture_from_image': { + 'functions': [ + 'BindTexImage2DCHROMIUM', + 'ReleaseTexImage2DCHROMIUM', + ], + }, + 'GL_CHROMIUM_pixel_transfer_buffer_object': { + 'constants': { + # TODO(reveman): Get official numbers for these constants. + 'GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM': '0x88EC', + 'GL_PIXEL_UNPACK_TRANSFER_BUFFER_BINDING_CHROMIUM': '0x88EF', + }, + }, + 'GL_CHROMIUM_async_pixel_transfers': { + 'constants': { + # TODO(reveman): Get official numbers for these constants. + 'GL_ASYNC_PIXEL_TRANSFERS_COMPLETED_CHROMIUM': '0x84F5', + }, + }, + 'GL_CHROMIUM_lose_context': { + 'functions': [ + 'LoseContextCHROMIUM', + ], + }, +} + + def Grouper(n, iterable, fillvalue=None): """Collect data into fixed-length chunks or blocks""" args = [iter(iterable)] * n @@ -7081,11 +7275,17 @@ void GLES2DecoderTestBase::SetupInitStateExpectations() { """Writes the GLES2 header.""" file = CHeaderWriter( filename, - "// Because we are using both the real system GL and our own.\n" - "// emulated GL we need to use different names to avoid conflicts.\n" - "\n") + "// This file contains Chromium-specific GLES2 declarations.\n\n") + + file.Write("#include <GLES2/gl2platform.h>\n") - file.Write("""#if defined(GLES2_USE_CPP_BINDINGS) + for name, value in _CHROMIUM_SPECIFIC_CONSTANTS.iteritems(): + file.Write("#define %s %s\n" % (name, value)) + + file.Write(""" +// Because we are using both the real system GL and our own +// emulated GL we need to use different names to avoid conflicts. +#if defined(GLES2_USE_CPP_BINDINGS) #define GLES2_GET_FUN(name) gles2::GetGLContext()->name #else #define GLES2_GET_FUN(name) GLES2 ## name @@ -7099,6 +7299,62 @@ void GLES2DecoderTestBase::SetupInitStateExpectations() { file.Write("\n") file.Close() + def WriteGLES2ExtHeader(self, filename): + """Writes the GLES2 extensions header.""" + file = CHeaderWriter( + filename, + "// This file contains Chromium-specific " + "GLES2 extensions declarations.\n\n") + + file.Write("#include <GLES2/gl2chromium.h>\n") + file.Write("""#ifdef __cplusplus +extern "C" { +#endif +""") + + for ext_name, ext_dict in _CHROMIUM_SPECIFIC_EXTENSIONS.iteritems(): + file.Write(""" +/* %(name)s */ +#ifndef %(name)s +#define %(name)s 1 +""" % {'name' : ext_name}) + for name, value in ext_dict.get('constants', {}).iteritems(): + file.Write(""" +#ifndef %(name)s +#define %(name)s %(value)s +#endif +""" % {'name': name, 'value': value}) + + for name in ext_dict.get('functions', []): + found = False + for function in self.original_functions: + if function.name != name: + continue + file.Write("#ifdef GL_GLEXT_PROTOTYPES\n") + file.Write("GL_APICALL %s GL_APIENTRY gl%s(%s);\n" % ( + function.return_type, + function.name, + function.MakeTypedOriginalArgString(prefix=''))) + file.Write("#endif\n") + file.Write("typedef %s (GL_APIENTRYP %s) (%s);\n" % ( + function.return_type, + 'PFNGL%sPROC' % function.name.upper(), + function.MakeTypedOriginalArgString(prefix=''))) + found = True + break + if not found: + self.Error("Function '%s' not found." % name) + + file.Write("#endif /* %s */\n" % ext_name) + + file.Write("""#ifdef __cplusplus +} +#endif +""") + + file.Write("\n") + file.Close() + def WriteGLES2CLibImplementation(self, filename): """Writes the GLES2 c lib implementation.""" file = CHeaderWriter( @@ -7240,7 +7496,9 @@ NameToFunc g_gles2_function_table[] = { enum_re = re.compile(r'\#define\s+(GL_[a-zA-Z0-9_]+)\s+([0-9A-Fa-fx]+)') dict = {} for fname in ['../../third_party/khronos/GLES2/gl2.h', - '../../third_party/khronos/GLES2/gl2ext.h']: + '../../third_party/khronos/GLES2/gl2ext.h', + '../../gpu/GLES2/gl2chromium.h', + '../../gpu/GLES2/gl2extchromium.h']: lines = open(fname).readlines() for line in lines: m = enum_re.match(line) @@ -7578,6 +7836,7 @@ def main(argv): gen.WriteCommonUtilsHeader("common/gles2_cmd_utils_autogen.h") gen.WriteCommonUtilsImpl("common/gles2_cmd_utils_implementation_autogen.h") gen.WriteGLES2Header("../GLES2/gl2chromium.h") + gen.WriteGLES2ExtHeader("../GLES2/gl2extchromium.h") if gen.errors > 0: print "%d errors" % gen.errors diff --git a/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h b/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h index 447efff..8ef9a14 100644 --- a/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h @@ -219,7 +219,7 @@ static GLES2Util::EnumToString enum_to_string_table[] = { { 0x90F1, "GL_MULTIVIEW_EXT", }, { 0x90F0, "GL_COLOR_ATTACHMENT_EXT", }, { 0x803C, "GL_ALPHA8_OES", }, - { 0x84F5, "GL_TEXTURE_RECTANGLE_ARB", }, + { 0x84F5, "GL_ASYNC_PIXEL_TRANSFERS_COMPLETED_CHROMIUM", }, { 0x882A, "GL_DRAW_BUFFER5_NV", }, { 0x80AA, "GL_SAMPLE_COVERAGE_VALUE", }, { 0x84F6, "GL_TEXTURE_BINDING_RECTANGLE_ARB", }, diff --git a/third_party/khronos/GLES2/gl2ext.h b/third_party/khronos/GLES2/gl2ext.h index 6cbca97..8594adc 100644 --- a/third_party/khronos/GLES2/gl2ext.h +++ b/third_party/khronos/GLES2/gl2ext.h @@ -1805,385 +1805,10 @@ typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask); #define GL_VIV_shader_binary 1 #endif -/* GL_EXT_framebuffer_multisample */ -#ifndef GL_EXT_framebuffer_multisample -#define GL_EXT_framebuffer_multisample 1 - -#ifndef GL_DRAW_FRAMEBUFFER_BINDING -#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6 -#endif -#ifndef GL_DRAW_FRAMEBUFFER_BINDING_EXT -#define GL_DRAW_FRAMEBUFFER_BINDING_EXT GL_DRAW_FRAMEBUFFER_BINDING -#endif -#ifndef GL_FRAMEBUFFER_BINDING -#define GL_FRAMEBUFFER_BINDING 0x8CA6 -#endif -#ifndef GL_FRAMEBUFFER_BINDING_EXT -#define GL_FRAMEBUFFER_BINDING_EXT GL_FRAMEBUFFER_BINDING -#endif -#ifndef GL_RENDERBUFFER_BINDING -#define GL_RENDERBUFFER_BINDING 0x8CA7 -#endif -#ifndef GL_RENDERBUFFER_BINDING_EXT -#define GL_RENDERBUFFER_BINDING_EXT GL_RENDERBUFFER_BINDING -#endif -#ifndef GL_READ_FRAMEBUFFER -#define GL_READ_FRAMEBUFFER 0x8CA8 -#endif -#ifndef GL_READ_FRAMEBUFFER_EXT -#define GL_READ_FRAMEBUFFER_EXT GL_READ_FRAMEBUFFER -#endif -#ifndef GL_DRAW_FRAMEBUFFER -#define GL_DRAW_FRAMEBUFFER 0x8CA9 -#endif -#ifndef GL_DRAW_FRAMEBUFFER_EXT -#define GL_DRAW_FRAMEBUFFER_EXT GL_DRAW_FRAMEBUFFER -#endif -#ifndef GL_READ_FRAMEBUFFER_BINDING -#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA -#endif -#ifndef GL_READ_FRAMEBUFFER_BINDING_EXT -#define GL_READ_FRAMEBUFFER_BINDING_EXT GL_READ_FRAMEBUFFER_BINDING -#endif -#ifndef GL_RENDERBUFFER_SAMPLES -#define GL_RENDERBUFFER_SAMPLES 0x8CAB -#endif -#ifndef GL_RENDERBUFFER_SAMPLES_EXT -#define GL_RENDERBUFFER_SAMPLES_EXT GL_RENDERBUFFER_SAMPLES -#endif -#ifndef GL_MAX_SAMPLES -#define GL_MAX_SAMPLES 0x8D57 -#endif -#ifndef GL_MAX_SAMPLES_EXT -#define GL_MAX_SAMPLES_EXT GL_MAX_SAMPLES -#endif -#ifndef GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 -#endif -#ifndef GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE -#endif - -#if 0 // Defined in GL_EXT_multisampled_render_to_texture -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -#endif -typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -#endif -#endif - -#ifndef GL_EXT_framebuffer_blit -#define GL_EXT_framebuffer_blit 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBlitFramebufferEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -#endif -typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -#endif - -/* GL_CHROMIUM_map_sub */ -#ifndef GL_CHROMIUM_map_sub -#define GL_CHROMIUM_map_sub 1 -#ifndef GL_READ_ONLY -#define GL_READ_ONLY 0x88B8 -#endif -#ifndef GL_WRITE_ONLY -#define GL_WRITE_ONLY 0x88B9 -#endif -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void* GL_APIENTRY glMapBufferSubDataCHROMIUM (GLuint target, GLintptr offset, GLsizeiptr size, GLenum access); -GL_APICALL void GL_APIENTRY glUnmapBufferSubDataCHROMIUM (const void* mem); -GL_APICALL void* GL_APIENTRY glMapTexSubImage2DCHROMIUM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLenum access); -GL_APICALL void GL_APIENTRY glUnmapTexSubImage2DCHROMIUM (const void* mem); -#endif -typedef void* (GL_APIENTRYP PFNGLMAPBUFFERSUBDATACHROMIUM) (GLuint target, GLintptr offset, GLsizeiptr size, GLenum access); -typedef void (GL_APIENTRYP PFNGLUNMAPBUFFERSUBDATACHROMIUM) (const void* mem); -typedef void* (GL_APIENTRYP PFNGLMAPTEXSUBIMAGE2DCHROMIUM) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLenum access); -typedef void (GL_APIENTRYP PFNGLUNMAPTEXSUBIMAGE2DCHROMIUM) (const void* mem); -#endif - -/* GL_CHROMIUM_resize */ -#ifndef GL_CHROMIUM_resize -#define GL_CHROMIUM_resize 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glResizeCHROMIUM (GLuint width, GLuint height); -#endif -typedef void (GL_APIENTRYP PFNGLRESIZECHROMIUM) (GLuint width, GLuint height); -#endif - -/* GL_CHROMIUM_request_extension */ -/* - * This extension allows other extensions to be turned on at run time. - * - * glGetRequestableExtensionsCHROMIUM returns a space-separated and - * null-terminated string containing all of the extension names that - * can be successfully requested on the current hardware. This may - * include the names of extensions that have already been enabled. - * - * glRequestExtensionCHROMIUM requests that the given extension be - * enabled. Call glGetString(GL_EXTENSIONS) to find out whether the - * extension request succeeded. - */ -#ifndef GL_CHROMIUM_request_extension -#define GL_CHROMIUM_request_extension 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL const GLchar* GL_APIENTRY glGetRequestableExtensionsCHROMIUM (void); -GL_APICALL void GL_APIENTRY glRequestExtensionCHROMIUM (const GLchar *extension); -#endif -typedef const GLchar* (GL_APIENTRYP PFNGLGETREQUESTABLEEXTENSIONSCHROMIUM) (void); -typedef void (GL_APIENTRYP PFNGLREQUESTEXTENSIONCHROMIUM) (const GLchar *extension); -#endif - -/* GL_CHROMIUM_rate_limit_offscreen_context */ -/* - * This extension will block if the calling context has gotten more than two - * glRateLimit calls ahead of the GPU process. This keeps the client in sync - * with the GPU without having to call swapbuffers, which has potentially - * undesirable side effects. - */ -#ifndef GL_CHROMIUM_rate_limit_offscreen_context -#define GL_CHROMIUM_rate_limit_offscreen_context 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glRateLimitOffscreenContextCHROMIUM (void); -#endif -typedef void (GL_APIENTRYP PFNGLRATELIMITOFFSCREENCONTEXTCHROMIUM) (); -#endif - -/* GL_CHROMIUM_get_multiple */ -/* - * This extension provides functions for quering multiple GL state with a single - * call. - */ -#ifndef GL_CHROMIUM_get_multiple -#define GL_CHROMIUM_get_multiple 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGetMultipleIntegervCHROMIUM (const GLenum* pnames, GLuint count, GLint* results, GLsizeiptr size); -GL_APICALL void GL_APIENTRY glGetProgramInfoCHROMIUM (GLuint program, GLsizei bufsize, GLsizei* size, void* info); -#endif -typedef void (GL_APIENTRYP PFNGLGETMULTIPLEINTEGERVCHROMIUM) (); -typedef void (GL_APIENTRYP PFNGLGETPROGRAMINFOCHROMIUM) (); -#endif - -/* GL_CHROMIUM_flipy */ -/* - * This extension provides GL_UNPACK_FLIP_Y_CHROMIUM as a parameter to - * glPixelStorei. When true images submitted to glTexImage2D and glTexSubImage2D - * are flipped vertically. - */ -#ifndef GL_CHROMIUM_flipy -#define GL_CHROMIUM_flipy 1 -#define GL_UNPACK_FLIP_Y_CHROMIUM 0x9240 -#endif - -/* GL_CHROMIUM_texture_compression_dxt3 */ -#ifndef GL_CHROMIUM_texture_compression_dxt3 -#define GL_CHROMIUM_texture_compression_dxt3 1 -#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 -#endif - -/* GL_CHROMIUM_texture_compression_dxt5 */ -#ifndef GL_CHROMIUM_texture_compression_dxt5 -#define GL_CHROMIUM_texture_compression_dxt5 1 -#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 -#endif - -/* GL_CHROMIUM_enable_feature */ -#ifndef GL_CHROMIUM_enable_feature -#define GL_CHROMIUM_enable_feature 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL GLboolean GL_APIENTRY glEnableFeatureCHROMIUM (const GLchar *feature); -#endif -typedef void (GL_APIENTRYP PFNGLENABLEFEATURECHROMIUM) (const GLchar *feature); -#endif - -/* GL_CHROMIUM_post_sub_buffer */ -/* This extension is modeled after EGL_NV_post_sub_buffer and - * GLX_MESA_copy_sub_buffer. It's like a SwapBuffers, but it pushes a region - * of the back buffer to the front buffer. - */ -#ifndef GL_CHROMIUM_post_sub_buffer -#define GL_CHROMIUM_post_sub_buffer 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glPostSubBufferCHROMIUM (GLint x, GLint y, GLint width, GLint height); -#endif -typedef void (GL_APIENTRYP PFNGLPOSTSUBBUFFERCHROMIUM) (GLint x, GLint y, GLint width, GLint height); -#endif - -/* GL_CHROMIUM_front_buffer_cached */ -/* This extension implies that there is a cache of the front buffer of the - * surface supporting this extension (e.g. on OSX the front buffer - * is often backed by an IOSurface). Hence we do not need to redraw - * (via a SwapBuffers) in order to display the last frame. - */ -#ifndef GL_CHROMIUM_front_buffer_cached -#define GL_CHROMIUM_front_buffer_cached 1 -#endif - -/* GL_CHROMIUM_gpu_memory_manager */ -/* This extension provides a mechanism for indicating to the implementation - which textures may be discarded by the client based on the recommendations - of the implementation's memory allocation changed callback (e.g, compositor - tiles), and which texture will not be discarded (e.g, WebGL textures). */ -#ifndef GL_CHROMIUM_gpu_memory_manager -#define GL_CHROMIUM_gpu_memory_manager 1 -#define GL_TEXTURE_POOL_CHROMIUM 0x6000 -#define GL_TEXTURE_POOL_MANAGED_CHROMIUM 0x6001 -#define GL_TEXTURE_POOL_UNMANAGED_CHROMIUM 0x6002 -#endif - -/* GL_ARB_robustness */ -/* This extension is subsetted for the moment, incorporating only the - * enums necessary to describe the reasons that we might encounter for - * losing the context. The entry point querying the reset status is - * not yet incorporated; to do so, a spec will be needed of a GLES2 - * subset of GL_ARB_robustness. - */ -#ifndef GL_ARB_robustness -#define GL_ARB_robustness 1 -#ifndef GL_GUILTY_CONTEXT_RESET_ARB -#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 -#endif -#ifndef GL_INNOCENT_CONTEXT_RESET_ARB -#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 -#endif -#ifndef GL_UNKNOWN_CONTEXT_RESET_ARB -#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 -#endif -#endif - -/* GL_ARB_texture_rectangle */ -/* Exposes only the subset necessary to support GL_CHROMIUM_iosurface. - */ -#ifndef GL_ARB_texture_rectangle -#define GL_ARB_texture_rectangle 1 -#ifndef GL_TEXTURE_RECTANGLE_ARB -#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 -#endif -#ifndef GL_TEXTURE_BINDING_RECTANGLE_ARB -#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 -#endif -#ifndef GL_SAMPLER_2D_RECT_ARB -#define GL_SAMPLER_2D_RECT_ARB 0x8B63 -#endif -#endif - -/* GL_CHROMIUM_iosurface */ -/* Exposes the Mac OS-specfic CGLTexImageIOSurface2D entry point as a - * Chromium extension in the cross-platform API. Binds the IOSurface with - * the given ID (an IOSurfaceID) to the texture bound to the given target. - * To avoid needing to expose extraneous enums, assumes internal format - * RGBA, format BGRA, and type UNSIGNED_INT_8_8_8_8_REV. - */ -#ifndef GL_CHROMIUM_iosurface -#define GL_CHROMIUM_iosurface 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTexImageIOSurface2DCHROMIUM (GLenum target, GLsizei width, GLsizei height, GLuint ioSurfaceId, GLuint plane); -#endif -typedef void (GL_APIENTRYP PFNGLTEXIMAGEIOSURFACE2DCHROMIUM) (GLenum target, GLsizei width, GLsizei height, GLuint ioSurfaceId, GLuint plane); -#endif - -/* GL_CHROMIUM_copy_texture */ -#ifndef GL_CHROMIUM_copy_texture -#ifndef GL_UNPACK_PREMULTIPLY_ALPHA_CHROMIUM -#define GL_UNPACK_PREMULTIPLY_ALPHA_CHROMIUM 0x9241 -#endif -#ifndef GL_UNPACK_UNPREMULTIPLY_ALPHA_CHROMIUM -#define GL_UNPACK_UNPREMULTIPLY_ALPHA_CHROMIUM 0x9242 -#endif -#ifndef GL_UNPACK_COLORSPACE_CONVERSION_CHROMIUM -#define GL_UNPACK_COLORSPACE_CONVERSION_CHROMIUM 0x9243 -#endif -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glCopyTextureCHROMIUM (GLenum target, GLenum source_id, GLenum dest_id, GLint level, GLint internal_format); -#endif -typedef void (GL_APIENTRYP PFNGLCOPYTEXTURECHROMIUM) (GLenum target, GLenum source_id, GLenum dest_id, GLint level, GLint internal_format); -#endif - -/* GL_CHROMIUM_command_buffer_query */ -/* Exposes GL_CHROMIUM_command_buffer_query. - */ -#ifndef GL_CHROMIUM_command_buffer_query -#define GL_CHROMIUM_command_buffer_query 1 -// TODO(gman): Get official numbers for these constants. -#define GL_COMMANDS_ISSUED_CHROMIUM 0x84F2 -#endif - -/* GL_CHROMIUM_get_error_query */ -/* Exposes GL_CHROMIUM_get_error_query. - */ -#ifndef GL_CHROMIUM_get_error_query -#define GL_CHROMIUM_get_error_query 1 -// TODO(gman): Get official numbers for these constants. -#define GL_GET_ERROR_QUERY_CHROMIUM 0x84F3 -#endif - -/* GL_CHROMIUM_command_buffer_latency_query */ -#ifndef GL_CHROMIUM_command_buffer_latency_query -#define GL_CHROMIUM_command_buffer_latency_query 1 -// TODO: Get official numbers for these constants. -#define GL_LATENCY_QUERY_CHROMIUM 0x84F4 -#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 -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 -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 - -/* GL_CHROMIUM_bind_uniform_location */ -#ifndef GL_CHROMIUM_bind_uniform_location -#define GL_CHROMIUM_bind_uniform_location 1 - -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBindUniformLocationCHROMIUM (GLuint program, GLint location, const GLchar* name); -#endif -typedef void (GL_APIENTRYP PFNGLBINDUNIFORMLOCATIONCHROMIUM) (GLuint program, GLint location, const GLchar* name); -#endif - -/* GL_CHROMIUM_texture_from_image */ -#ifndef GL_CHROMIUM_texture_from_image -#define GL_CHROMIUM_texture_from_image 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glBindTexImage2DCHROMIUM (GLenum target, GLint imageId); -GL_APICALL void GL_APIENTRY glReleaseTexImage2DCHROMIUM (GLenum target, GLint imageId); -#endif -typedef void (GL_APIENTRYP PFNGLBINDTEXIMAGE2DCHROMIUM) (GLenum target, GLint imageId); -typedef void (GL_APIENTRYP PFNGLRELEASETEXIMAGE2DCHROMIUM) (GLenum target, GLint imageId); -#endif - -/* GL_CHROMIUM_pixel_transfer_buffer_object */ -#ifndef GL_CHROMIUM_pixel_transfer_buffer_object -#define GL_CHROMIUM_pixel_transfer_buffer_object 1 -// TODO(reveman): Get official numbers for these constants. -#define GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM 0x88EC -#define GL_PIXEL_UNPACK_TRANSFER_BUFFER_BINDING_CHROMIUM 0x88EF -#endif - -/* GL_CHROMIUM_async_pixel_transfers */ -#ifndef GL_CHROMIUM_async_pixel_transfers -#define GL_CHROMIUM_async_pixel_transfers 1 -// TODO: Get official numbers for these constants. -#define GL_ASYNC_PIXEL_TRANSFERS_COMPLETED_CHROMIUM 0x84F5 -#endif - -/* GL_CHROMIUM_lose_context */ -#ifndef GL_CHROMIUM_lose_context -#define GL_CHROMIUM_lose_context 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glLoseContextCHROMIUM (GLenum current, GLenum other); -#endif -typedef void (GL_APIENTRYP PFNGLLOSECONTEXTCHROMIUM) (GLenum current, GLenum other); -#endif - #ifdef __cplusplus } #endif +#include <GLES2/gl2extchromium.h> + #endif /* __gl2ext_h_ */ |