Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / ui / gl / generate_bindings.py
index ee57f14..3a61f57 100755 (executable)
@@ -67,6 +67,23 @@ GL_FUNCTIONS = [
   'names': ['glBindTexture'],
   'arguments': 'GLenum target, GLuint texture', },
 { 'return_type': 'void',
+  'known_as': 'glBindVertexArrayOES',
+  'versions': [{ 'name': 'glBindVertexArray',
+                 'gl_versions': ['gl3', 'gl4', 'es3'] },
+               { 'name': 'glBindVertexArray',
+                 'extensions': ['GL_ARB_vertex_array_object'] },
+               { 'name': 'glBindVertexArrayOES' },
+               { 'name': 'glBindVertexArrayAPPLE',
+                 'extensions': ['GL_APPLE_vertex_array_object'] }],
+  'arguments': 'GLuint array' },
+{ 'return_type': 'void',
+  'known_as': 'glBlendBarrierKHR',
+  'versions': [{ 'name': 'glBlendBarrierNV',
+                 'extensions': ['GL_NV_blend_equation_advanced'] },
+               { 'name': 'glBlendBarrierKHR',
+                 'extensions': ['GL_KHR_blend_equation_advanced'] }],
+  'arguments': 'void' },
+{ 'return_type': 'void',
   'names': ['glBlendColor'],
   'arguments': 'GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha', },
 { 'return_type': 'void',
@@ -88,21 +105,23 @@ GL_FUNCTIONS = [
                'GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, '
                'GLbitfield mask, GLenum filter', },
 { 'return_type': 'void',
-  'names': ['glBlitFramebufferEXT', 'glBlitFramebuffer'],
+  'names': ['glBlitFramebufferANGLE', 'glBlitFramebuffer'],
   'arguments': 'GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, '
                'GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, '
                'GLbitfield mask, GLenum filter', },
 { 'return_type': 'void',
-  'names': ['glBlitFramebufferANGLE', 'glBlitFramebuffer'],
+  'names': ['glBlitFramebufferEXT', 'glBlitFramebuffer'],
   'arguments': 'GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, '
                'GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, '
                'GLbitfield mask, GLenum filter', },
 { 'return_type': 'void',
   'names': ['glBufferData'],
-  'arguments': 'GLenum target, GLsizei size, const void* data, GLenum usage', },
+  'arguments':
+      'GLenum target, GLsizeiptr size, const void* data, GLenum usage', },
 { 'return_type': 'void',
   'names': ['glBufferSubData'],
-  'arguments': 'GLenum target, GLint offset, GLsizei size, const void* data', },
+  'arguments':
+      'GLenum target, GLintptr offset, GLsizeiptr size, const void* data', },
 { 'return_type': 'GLenum',
   'names': ['glCheckFramebufferStatusEXT',
             'glCheckFramebufferStatus'],
@@ -125,6 +144,9 @@ GL_FUNCTIONS = [
 { 'return_type': 'void',
   'names': ['glClearStencil'],
   'arguments': 'GLint s', },
+{ 'return_type': 'GLenum',
+  'names': ['glClientWaitSync'],
+  'arguments': 'GLsync sync, GLbitfield flags, GLuint64 timeout', },
 { 'return_type': 'void',
   'names': ['glColorMask'],
   'arguments':
@@ -166,6 +188,9 @@ GL_FUNCTIONS = [
   'names': ['glDeleteBuffersARB', 'glDeleteBuffers'],
   'arguments': 'GLsizei n, const GLuint* buffers', },
 { 'return_type': 'void',
+  'names': ['glDeleteFencesNV'],
+  'arguments': 'GLsizei n, const GLuint* fences', },
+{ 'return_type': 'void',
   'names': ['glDeleteFramebuffersEXT', 'glDeleteFramebuffers'],
   'arguments': 'GLsizei n, const GLuint* framebuffers', },
 { 'return_type': 'void',
@@ -184,9 +209,22 @@ GL_FUNCTIONS = [
   'names': ['glDeleteShader'],
   'arguments': 'GLuint shader', },
 { 'return_type': 'void',
+  'names': ['glDeleteSync'],
+  'arguments': 'GLsync sync', },
+{ 'return_type': 'void',
   'names': ['glDeleteTextures'],
   'arguments': 'GLsizei n, const GLuint* textures', },
 { 'return_type': 'void',
+  'known_as': 'glDeleteVertexArraysOES',
+  'versions': [{ 'name': 'glDeleteVertexArrays',
+                 'gl_versions': ['gl3', 'gl4', 'es3'] },
+               { 'name': 'glDeleteVertexArrays',
+                 'extensions': ['GL_ARB_vertex_array_object'] },
+               { 'name': 'glDeleteVertexArraysOES' },
+               { 'name': 'glDeleteVertexArraysAPPLE',
+                 'extensions': ['GL_APPLE_vertex_array_object'] }],
+  'arguments': 'GLsizei n, const GLuint* arrays' },
+{ 'return_type': 'void',
   'names': ['glDepthFunc'],
   'arguments': 'GLenum func', },
 { 'return_type': 'void',
@@ -208,25 +246,46 @@ GL_FUNCTIONS = [
   'names': ['glDisableVertexAttribArray'],
   'arguments': 'GLuint index', },
 { 'return_type': 'void',
+  'known_as': 'glDiscardFramebufferEXT',
+  'versions': [{ 'name': 'glInvalidateFramebuffer',
+                 'gl_versions': ['es3'],
+                 'extensions': [] },
+               { 'name': 'glDiscardFramebufferEXT',
+                 'gl_versions': ['es1', 'es2'] }],
+  'arguments': 'GLenum target, GLsizei numAttachments, '
+      'const GLenum* attachments' },
+{ 'return_type': 'void',
   'names': ['glDrawArrays'],
   'arguments': 'GLenum mode, GLint first, GLsizei count', },
 { 'return_type': 'void',
+  'known_as': 'glDrawArraysInstancedANGLE',
+  'names': ['glDrawArraysInstancedARB', 'glDrawArraysInstancedANGLE',
+            'glDrawArraysInstanced'],
+  'arguments': 'GLenum mode, GLint first, GLsizei count, GLsizei primcount', },
+{ 'return_type': 'void',
   'names': ['glDrawBuffer'],
   'arguments': 'GLenum mode', },
 { 'return_type': 'void',
-  'names': ['glDrawBuffersARB', 'glDrawBuffersEXT'],
+  'names': ['glDrawBuffersARB', 'glDrawBuffersEXT', 'glDrawBuffers'],
   'arguments': 'GLsizei n, const GLenum* bufs', },
 { 'return_type': 'void',
   'names': ['glDrawElements'],
   'arguments':
       'GLenum mode, GLsizei count, GLenum type, const void* indices', },
 { 'return_type': 'void',
-  'names': ['glEGLImageTargetTexture2DOES'],
-  'arguments': 'GLenum target, GLeglImageOES image', },
+  'known_as': 'glDrawElementsInstancedANGLE',
+  'names': ['glDrawElementsInstancedARB', 'glDrawElementsInstancedANGLE',
+            'glDrawElementsInstanced'],
+  'arguments':
+      'GLenum mode, GLsizei count, GLenum type, const void* indices, '
+      'GLsizei primcount', },
 { 'return_type': 'void',
   'names': ['glEGLImageTargetRenderbufferStorageOES'],
   'arguments': 'GLenum target, GLeglImageOES image', },
 { 'return_type': 'void',
+  'names': ['glEGLImageTargetTexture2DOES'],
+  'arguments': 'GLenum target, GLeglImageOES image', },
+{ 'return_type': 'void',
   'names': ['glEnable'],
   'arguments': 'GLenum cap', },
 { 'return_type': 'void',
@@ -238,15 +297,24 @@ GL_FUNCTIONS = [
 { 'return_type': 'void',
   'names': ['glEndQueryARB', 'glEndQueryEXT'],
   'arguments': 'GLenum target', },
+{ 'return_type': 'GLsync',
+  'names': ['glFenceSync'],
+  'arguments': 'GLenum condition, GLbitfield flags', },
 { 'return_type': 'void',
   'names': ['glFinish'],
   'arguments': 'void', },
 { 'return_type': 'void',
+  'names': ['glFinishFenceNV'],
+  'arguments': 'GLuint fence', },
+{ 'return_type': 'void',
   'names': ['glFlush'],
   'arguments': 'void', },
 { 'return_type': 'void',
+  'names': ['glFlushMappedBufferRange'],
+  'arguments': 'GLenum target, GLintptr offset, GLsizeiptr length', },
+{ 'return_type': 'void',
   'names': ['glFramebufferRenderbufferEXT', 'glFramebufferRenderbuffer'],
-  'arguments': \
+  'arguments':
       'GLenum target, GLenum attachment, GLenum renderbuffertarget, '
       'GLuint renderbuffer', },
 { 'return_type': 'void',
@@ -271,24 +339,37 @@ GL_FUNCTIONS = [
   'names': ['glGenBuffersARB', 'glGenBuffers'],
   'arguments': 'GLsizei n, GLuint* buffers', },
 { 'return_type': 'void',
-  'names': ['glGenQueries'],
-  'arguments': 'GLsizei n, GLuint* ids', },
-{ 'return_type': 'void',
-  'names': ['glGenQueriesARB', 'glGenQueriesEXT'],
-  'arguments': 'GLsizei n, GLuint* ids', },
-{ 'return_type': 'void',
   'names': ['glGenerateMipmapEXT', 'glGenerateMipmap'],
   'arguments': 'GLenum target', },
 { 'return_type': 'void',
+  'names': ['glGenFencesNV'],
+  'arguments': 'GLsizei n, GLuint* fences', },
+{ 'return_type': 'void',
   'names': ['glGenFramebuffersEXT', 'glGenFramebuffers'],
   'arguments': 'GLsizei n, GLuint* framebuffers', },
 { 'return_type': 'void',
+  'names': ['glGenQueries'],
+  'arguments': 'GLsizei n, GLuint* ids', },
+{ 'return_type': 'void',
+  'names': ['glGenQueriesARB', 'glGenQueriesEXT'],
+  'arguments': 'GLsizei n, GLuint* ids', },
+{ 'return_type': 'void',
   'names': ['glGenRenderbuffersEXT', 'glGenRenderbuffers'],
   'arguments': 'GLsizei n, GLuint* renderbuffers', },
 { 'return_type': 'void',
   'names': ['glGenTextures'],
   'arguments': 'GLsizei n, GLuint* textures', },
 { 'return_type': 'void',
+  'known_as': 'glGenVertexArraysOES',
+  'versions': [{ 'name': 'glGenVertexArrays',
+                 'gl_versions': ['gl3', 'gl4', 'es3'] },
+               { 'name': 'glGenVertexArrays',
+                 'extensions': ['GL_ARB_vertex_array_object'] },
+               { 'name': 'glGenVertexArraysOES' },
+               { 'name': 'glGenVertexArraysAPPLE',
+                 'extensions': ['GL_APPLE_vertex_array_object'] }],
+  'arguments': 'GLsizei n, GLuint* arrays', },
+{ 'return_type': 'void',
   'names': ['glGetActiveAttrib'],
   'arguments':
       'GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, '
@@ -318,6 +399,9 @@ GL_FUNCTIONS = [
   GL_SERVICE_LOG("GL_RESULT: " << GLES2Util::GetStringError(result));
 """, },
 { 'return_type': 'void',
+  'names': ['glGetFenceivNV'],
+  'arguments': 'GLuint fence, GLenum pname, GLint* params', },
+{ 'return_type': 'void',
   'names': ['glGetFloatv'],
   'arguments': 'GLenum pname, GLfloat* params', },
 { 'return_type': 'void',
@@ -327,9 +411,14 @@ GL_FUNCTIONS = [
                'GLenum attachment, GLenum pname, GLint* params', },
 { 'return_type': 'GLenum',
   'names': ['glGetGraphicsResetStatusARB',
-            'glGetGraphicsResetStatusEXT'],
+            'glGetGraphicsResetStatusKHR',
+            'glGetGraphicsResetStatusEXT',
+            'glGetGraphicsResetStatus'],
   'arguments': 'void', },
 { 'return_type': 'void',
+  'names': ['glGetInteger64v'],
+  'arguments': 'GLenum pname, GLint64* params', },
+{ 'return_type': 'void',
   'names': ['glGetIntegerv'],
   'arguments': 'GLenum pname, GLint* params', },
 { 'return_type': 'void',
@@ -341,13 +430,13 @@ GL_FUNCTIONS = [
   'arguments': 'GLuint program, GLsizei bufSize, GLsizei* length, '
                'GLenum* binaryFormat, GLvoid* binary' },
 { 'return_type': 'void',
-  'names': ['glGetProgramiv'],
-  'arguments': 'GLuint program, GLenum pname, GLint* params', },
-{ 'return_type': 'void',
   'names': ['glGetProgramInfoLog'],
   'arguments':
       'GLuint program, GLsizei bufsize, GLsizei* length, char* infolog', },
 { 'return_type': 'void',
+  'names': ['glGetProgramiv'],
+  'arguments': 'GLuint program, GLenum pname, GLint* params', },
+{ 'return_type': 'void',
   'names': ['glGetQueryiv'],
   'arguments': 'GLenum target, GLenum pname, GLint* params', },
 { 'return_type': 'void',
@@ -357,10 +446,11 @@ GL_FUNCTIONS = [
   'names': ['glGetQueryObjecti64v'],
   'arguments': 'GLuint id, GLenum pname, GLint64* params', },
 { 'return_type': 'void',
-  'names': ['glGetQueryObjectiv'],
+  'names': ['glGetQueryObjectiv', 'glGetQueryObjectivARB',
+            'glGetQueryObjectivEXT'],
   'arguments': 'GLuint id, GLenum pname, GLint* params', },
 { 'return_type': 'void',
-  'names': ['glGetQueryObjectui64v'],
+  'names': ['glGetQueryObjectui64v', 'glGetQueryObjectui64vEXT'],
   'arguments': 'GLuint id, GLenum pname, GLuint64* params', },
 { 'return_type': 'void',
   'names': ['glGetQueryObjectuiv'],
@@ -372,13 +462,13 @@ GL_FUNCTIONS = [
   'names': ['glGetRenderbufferParameterivEXT', 'glGetRenderbufferParameteriv'],
   'arguments': 'GLenum target, GLenum pname, GLint* params', },
 { 'return_type': 'void',
-  'names': ['glGetShaderiv'],
-  'arguments': 'GLuint shader, GLenum pname, GLint* params', },
-{ 'return_type': 'void',
   'names': ['glGetShaderInfoLog'],
   'arguments':
       'GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog', },
 { 'return_type': 'void',
+  'names': ['glGetShaderiv'],
+  'arguments': 'GLuint shader, GLenum pname, GLint* params', },
+{ 'return_type': 'void',
   'names': ['glGetShaderPrecisionFormat'],
   'arguments': 'GLenum shadertype, GLenum precisiontype, '
                'GLint* range, GLint* precision', },
@@ -390,6 +480,11 @@ GL_FUNCTIONS = [
   'names': ['glGetString'],
   'arguments': 'GLenum name', },
 { 'return_type': 'void',
+  'names': ['glGetSynciv'],
+  'arguments':
+    'GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length,'
+    'GLint* values', },
+{ 'return_type': 'void',
   'names': ['glGetTexLevelParameterfv'],
   'arguments': 'GLenum target, GLint level, GLenum pname, GLfloat* params', },
 { 'return_type': 'void',
@@ -436,6 +531,9 @@ GL_FUNCTIONS = [
   'names': ['glIsEnabled'],
   'arguments': 'GLenum cap', },
 { 'return_type': 'GLboolean',
+  'names': ['glIsFenceNV'],
+  'arguments': 'GLuint fence', },
+{ 'return_type': 'GLboolean',
   'names': ['glIsFramebufferEXT', 'glIsFramebuffer'],
   'arguments': 'GLuint framebuffer', },
 { 'return_type': 'GLboolean',
@@ -451,8 +549,21 @@ GL_FUNCTIONS = [
   'names': ['glIsShader'],
   'arguments': 'GLuint shader', },
 { 'return_type': 'GLboolean',
+  'names': ['glIsSync'],
+  'arguments': 'GLsync sync', },
+{ 'return_type': 'GLboolean',
   'names': ['glIsTexture'],
   'arguments': 'GLuint texture', },
+{ 'return_type': 'GLboolean',
+  'known_as': 'glIsVertexArrayOES',
+  'versions': [{ 'name': 'glIsVertexArray',
+                 'gl_versions': ['gl3', 'gl4'] },
+               { 'name': 'glIsVertexArray',
+                 'extensions': ['GL_ARB_vertex_array_object'] },
+               { 'name': 'glIsVertexArrayOES' },
+               { 'name': 'glIsVertexArrayAPPLE',
+                 'extensions': ['GL_APPLE_vertex_array_object'] }],
+  'arguments': 'GLuint array' },
 { 'return_type': 'void',
   'names': ['glLineWidth'],
   'arguments': 'GLfloat width', },
@@ -468,8 +579,23 @@ GL_FUNCTIONS = [
   'arguments':
       'GLenum target, GLintptr offset, GLsizeiptr length, GLenum access', },
 { 'return_type': 'void',
-  'names': ['glFlushMappedBufferRange'],
-  'arguments': 'GLenum target, GLintptr offset, GLsizeiptr length', },
+  'known_as': 'glMatrixLoadfEXT',
+  'versions': [{ 'name': 'glMatrixLoadfEXT',
+                 'gl_versions': ['gl4'],
+                 'extensions': ['GL_EXT_direct_state_access'] },
+               { 'name': 'glMatrixLoadfEXT',
+                 'gl_versions': ['es3'],
+                 'extensions': ['GL_NV_path_rendering'] }],
+  'arguments': 'GLenum matrixMode, const GLfloat* m' },
+{ 'return_type': 'void',
+  'known_as': 'glMatrixLoadIdentityEXT',
+  'versions': [{ 'name': 'glMatrixLoadIdentityEXT',
+                 'gl_versions': ['gl4'],
+                 'extensions': ['GL_EXT_direct_state_access'] },
+               { 'name': 'glMatrixLoadIdentityEXT',
+                 'gl_versions': ['es3'],
+                 'extensions': ['GL_NV_path_rendering'] }],
+  'arguments': 'GLenum matrixMode' },
 { 'return_type': 'void',
   'names': ['glPixelStorei'],
   'arguments': 'GLenum pname, GLint param', },
@@ -499,7 +625,7 @@ GL_FUNCTIONS = [
   'names': ['glPushGroupMarkerEXT'],
   'arguments': 'GLsizei length, const char* marker', },
 { 'return_type': 'void',
-  'names': ['glQueryCounter'],
+  'names': ['glQueryCounter', 'glQueryCounterEXT'],
   'arguments': 'GLuint id, GLenum target', },
 { 'return_type': 'void',
   'names': ['glReadBuffer'],
@@ -525,9 +651,18 @@ GL_FUNCTIONS = [
 # function name appearing multiple times.
 # This is the ES3 function, which requires explicit resolve:
 { 'return_type': 'void',
+  'names': ['glRenderbufferStorageEXT', 'glRenderbufferStorage'],
+  'arguments':
+      'GLenum target, GLenum internalformat, GLsizei width, GLsizei height', },
+{ 'return_type': 'void',
   'names': ['glRenderbufferStorageMultisample'],
   'arguments': 'GLenum target, GLsizei samples, GLenum internalformat, '
                'GLsizei width, GLsizei height', },
+{ 'return_type': 'void',
+  'names': ['glRenderbufferStorageMultisampleANGLE',
+            'glRenderbufferStorageMultisample'],
+  'arguments': 'GLenum target, GLsizei samples, GLenum internalformat, '
+               'GLsizei width, GLsizei height', },
 # In desktop GL, EXT and core versions both have an explicit resolve step,
 # though desktop core GL implicitly resolves when drawing to a window.
 # TODO(oetuaho@nvidia.com): Right now this function also doubles as ES2 EXT
@@ -539,25 +674,19 @@ GL_FUNCTIONS = [
   'arguments': 'GLenum target, GLsizei samples, GLenum internalformat, '
                'GLsizei width, GLsizei height', },
 { 'return_type': 'void',
-  'names': ['glRenderbufferStorageMultisampleANGLE',
-            'glRenderbufferStorageMultisample'],
-  'arguments': 'GLenum target, GLsizei samples, GLenum internalformat, '
-               'GLsizei width, GLsizei height', },
-{ 'return_type': 'void',
   'names': ['glRenderbufferStorageMultisampleIMG'],
   'arguments': 'GLenum target, GLsizei samples, GLenum internalformat, '
                'GLsizei width, GLsizei height', },
 { 'return_type': 'void',
-  'names': ['glRenderbufferStorageEXT', 'glRenderbufferStorage'],
-  'arguments':
-      'GLenum target, GLenum internalformat, GLsizei width, GLsizei height', },
-{ 'return_type': 'void',
   'names': ['glSampleCoverage'],
   'arguments': 'GLclampf value, GLboolean invert', },
 { 'return_type': 'void',
   'names': ['glScissor'],
   'arguments': 'GLint x, GLint y, GLsizei width, GLsizei height', },
 { 'return_type': 'void',
+  'names': ['glSetFenceNV'],
+  'arguments': 'GLuint fence, GLenum condition', },
+{ 'return_type': 'void',
   'names': ['glShaderBinary'],
   'arguments': 'GLsizei n, const GLuint* shaders, GLenum binaryformat, '
                'const void* binary, GLsizei length', },
@@ -599,6 +728,9 @@ GL_FUNCTIONS = [
 { 'return_type': 'void',
   'names': ['glStencilOpSeparate'],
   'arguments': 'GLenum face, GLenum fail, GLenum zfail, GLenum zpass', },
+{ 'return_type': 'GLboolean',
+  'names': ['glTestFenceNV'],
+  'arguments': 'GLuint fence', },
 { 'return_type': 'void',
   'names': ['glTexImage2D'],
   'arguments':
@@ -618,7 +750,13 @@ GL_FUNCTIONS = [
   'names': ['glTexParameteriv'],
   'arguments': 'GLenum target, GLenum pname, const GLint* params', },
 { 'return_type': 'void',
-  'names': ['glTexStorage2DEXT'],
+  'known_as': 'glTexStorage2DEXT',
+  'versions': [{ 'name': 'glTexStorage2D',
+                 'gl_versions': ['es3'] },
+               { 'name': 'glTexStorage2D',
+                 'extensions': ['GL_ARB_texture_storage'] },
+               { 'name': 'glTexStorage2DEXT',
+                 'extensions': ['GL_EXT_texture_storage'] }],
   'arguments': 'GLenum target, GLsizei levels, GLenum internalformat, '
                'GLsizei width, GLsizei height', },
 { 'return_type': 'void',
@@ -722,191 +860,90 @@ GL_FUNCTIONS = [
   'names': ['glVertexAttrib4fv'],
   'arguments': 'GLuint indx, const GLfloat* values', },
 { 'return_type': 'void',
+  'known_as': 'glVertexAttribDivisorANGLE',
+  'names': ['glVertexAttribDivisorARB', 'glVertexAttribDivisorANGLE',
+            'glVertexAttribDivisor'],
+  'arguments':
+      'GLuint index, GLuint divisor', },
+{ 'return_type': 'void',
   'names': ['glVertexAttribPointer'],
   'arguments': 'GLuint indx, GLint size, GLenum type, GLboolean normalized, '
                'GLsizei stride, const void* ptr', },
 { 'return_type': 'void',
   'names': ['glViewport'],
   'arguments': 'GLint x, GLint y, GLsizei width, GLsizei height', },
-{ 'return_type': 'void',
-  'names': ['glGenFencesNV'],
-  'arguments': 'GLsizei n, GLuint* fences', },
-{ 'return_type': 'void',
-  'names': ['glDeleteFencesNV'],
-  'arguments': 'GLsizei n, const GLuint* fences', },
-{ 'return_type': 'void',
-  'names': ['glSetFenceNV'],
-  'arguments': 'GLuint fence, GLenum condition', },
-{ 'return_type': 'GLboolean',
-  'names': ['glTestFenceNV'],
-  'arguments': 'GLuint fence', },
-{ 'return_type': 'void',
-  'names': ['glFinishFenceNV'],
-  'arguments': 'GLuint fence', },
-{ 'return_type': 'GLboolean',
-  'names': ['glIsFenceNV'],
-  'arguments': 'GLuint fence', },
-{ 'return_type': 'void',
-  'names': ['glGetFenceivNV'],
-  'arguments': 'GLuint fence, GLenum pname, GLint* params', },
-{ 'return_type': 'GLsync',
-  'names': ['glFenceSync'],
-  'arguments': 'GLenum condition, GLbitfield flags', },
-{ 'return_type': 'void',
-  'names': ['glDeleteSync'],
-  'arguments': 'GLsync sync', },
-{ 'return_type': 'void',
-  'names': ['glGetSynciv'],
-  'arguments':
-    'GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length,'
-    'GLint* values', },
-{ 'return_type': 'GLenum',
-  'names': ['glClientWaitSync'],
-  'arguments':
-    'GLsync sync, GLbitfield flags, GLuint64 timeout', },
 { 'return_type': 'GLenum',
   'names': ['glWaitSync'],
   'arguments':
     'GLsync sync, GLbitfield flags, GLuint64 timeout', },
+]
+
+OSMESA_FUNCTIONS = [
 { 'return_type': 'void',
-  'known_as': 'glDrawArraysInstancedANGLE',
-  'names': ['glDrawArraysInstancedARB', 'glDrawArraysInstancedANGLE',
-            'glDrawArraysInstanced'],
-  'arguments': 'GLenum mode, GLint first, GLsizei count, GLsizei primcount', },
-{ 'return_type': 'void',
-  'known_as': 'glDrawElementsInstancedANGLE',
-  'names': ['glDrawElementsInstancedARB', 'glDrawElementsInstancedANGLE',
-            'glDrawElementsInstanced'],
+  'names': ['OSMesaColorClamp'],
+  'arguments': 'GLboolean enable', },
+{ 'return_type': 'OSMesaContext',
+  'names': ['OSMesaCreateContext'],
+  'arguments': 'GLenum format, OSMesaContext sharelist', },
+{ 'return_type': 'OSMesaContext',
+  'names': ['OSMesaCreateContextExt'],
   'arguments':
-      'GLenum mode, GLsizei count, GLenum type, const void* indices, '
-      'GLsizei primcount', },
+      'GLenum format, GLint depthBits, GLint stencilBits, GLint accumBits, '
+      'OSMesaContext sharelist', },
 { 'return_type': 'void',
-  'known_as': 'glVertexAttribDivisorANGLE',
-  'names': ['glVertexAttribDivisorARB', 'glVertexAttribDivisorANGLE',
-            'glVertexAttribDivisor'],
+  'names': ['OSMesaDestroyContext'],
+  'arguments': 'OSMesaContext ctx', },
+{ 'return_type': 'GLboolean',
+  'names': ['OSMesaGetColorBuffer'],
+  'arguments': 'OSMesaContext c, GLint* width, GLint* height, GLint* format, '
+               'void** buffer', },
+{ 'return_type': 'OSMesaContext',
+  'names': ['OSMesaGetCurrentContext'],
+  'arguments': 'void', },
+{ 'return_type': 'GLboolean',
+  'names': ['OSMesaGetDepthBuffer'],
   'arguments':
-      'GLuint index, GLuint divisor', },
+      'OSMesaContext c, GLint* width, GLint* height, GLint* bytesPerValue, '
+      'void** buffer', },
 { 'return_type': 'void',
-  'known_as': 'glGenVertexArraysOES',
-  'versions': [{ 'name': 'glGenVertexArrays',
-                 'gl_versions': ['gl3', 'gl4'] },
-               { 'name': 'glGenVertexArrays',
-                 'extensions': ['GL_ARB_vertex_array_object'] },
-               { 'name': 'glGenVertexArraysOES' },
-               { 'name': 'glGenVertexArraysAPPLE',
-                 'extensions': ['GL_APPLE_vertex_array_object'] }],
-  'arguments': 'GLsizei n, GLuint* arrays', },
-{ 'return_type': 'void',
-  'known_as': 'glDeleteVertexArraysOES',
-  'versions': [{ 'name': 'glDeleteVertexArrays',
-                 'gl_versions': ['gl3', 'gl4'] },
-               { 'name': 'glDeleteVertexArrays',
-                 'extensions': ['GL_ARB_vertex_array_object'] },
-               { 'name': 'glDeleteVertexArraysOES' },
-               { 'name': 'glDeleteVertexArraysAPPLE',
-                 'extensions': ['GL_APPLE_vertex_array_object'] }],
-  'arguments': 'GLsizei n, const GLuint* arrays' },
-{ 'return_type': 'void',
-  'known_as': 'glBindVertexArrayOES',
-  'versions': [{ 'name': 'glBindVertexArray',
-                 'gl_versions': ['gl3', 'gl4'] },
-               { 'name': 'glBindVertexArray',
-                 'extensions': ['GL_ARB_vertex_array_object'] },
-               { 'name': 'glBindVertexArrayOES' },
-               { 'name': 'glBindVertexArrayAPPLE',
-                 'extensions': ['GL_APPLE_vertex_array_object'] }],
-  'arguments': 'GLuint array' },
-{ 'return_type': 'GLboolean',
-  'known_as': 'glIsVertexArrayOES',
-  'versions': [{ 'name': 'glIsVertexArray',
-                 'gl_versions': ['gl3', 'gl4'] },
-               { 'name': 'glIsVertexArray',
-                 'extensions': ['GL_ARB_vertex_array_object'] },
-               { 'name': 'glIsVertexArrayOES' },
-               { 'name': 'glIsVertexArrayAPPLE',
-                 'extensions': ['GL_APPLE_vertex_array_object'] }],
-  'arguments': 'GLuint array' },
-{ 'return_type': 'void',
-  'known_as': 'glDiscardFramebufferEXT',
-  'versions': [{ 'name': 'glInvalidateFramebuffer',
-                 'gl_versions': ['es3'],
-                 'extensions': [] },
-               { 'name': 'glDiscardFramebufferEXT',
-                 'gl_versions': ['es1', 'es2'] }],
-  'arguments': 'GLenum target, GLsizei numAttachments, '
-      'const GLenum* attachments' },
-]
-
-OSMESA_FUNCTIONS = [
-{ 'return_type': 'OSMesaContext',
-  'names': ['OSMesaCreateContext'],
-  'arguments': 'GLenum format, OSMesaContext sharelist', },
-{ 'return_type': 'OSMesaContext',
-  'names': ['OSMesaCreateContextExt'],
-  'arguments':
-      'GLenum format, GLint depthBits, GLint stencilBits, GLint accumBits, '
-      'OSMesaContext sharelist', },
-{ 'return_type': 'void',
-  'names': ['OSMesaDestroyContext'],
-  'arguments': 'OSMesaContext ctx', },
-{ 'return_type': 'GLboolean',
-  'names': ['OSMesaMakeCurrent'],
-  'arguments': 'OSMesaContext ctx, void* buffer, GLenum type, GLsizei width, '
-               'GLsizei height', },
-{ 'return_type': 'OSMesaContext',
-  'names': ['OSMesaGetCurrentContext'],
-  'arguments': 'void', },
+  'names': ['OSMesaGetIntegerv'],
+  'arguments': 'GLint pname, GLint* value', },
+{ 'return_type': 'OSMESAproc',
+  'names': ['OSMesaGetProcAddress'],
+  'arguments': 'const char* funcName', },
+{ 'return_type': 'GLboolean',
+  'names': ['OSMesaMakeCurrent'],
+  'arguments': 'OSMesaContext ctx, void* buffer, GLenum type, GLsizei width, '
+               'GLsizei height', },
 { 'return_type': 'void',
   'names': ['OSMesaPixelStore'],
   'arguments': 'GLint pname, GLint value', },
-{ 'return_type': 'void',
-  'names': ['OSMesaGetIntegerv'],
-  'arguments': 'GLint pname, GLint* value', },
-{ 'return_type': 'GLboolean',
-  'names': ['OSMesaGetDepthBuffer'],
-  'arguments':
-      'OSMesaContext c, GLint* width, GLint* height, GLint* bytesPerValue, '
-      'void** buffer', },
-{ 'return_type': 'GLboolean',
-  'names': ['OSMesaGetColorBuffer'],
-  'arguments': 'OSMesaContext c, GLint* width, GLint* height, GLint* format, '
-               'void** buffer', },
-{ 'return_type': 'OSMESAproc',
-  'names': ['OSMesaGetProcAddress'],
-  'arguments': 'const char* funcName', },
-{ 'return_type': 'void',
-  'names': ['OSMesaColorClamp'],
-  'arguments': 'GLboolean enable', },
 ]
 
 EGL_FUNCTIONS = [
-{ 'return_type': 'EGLint',
-  'names': ['eglGetError'],
-  'arguments': 'void', },
-{ 'return_type': 'EGLDisplay',
-  'names': ['eglGetDisplay'],
-  'arguments': 'EGLNativeDisplayType display_id', },
-{ 'return_type': 'EGLBoolean',
-  'names': ['eglInitialize'],
-  'arguments': 'EGLDisplay dpy, EGLint* major, EGLint* minor', },
 { 'return_type': 'EGLBoolean',
-  'names': ['eglTerminate'],
-  'arguments': 'EGLDisplay dpy', },
-{ 'return_type': 'const char*',
-  'names': ['eglQueryString'],
-  'arguments': 'EGLDisplay dpy, EGLint name', },
+  'names': ['eglBindAPI'],
+  'arguments': 'EGLenum api', },
 { 'return_type': 'EGLBoolean',
-  'names': ['eglGetConfigs'],
-  'arguments': 'EGLDisplay dpy, EGLConfig* configs, EGLint config_size, '
-               'EGLint* num_config', },
+  'names': ['eglBindTexImage'],
+  'arguments': 'EGLDisplay dpy, EGLSurface surface, EGLint buffer', },
 { 'return_type': 'EGLBoolean',
   'names': ['eglChooseConfig'],
   'arguments': 'EGLDisplay dpy, const EGLint* attrib_list, EGLConfig* configs, '
                'EGLint config_size, EGLint* num_config', },
+{ 'return_type': 'EGLint',
+  'versions': [{ 'name': 'eglClientWaitSyncKHR',
+                 'extensions': ['EGL_KHR_fence_sync'] }],
+  'arguments': 'EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, '
+      'EGLTimeKHR timeout' },
 { 'return_type': 'EGLBoolean',
-  'names': ['eglGetConfigAttrib'],
+  'names': ['eglCopyBuffers'],
   'arguments':
-      'EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint* value', },
+      'EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target', },
+{ 'return_type': 'EGLContext',
+  'names': ['eglCreateContext'],
+  'arguments': 'EGLDisplay dpy, EGLConfig config, EGLContext share_context, '
+              'const EGLint* attrib_list', },
 { 'return_type': 'EGLImageKHR',
   'versions': [{ 'name': 'eglCreateImageKHR',
                  'extensions':
@@ -914,14 +951,11 @@ EGL_FUNCTIONS = [
   'arguments':
       'EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, '
       'const EGLint* attrib_list' },
-{ 'return_type': 'EGLBoolean',
-  'versions': [{ 'name' : 'eglDestroyImageKHR',
-                 'extensions': ['EGL_KHR_image_base'] }],
-  'arguments': 'EGLDisplay dpy, EGLImageKHR image' },
 { 'return_type': 'EGLSurface',
-  'names': ['eglCreateWindowSurface'],
-  'arguments': 'EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, '
-               'const EGLint* attrib_list', },
+  'names': ['eglCreatePbufferFromClientBuffer'],
+  'arguments':
+      'EGLDisplay dpy, EGLenum buftype, void* buffer, EGLConfig config, '
+      'const EGLint* attrib_list', },
 { 'return_type': 'EGLSurface',
   'names': ['eglCreatePbufferSurface'],
   'arguments': 'EGLDisplay dpy, EGLConfig config, const EGLint* attrib_list', },
@@ -929,189 +963,211 @@ EGL_FUNCTIONS = [
   'names': ['eglCreatePixmapSurface'],
   'arguments': 'EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, '
                'const EGLint* attrib_list', },
-{ 'return_type': 'EGLBoolean',
-  'names': ['eglDestroySurface'],
-  'arguments': 'EGLDisplay dpy, EGLSurface surface', },
-{ 'return_type': 'EGLBoolean',
-  'names': ['eglQuerySurface'],
-  'arguments':
-      'EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint* value', },
-{ 'return_type': 'EGLBoolean',
-  'names': ['eglBindAPI'],
-  'arguments': 'EGLenum api', },
-{ 'return_type': 'EGLenum',
-  'names': ['eglQueryAPI'],
-  'arguments': 'void', },
-{ 'return_type': 'EGLBoolean',
-  'names': ['eglWaitClient'],
-  'arguments': 'void', },
-{ 'return_type': 'EGLBoolean',
-  'names': ['eglReleaseThread'],
-  'arguments': 'void', },
+{ 'return_type': 'EGLSyncKHR',
+  'versions': [{ 'name': 'eglCreateSyncKHR',
+                 'extensions': ['EGL_KHR_fence_sync'] }],
+  'arguments': 'EGLDisplay dpy, EGLenum type, const EGLint* attrib_list' },
 { 'return_type': 'EGLSurface',
-  'names': ['eglCreatePbufferFromClientBuffer'],
-  'arguments':
-      'EGLDisplay dpy, EGLenum buftype, void* buffer, EGLConfig config, '
-      'const EGLint* attrib_list', },
-{ 'return_type': 'EGLBoolean',
-  'names': ['eglSurfaceAttrib'],
-  'arguments':
-      'EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value', },
+  'names': ['eglCreateWindowSurface'],
+  'arguments': 'EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, '
+               'const EGLint* attrib_list', },
 { 'return_type': 'EGLBoolean',
-  'names': ['eglBindTexImage'],
-  'arguments': 'EGLDisplay dpy, EGLSurface surface, EGLint buffer', },
+  'names': ['eglDestroyContext'],
+  'arguments': 'EGLDisplay dpy, EGLContext ctx', },
 { 'return_type': 'EGLBoolean',
-  'names': ['eglReleaseTexImage'],
-  'arguments': 'EGLDisplay dpy, EGLSurface surface, EGLint buffer', },
+  'versions': [{ 'name' : 'eglDestroyImageKHR',
+                 'extensions': ['EGL_KHR_image_base'] }],
+  'arguments': 'EGLDisplay dpy, EGLImageKHR image' },
 { 'return_type': 'EGLBoolean',
-  'names': ['eglSwapInterval'],
-  'arguments': 'EGLDisplay dpy, EGLint interval', },
-{ 'return_type': 'EGLContext',
-  'names': ['eglCreateContext'],
-  'arguments': 'EGLDisplay dpy, EGLConfig config, EGLContext share_context, '
-              'const EGLint* attrib_list', },
+  'names': ['eglDestroySurface'],
+  'arguments': 'EGLDisplay dpy, EGLSurface surface', },
 { 'return_type': 'EGLBoolean',
-  'names': ['eglDestroyContext'],
-  'arguments': 'EGLDisplay dpy, EGLContext ctx', },
+  'versions': [{ 'name': 'eglDestroySyncKHR',
+                 'extensions': ['EGL_KHR_fence_sync'] }],
+  'arguments': 'EGLDisplay dpy, EGLSyncKHR sync' },
 { 'return_type': 'EGLBoolean',
-  'names': ['eglMakeCurrent'],
+  'names': ['eglGetConfigAttrib'],
   'arguments':
-      'EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx', },
+      'EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint* value', },
+{ 'return_type': 'EGLBoolean',
+  'names': ['eglGetConfigs'],
+  'arguments': 'EGLDisplay dpy, EGLConfig* configs, EGLint config_size, '
+               'EGLint* num_config', },
 { 'return_type': 'EGLContext',
   'names': ['eglGetCurrentContext'],
   'arguments': 'void', },
+{ 'return_type': 'EGLDisplay',
+  'names': ['eglGetCurrentDisplay'],
+  'arguments': 'void', },
 { 'return_type': 'EGLSurface',
   'names': ['eglGetCurrentSurface'],
   'arguments': 'EGLint readdraw', },
 { 'return_type': 'EGLDisplay',
-  'names': ['eglGetCurrentDisplay'],
+  'names': ['eglGetDisplay'],
+  'arguments': 'EGLNativeDisplayType display_id', },
+{ 'return_type': 'EGLint',
+  'names': ['eglGetError'],
   'arguments': 'void', },
+{ 'return_type': 'EGLDisplay',
+  'known_as': 'eglGetPlatformDisplayEXT',
+  'versions': [{ 'name': 'eglGetPlatformDisplayEXT',
+                 'extensions': ['EGL_ANGLE_platform_angle'] }],
+  'arguments': 'EGLenum platform, void* native_display, '
+               'const EGLint* attrib_list', },
+{ 'return_type': '__eglMustCastToProperFunctionPointerType',
+  'names': ['eglGetProcAddress'],
+  'arguments': 'const char* procname', },
 { 'return_type': 'EGLBoolean',
-  'names': ['eglQueryContext'],
-  'arguments':
-      'EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint* value', },
-{ 'return_type': 'EGLBoolean',
-  'names': ['eglWaitGL'],
-  'arguments': 'void', },
+  'versions': [{ 'name': 'eglGetSyncAttribKHR',
+                 'extensions': ['EGL_KHR_fence_sync'] }],
+  'arguments': 'EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, '
+      'EGLint* value' },
 { 'return_type': 'EGLBoolean',
-  'names': ['eglWaitNative'],
-  'arguments': 'EGLint engine', },
+  'names': ['eglGetSyncValuesCHROMIUM'],
+  'arguments':
+      'EGLDisplay dpy, EGLSurface surface, '
+      'EGLuint64CHROMIUM* ust, EGLuint64CHROMIUM* msc, '
+      'EGLuint64CHROMIUM* sbc', },
 { 'return_type': 'EGLBoolean',
-  'names': ['eglSwapBuffers'],
-  'arguments': 'EGLDisplay dpy, EGLSurface surface', },
+  'names': ['eglInitialize'],
+  'arguments': 'EGLDisplay dpy, EGLint* major, EGLint* minor', },
 { 'return_type': 'EGLBoolean',
-  'names': ['eglCopyBuffers'],
+  'names': ['eglMakeCurrent'],
   'arguments':
-      'EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target', },
-{ 'return_type': '__eglMustCastToProperFunctionPointerType',
-  'names': ['eglGetProcAddress'],
-  'arguments': 'const char* procname', },
+      'EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx', },
 { 'return_type': 'EGLBoolean',
   'names': ['eglPostSubBufferNV'],
   'arguments': 'EGLDisplay dpy, EGLSurface surface, '
     'EGLint x, EGLint y, EGLint width, EGLint height', },
+{ 'return_type': 'EGLenum',
+  'names': ['eglQueryAPI'],
+  'arguments': 'void', },
+{ 'return_type': 'EGLBoolean',
+  'names': ['eglQueryContext'],
+  'arguments':
+      'EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint* value', },
+{ 'return_type': 'const char*',
+  'names': ['eglQueryString'],
+  'arguments': 'EGLDisplay dpy, EGLint name', },
+{ 'return_type': 'EGLBoolean',
+  'names': ['eglQuerySurface'],
+  'arguments':
+      'EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint* value', },
 { 'return_type': 'EGLBoolean',
   'names': ['eglQuerySurfacePointerANGLE'],
   'arguments':
       'EGLDisplay dpy, EGLSurface surface, EGLint attribute, void** value', },
-{ 'return_type': 'EGLSyncKHR',
-  'versions': [{ 'name': 'eglCreateSyncKHR',
-                 'extensions': ['EGL_KHR_fence_sync'] }],
-  'arguments': 'EGLDisplay dpy, EGLenum type, const EGLint* attrib_list' },
-{ 'return_type': 'EGLint',
-  'versions': [{ 'name': 'eglClientWaitSyncKHR',
-                 'extensions': ['EGL_KHR_fence_sync'] }],
-  'arguments': 'EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, '
-      'EGLTimeKHR timeout' },
 { 'return_type': 'EGLBoolean',
-  'versions': [{ 'name': 'eglGetSyncAttribKHR',
-                 'extensions': ['EGL_KHR_fence_sync'] }],
-  'arguments': 'EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, '
-      'EGLint* value' },
+  'names': ['eglReleaseTexImage'],
+  'arguments': 'EGLDisplay dpy, EGLSurface surface, EGLint buffer', },
 { 'return_type': 'EGLBoolean',
-  'versions': [{ 'name': 'eglDestroySyncKHR',
-                 'extensions': ['EGL_KHR_fence_sync'] }],
-  'arguments': 'EGLDisplay dpy, EGLSyncKHR sync' },
+  'names': ['eglReleaseThread'],
+  'arguments': 'void', },
 { 'return_type': 'EGLBoolean',
-  'names': ['eglGetSyncValuesCHROMIUM'],
+  'names': ['eglSurfaceAttrib'],
   'arguments':
-      'EGLDisplay dpy, EGLSurface surface, '
-      'EGLuint64CHROMIUM* ust, EGLuint64CHROMIUM* msc, '
-      'EGLuint64CHROMIUM* sbc', },
+      'EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value', },
+{ 'return_type': 'EGLBoolean',
+  'names': ['eglSwapBuffers'],
+  'arguments': 'EGLDisplay dpy, EGLSurface surface', },
+{ 'return_type': 'EGLBoolean',
+  'names': ['eglSwapInterval'],
+  'arguments': 'EGLDisplay dpy, EGLint interval', },
+{ 'return_type': 'EGLBoolean',
+  'names': ['eglTerminate'],
+  'arguments': 'EGLDisplay dpy', },
+{ 'return_type': 'EGLBoolean',
+  'names': ['eglWaitClient'],
+  'arguments': 'void', },
+{ 'return_type': 'EGLBoolean',
+  'names': ['eglWaitGL'],
+  'arguments': 'void', },
+{ 'return_type': 'EGLBoolean',
+  'names': ['eglWaitNative'],
+  'arguments': 'EGLint engine', },
 { 'return_type': 'EGLint',
   'versions': [{ 'name': 'eglWaitSyncKHR',
-                 'extensions': ['EGL_KHR_fence_sync'] }],
-  'arguments': 'EGLDisplay dpy, EGLSyncKHR sync, EGLint flags' }
+                 'extensions': ['EGL_KHR_fence_sync', 'EGL_KHR_wait_sync'] }],
+  'arguments': 'EGLDisplay dpy, EGLSyncKHR sync, EGLint flags' },
 ]
 
 WGL_FUNCTIONS = [
+{ 'return_type': 'BOOL',
+  'names': ['wglChoosePixelFormatARB'],
+  'arguments':
+      'HDC dc, const int* int_attrib_list, const float* float_attrib_list, '
+      'UINT max_formats, int* formats, UINT* num_formats', },
+{ 'return_type': 'BOOL',
+  'names': ['wglCopyContext'],
+  'arguments': 'HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask', },
 { 'return_type': 'HGLRC',
   'names': ['wglCreateContext'],
   'arguments': 'HDC hdc', },
 { 'return_type': 'HGLRC',
   'names': ['wglCreateLayerContext'],
   'arguments': 'HDC hdc, int iLayerPlane', },
-{ 'return_type': 'BOOL',
-  'names': ['wglCopyContext'],
-  'arguments': 'HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask', },
+{ 'return_type': 'HPBUFFERARB',
+  'names': ['wglCreatePbufferARB'],
+  'arguments': 'HDC hDC, int iPixelFormat, int iWidth, int iHeight, '
+               'const int* piAttribList', },
 { 'return_type': 'BOOL',
   'names': ['wglDeleteContext'],
   'arguments': 'HGLRC hglrc', },
-{ 'return_type': 'HGLRC',
-  'names': ['wglGetCurrentContext'],
-  'arguments': '', },
-{ 'return_type': 'HDC',
-  'names': ['wglGetCurrentDC'],
-  'arguments': '', },
 { 'return_type': 'BOOL',
-  'names': ['wglMakeCurrent'],
-  'arguments': 'HDC hdc, HGLRC hglrc', },
-{ 'return_type': 'BOOL',
-  'names': ['wglShareLists'],
-  'arguments': 'HGLRC hglrc1, HGLRC hglrc2', },
-{ 'return_type': 'BOOL',
-  'names': ['wglSwapIntervalEXT'],
-  'arguments': 'int interval', },
-{ 'return_type': 'BOOL',
-  'names': ['wglSwapLayerBuffers'],
-  'arguments': 'HDC hdc, UINT fuPlanes', },
+  'names': ['wglDestroyPbufferARB'],
+  'arguments': 'HPBUFFERARB hPbuffer', },
+{ 'return_type': 'HGLRC',
+  'names': ['wglGetCurrentContext'],
+  'arguments': '', },
+{ 'return_type': 'HDC',
+  'names': ['wglGetCurrentDC'],
+  'arguments': '', },
 { 'return_type': 'const char*',
   'names': ['wglGetExtensionsStringARB'],
   'arguments': 'HDC hDC', },
 { 'return_type': 'const char*',
   'names': ['wglGetExtensionsStringEXT'],
   'arguments': '', },
-{ 'return_type': 'BOOL',
-  'names': ['wglChoosePixelFormatARB'],
-  'arguments':
-      'HDC dc, const int* int_attrib_list, const float* float_attrib_list, '
-      'UINT max_formats, int* formats, UINT* num_formats', },
-{ 'return_type': 'HPBUFFERARB',
-  'names': ['wglCreatePbufferARB'],
-  'arguments': 'HDC hDC, int iPixelFormat, int iWidth, int iHeight, '
-               'const int* piAttribList', },
 { 'return_type': 'HDC',
   'names': ['wglGetPbufferDCARB'],
   'arguments': 'HPBUFFERARB hPbuffer', },
+{ 'return_type': 'BOOL',
+  'names': ['wglMakeCurrent'],
+  'arguments': 'HDC hdc, HGLRC hglrc', },
+{ 'return_type': 'BOOL',
+  'names': ['wglQueryPbufferARB'],
+  'arguments': 'HPBUFFERARB hPbuffer, int iAttribute, int* piValue', },
 { 'return_type': 'int',
   'names': ['wglReleasePbufferDCARB'],
   'arguments': 'HPBUFFERARB hPbuffer, HDC hDC', },
 { 'return_type': 'BOOL',
-  'names': ['wglDestroyPbufferARB'],
-  'arguments': 'HPBUFFERARB hPbuffer', },
+  'names': ['wglShareLists'],
+  'arguments': 'HGLRC hglrc1, HGLRC hglrc2', },
 { 'return_type': 'BOOL',
-  'names': ['wglQueryPbufferARB'],
-  'arguments': 'HPBUFFERARB hPbuffer, int iAttribute, int* piValue', },
+  'names': ['wglSwapIntervalEXT'],
+  'arguments': 'int interval', },
+{ 'return_type': 'BOOL',
+  'names': ['wglSwapLayerBuffers'],
+  'arguments': 'HDC hdc, UINT fuPlanes', },
 ]
 
 GLX_FUNCTIONS = [
-{ 'return_type': 'int',
-  'names': ['glXWaitVideoSyncSGI'],
-  'arguments': 'int divisor, int remainder, unsigned int* count', },
+{ 'return_type': 'void',
+  'names': ['glXBindTexImageEXT'],
+  'arguments':
+      'Display* dpy, GLXDrawable drawable, int buffer, int* attribList', },
+{ 'return_type': 'GLXFBConfig*',
+  'names': ['glXChooseFBConfig'],
+  'arguments':
+      'Display* dpy, int screen, const int* attribList, int* nitems', },
 { 'return_type': 'XVisualInfo*',
   'names': ['glXChooseVisual'],
   'arguments': 'Display* dpy, int screen, int* attribList', },
 { 'return_type': 'void',
+  'names': ['glXCopyContext'],
+  'arguments':
+      'Display* dpy, GLXContext src, GLXContext dst, unsigned long mask', },
+{ 'return_type': 'void',
   'names': ['glXCopySubBufferMESA'],
   'arguments': 'Display* dpy, GLXDrawable drawable, '
                'int x, int y, int width, int height', },
@@ -1119,152 +1175,143 @@ GLX_FUNCTIONS = [
   'names': ['glXCreateContext'],
   'arguments':
       'Display* dpy, XVisualInfo* vis, GLXContext shareList, int direct', },
-{ 'return_type': 'void',
-  'names': ['glXBindTexImageEXT'],
+{ 'return_type': 'GLXContext',
+  'names': ['glXCreateContextAttribsARB'],
   'arguments':
-      'Display* dpy, GLXDrawable drawable, int buffer, int* attribList', },
-{ 'return_type': 'void',
-  'names': ['glXReleaseTexImageEXT'],
-  'arguments': 'Display* dpy, GLXDrawable drawable, int buffer', },
+      'Display* dpy, GLXFBConfig config, GLXContext share_context, int direct, '
+      'const int* attrib_list', },
+{ 'return_type': 'GLXPixmap',
+  'names': ['glXCreateGLXPixmap'],
+  'arguments': 'Display* dpy, XVisualInfo* visual, Pixmap pixmap', },
+{ 'return_type': 'GLXContext',
+  'names': ['glXCreateNewContext'],
+  'arguments': 'Display* dpy, GLXFBConfig config, int renderType, '
+               'GLXContext shareList, int direct', },
+{ 'return_type': 'GLXPbuffer',
+  'names': ['glXCreatePbuffer'],
+  'arguments': 'Display* dpy, GLXFBConfig config, const int* attribList', },
+{ 'return_type': 'GLXPixmap',
+  'names': ['glXCreatePixmap'],
+  'arguments': 'Display* dpy, GLXFBConfig config, '
+               'Pixmap pixmap, const int* attribList', },
+{ 'return_type': 'GLXWindow',
+  'names': ['glXCreateWindow'],
+  'arguments':
+      'Display* dpy, GLXFBConfig config, Window win, const int* attribList', },
 { 'return_type': 'void',
   'names': ['glXDestroyContext'],
   'arguments': 'Display* dpy, GLXContext ctx', },
-{ 'return_type': 'int',
-  'names': ['glXMakeCurrent'],
-  'arguments': 'Display* dpy, GLXDrawable drawable, GLXContext ctx', },
 { 'return_type': 'void',
-  'names': ['glXCopyContext'],
-  'arguments':
-      'Display* dpy, GLXContext src, GLXContext dst, unsigned long mask', },
+  'names': ['glXDestroyGLXPixmap'],
+  'arguments': 'Display* dpy, GLXPixmap pixmap', },
 { 'return_type': 'void',
-  'names': ['glXSwapBuffers'],
-  'arguments': 'Display* dpy, GLXDrawable drawable', },
-{ 'return_type': 'GLXPixmap',
-  'names': ['glXCreateGLXPixmap'],
-  'arguments': 'Display* dpy, XVisualInfo* visual, Pixmap pixmap', },
+  'names': ['glXDestroyPbuffer'],
+  'arguments': 'Display* dpy, GLXPbuffer pbuf', },
 { 'return_type': 'void',
-  'names': ['glXDestroyGLXPixmap'],
+  'names': ['glXDestroyPixmap'],
   'arguments': 'Display* dpy, GLXPixmap pixmap', },
-{ 'return_type': 'int',
-  'names': ['glXQueryExtension'],
-  'arguments': 'Display* dpy, int* errorb, int* event', },
-{ 'return_type': 'int',
-  'names': ['glXQueryVersion'],
-  'arguments': 'Display* dpy, int* maj, int* min', },
-{ 'return_type': 'int',
-  'names': ['glXIsDirect'],
-  'arguments': 'Display* dpy, GLXContext ctx', },
+{ 'return_type': 'void',
+  'names': ['glXDestroyWindow'],
+  'arguments': 'Display* dpy, GLXWindow window', },
+{ 'return_type': 'const char*',
+  'names': ['glXGetClientString'],
+  'arguments': 'Display* dpy, int name', },
 { 'return_type': 'int',
   'names': ['glXGetConfig'],
   'arguments': 'Display* dpy, XVisualInfo* visual, int attrib, int* value', },
 { 'return_type': 'GLXContext',
   'names': ['glXGetCurrentContext'],
   'arguments': 'void', },
+{ 'return_type': 'Display*',
+  'names': ['glXGetCurrentDisplay'],
+  'arguments': 'void', },
 { 'return_type': 'GLXDrawable',
   'names': ['glXGetCurrentDrawable'],
   'arguments': 'void', },
-{ 'return_type': 'void',
-  'names': ['glXWaitGL'],
-  'arguments': 'void', },
-{ 'return_type': 'void',
-  'names': ['glXWaitX'],
-  'arguments': 'void', },
-{ 'return_type': 'void',
-  'names': ['glXUseXFont'],
-  'arguments': 'Font font, int first, int count, int list', },
-{ 'return_type': 'const char*',
-  'names': ['glXQueryExtensionsString'],
-  'arguments': 'Display* dpy, int screen', },
-{ 'return_type': 'const char*',
-  'names': ['glXQueryServerString'],
-  'arguments': 'Display* dpy, int screen, int name', },
-{ 'return_type': 'const char*',
-  'names': ['glXGetClientString'],
-  'arguments': 'Display* dpy, int name', },
-{ 'return_type': 'Display*',
-  'names': ['glXGetCurrentDisplay'],
+{ 'return_type': 'GLXDrawable',
+  'names': ['glXGetCurrentReadDrawable'],
   'arguments': 'void', },
-{ 'return_type': 'GLXFBConfig*',
-  'names': ['glXChooseFBConfig'],
-  'arguments':
-      'Display* dpy, int screen, const int* attribList, int* nitems', },
 { 'return_type': 'int',
   'names': ['glXGetFBConfigAttrib'],
   'arguments': 'Display* dpy, GLXFBConfig config, int attribute, int* value', },
+{ 'return_type': 'GLXFBConfig',
+  'names': ['glXGetFBConfigFromVisualSGIX'],
+  'arguments': 'Display* dpy, XVisualInfo* visualInfo', },
 { 'return_type': 'GLXFBConfig*',
   'names': ['glXGetFBConfigs'],
   'arguments': 'Display* dpy, int screen, int* nelements', },
-{ 'return_type': 'XVisualInfo*',
-  'names': ['glXGetVisualFromFBConfig'],
-  'arguments': 'Display* dpy, GLXFBConfig config', },
-{ 'return_type': 'GLXWindow',
-  'names': ['glXCreateWindow'],
+{ 'return_type': 'bool',
+  'names': ['glXGetMscRateOML'],
   'arguments':
-      'Display* dpy, GLXFBConfig config, Window win, const int* attribList', },
-{ 'return_type': 'void',
-  'names': ['glXDestroyWindow'],
-  'arguments': 'Display* dpy, GLXWindow window', },
-{ 'return_type': 'GLXPixmap',
-  'names': ['glXCreatePixmap'],
-  'arguments': 'Display* dpy, GLXFBConfig config, '
-               'Pixmap pixmap, const int* attribList', },
-{ 'return_type': 'void',
-  'names': ['glXDestroyPixmap'],
-  'arguments': 'Display* dpy, GLXPixmap pixmap', },
-{ 'return_type': 'GLXPbuffer',
-  'names': ['glXCreatePbuffer'],
-  'arguments': 'Display* dpy, GLXFBConfig config, const int* attribList', },
-{ 'return_type': 'void',
-  'names': ['glXDestroyPbuffer'],
-  'arguments': 'Display* dpy, GLXPbuffer pbuf', },
+      'Display* dpy, GLXDrawable drawable, int32* numerator, '
+      'int32* denominator' },
 { 'return_type': 'void',
-  'names': ['glXQueryDrawable'],
+  'names': ['glXGetSelectedEvent'],
+  'arguments': 'Display* dpy, GLXDrawable drawable, unsigned long* mask', },
+{ 'return_type': 'bool',
+  'names': ['glXGetSyncValuesOML'],
   'arguments':
-      'Display* dpy, GLXDrawable draw, int attribute, unsigned int* value', },
-{ 'return_type': 'GLXContext',
-  'names': ['glXCreateNewContext'],
-  'arguments': 'Display* dpy, GLXFBConfig config, int renderType, '
-               'GLXContext shareList, int direct', },
+      'Display* dpy, GLXDrawable drawable, int64* ust, int64* msc, '
+      'int64* sbc' },
+{ 'return_type': 'XVisualInfo*',
+  'names': ['glXGetVisualFromFBConfig'],
+  'arguments': 'Display* dpy, GLXFBConfig config', },
+{ 'return_type': 'int',
+  'names': ['glXIsDirect'],
+  'arguments': 'Display* dpy, GLXContext ctx', },
 { 'return_type': 'int',
   'names': ['glXMakeContextCurrent'],
   'arguments':
       'Display* dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx', },
-{ 'return_type': 'GLXDrawable',
-  'names': ['glXGetCurrentReadDrawable'],
-  'arguments': 'void', },
+{ 'return_type': 'int',
+  'names': ['glXMakeCurrent'],
+  'arguments': 'Display* dpy, GLXDrawable drawable, GLXContext ctx', },
 { 'return_type': 'int',
   'names': ['glXQueryContext'],
   'arguments': 'Display* dpy, GLXContext ctx, int attribute, int* value', },
 { 'return_type': 'void',
+  'names': ['glXQueryDrawable'],
+  'arguments':
+      'Display* dpy, GLXDrawable draw, int attribute, unsigned int* value', },
+{ 'return_type': 'int',
+  'names': ['glXQueryExtension'],
+  'arguments': 'Display* dpy, int* errorb, int* event', },
+{ 'return_type': 'const char*',
+  'names': ['glXQueryExtensionsString'],
+  'arguments': 'Display* dpy, int screen', },
+{ 'return_type': 'const char*',
+  'names': ['glXQueryServerString'],
+  'arguments': 'Display* dpy, int screen, int name', },
+{ 'return_type': 'int',
+  'names': ['glXQueryVersion'],
+  'arguments': 'Display* dpy, int* maj, int* min', },
+{ 'return_type': 'void',
+  'names': ['glXReleaseTexImageEXT'],
+  'arguments': 'Display* dpy, GLXDrawable drawable, int buffer', },
+{ 'return_type': 'void',
   'names': ['glXSelectEvent'],
   'arguments': 'Display* dpy, GLXDrawable drawable, unsigned long mask', },
 { 'return_type': 'void',
-  'names': ['glXGetSelectedEvent'],
-  'arguments': 'Display* dpy, GLXDrawable drawable, unsigned long* mask', },
+  'names': ['glXSwapBuffers'],
+  'arguments': 'Display* dpy, GLXDrawable drawable', },
+{ 'return_type': 'void',
+  'names': ['glXSwapIntervalEXT'],
+  'arguments': 'Display* dpy, GLXDrawable drawable, int interval', },
 { 'return_type': 'void',
   'names': ['glXSwapIntervalMESA'],
   'arguments': 'unsigned int interval', },
 { 'return_type': 'void',
-  'names': ['glXSwapIntervalEXT'],
-  'arguments': 'Display* dpy, GLXDrawable drawable, int interval', },
-{ 'return_type': 'GLXFBConfig',
-  'names': ['glXGetFBConfigFromVisualSGIX'],
-  'arguments': 'Display* dpy, XVisualInfo* visualInfo', },
-{ 'return_type': 'GLXContext',
-  'names': ['glXCreateContextAttribsARB'],
-  'arguments':
-      'Display* dpy, GLXFBConfig config, GLXContext share_context, int direct, '
-      'const int* attrib_list', },
-{ 'return_type': 'bool',
-  'names': ['glXGetSyncValuesOML'],
-  'arguments':
-      'Display* dpy, GLXDrawable drawable, int64* ust, int64* msc, '
-      'int64* sbc' },
-{ 'return_type': 'bool',
-  'names': ['glXGetMscRateOML'],
-  'arguments':
-      'Display* dpy, GLXDrawable drawable, int32* numerator, '
-      'int32* denominator' },
+  'names': ['glXUseXFont'],
+  'arguments': 'Font font, int first, int count, int list', },
+{ 'return_type': 'void',
+  'names': ['glXWaitGL'],
+  'arguments': 'void', },
+{ 'return_type': 'int',
+  'names': ['glXWaitVideoSyncSGI'],
+  'arguments': 'int divisor, int remainder, unsigned int* count', },
+{ 'return_type': 'void',
+  'names': ['glXWaitX'],
+  'arguments': 'void', },
 ]
 
 FUNCTION_SETS = [
@@ -1291,6 +1338,7 @@ FUNCTION_SETS = [
   [GLX_FUNCTIONS, 'glx', ['GL/glx.h', 'GL/glxext.h'], []],
 ]
 
+
 def GenerateHeader(file, functions, set_name, used_extensions):
   """Generates gl_bindings_autogen_x.h"""
 
@@ -1376,7 +1424,7 @@ def GenerateAPIHeader(file, functions, set_name):
 
   # Write API declaration.
   for func in functions:
-    file.write('  virtual %s %sFn(%s) OVERRIDE;\n' %
+    file.write('  virtual %s %sFn(%s) override;\n' %
       (func['return_type'], func['known_as'], func['arguments']))
 
   file.write('\n')
@@ -1482,9 +1530,10 @@ namespace gfx {
   # on the extension string or the GL version.
   file.write("""void Driver%s::InitializeDynamicBindings(GLContext* context) {
   DCHECK(context && context->IsCurrent(NULL));
-  const GLVersionInfo* ver ALLOW_UNUSED = context->GetVersionInfo();
-  std::string extensions ALLOW_UNUSED = context->GetExtensions();
-  extensions += " ";
+  const GLVersionInfo* ver = context->GetVersionInfo();
+  ALLOW_UNUSED_LOCAL(ver);
+  std::string extensions = context->GetExtensions() + " ";
+  ALLOW_UNUSED_LOCAL(extensions);
 
 """ % set_name.upper())
   for extension in sorted(used_extensions):
@@ -1961,17 +2010,10 @@ def FillExtensionsFromHeaders(functions, extension_headers, extra_extensions):
 def ResolveHeader(header, header_paths):
   paths = header_paths.split(':')
 
-  # Always use a path for Chromium-specific extensions. They are extracted
-  # to separate files.
-  paths.append('.')
-  paths.append('../../gpu')
-
-  root = os.path.abspath(os.path.dirname(__file__))
-
   for path in paths:
     result = os.path.join(path, header)
     if not os.path.isabs(path):
-      result = os.path.relpath(os.path.join(root, result), os.getcwd())
+      result = os.path.relpath(os.path.join(os.getcwd(), result), os.getcwd())
     if os.path.exists(result):
       # Always use forward slashes as path separators. Otherwise backslashes
       # may be incorrectly interpreted as escape characters.
@@ -1986,6 +2028,7 @@ def main(argv):
   parser = optparse.OptionParser()
   parser.add_option('--inputs', action='store_true')
   parser.add_option('--header-paths')
+  parser.add_option('--verify-order', action='store_true')
 
   options, args = parser.parse_args(argv)
 
@@ -2014,6 +2057,16 @@ def main(argv):
       if 'names' in func:
         del func['names']
 
+    # Check function names in each set is sorted in alphabetical order.
+    for index in range(len(functions) - 1):
+      func_name = functions[index]['known_as']
+      next_func_name = functions[index + 1]['known_as']
+      if func_name.lower() > next_func_name.lower():
+        raise Exception(
+            'function %s is not in alphabetical order' % next_func_name)
+    if options.verify_order:
+      continue
+
     extension_headers = [ResolveHeader(h, options.header_paths)
                          for h in extension_headers]
     used_extensions = FillExtensionsFromHeaders(
@@ -2035,20 +2088,21 @@ def main(argv):
     GenerateSource(source_file, functions, set_name, used_extensions)
     source_file.close()
 
-  header_file = open(
-      os.path.join(directory, 'gl_mock_autogen_gl.h'), 'wb')
-  GenerateMockHeader(header_file, GL_FUNCTIONS, 'gl')
-  header_file.close()
+  if not options.verify_order:
+    header_file = open(
+        os.path.join(directory, 'gl_mock_autogen_gl.h'), 'wb')
+    GenerateMockHeader(header_file, GL_FUNCTIONS, 'gl')
+    header_file.close()
 
-  header_file = open(os.path.join(directory, 'gl_bindings_autogen_mock.h'),
-                     'wb')
-  GenerateMockBindingsHeader(header_file, GL_FUNCTIONS)
-  header_file.close()
+    header_file = open(os.path.join(directory, 'gl_bindings_autogen_mock.h'),
+                       'wb')
+    GenerateMockBindingsHeader(header_file, GL_FUNCTIONS)
+    header_file.close()
 
-  source_file = open(os.path.join(directory, 'gl_bindings_autogen_mock.cc'),
-                     'wb')
-  GenerateMockBindingsSource(source_file, GL_FUNCTIONS)
-  source_file.close()
+    source_file = open(os.path.join(directory, 'gl_bindings_autogen_mock.cc'),
+                       'wb')
+    GenerateMockBindingsSource(source_file, GL_FUNCTIONS)
+    source_file.close()
   return 0