Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(645)

Side by Side Diff: ui/gl/generate_bindings.py

Issue 895853003: Update from https://crrev.com/314320 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gl/android/surface_texture.cc ('k') | ui/gl/gl.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """code generator for GL/GLES extension wrangler.""" 6 """code generator for GL/GLES extension wrangler."""
7 7
8 import optparse 8 import optparse
9 import os 9 import os
10 import collections 10 import collections
11 import re 11 import re
12 import platform 12 import platform
13 import sys 13 import sys
14 from subprocess import call 14 from subprocess import call
15 from collections import namedtuple
15 16
16 HEADER_PATHS = [ 17 HEADER_PATHS = [
17 '../../third_party/khronos', 18 '../../third_party/khronos',
18 '../../third_party/mesa/src/include', 19 '../../third_party/mesa/src/include',
19 '.', 20 '.',
20 '../../gpu', 21 '../../gpu',
21 ] 22 ]
22 23
23 """In case there are multiple versions of the same function, one that's listed 24 UNCONDITIONALLY_BOUND_EXTENSIONS = set([
24 first takes priority if its conditions are met. If the function is an extension 25 'WGL_ARB_extensions_string',
25 function, finding the extension from the extension string is a condition for 26 'WGL_EXT_extensions_string',
26 binding it. The last version of the function is treated as a fallback option in 27 'GL_CHROMIUM_gles_depth_binding_hack', # crbug.com/448206
27 case no other versions were bound, so a non-null function pointer in the 28 ])
28 bindings does not guarantee that the function is supported.
29 29
30 Function binding conditions can be specified manually by supplying a versions 30 """Function binding conditions can be specified manually by supplying a versions
31 array instead of the names array. Each version has the following keys: 31 array instead of the names array. Each version has the following keys:
32 name: Mandatory. Name of the function. Multiple versions can have the same 32 name: Mandatory. Name of the function. Multiple versions can have the same
33 name but different conditions. 33 name but different conditions.
34 gl_versions: List of GL versions where the function is found. 34 extensions: Extra Extensions for which the function is bound. Only needed
35 extensions: Extensions where the function is found. If not specified, the 35 in some cases where the extension cannot be parsed from the
36 extensions are determined based on GL header files. 36 headers.
37 If the function exists in an extension header, you may specify
38 an empty array to prevent making that a condition for binding.
39 37
40 By default, the function gets its name from the first name in its names or 38 By default, the function gets its name from the first name in its names or
41 versions array. This can be overridden by supplying a 'known_as' key. 39 versions array. This can be overridden by supplying a 'known_as' key.
42 """ 40 """
43 GL_FUNCTIONS = [ 41 GL_FUNCTIONS = [
44 { 'return_type': 'void', 42 { 'return_type': 'void',
45 'names': ['glActiveTexture'], 43 'names': ['glActiveTexture'],
46 'arguments': 'GLenum texture', }, 44 'arguments': 'GLenum texture', },
47 { 'return_type': 'void', 45 { 'return_type': 'void',
48 'names': ['glAttachShader'], 46 'names': ['glAttachShader'],
49 'arguments': 'GLuint program, GLuint shader', }, 47 'arguments': 'GLuint program, GLuint shader', },
50 { 'return_type': 'void', 48 { 'return_type': 'void',
51 'versions': [{ 'name': 'glBeginQuery', 49 'versions': [{ 'name': 'glBeginQuery' }],
52 'gl_versions': ['gl3', 'gl4', 'es3'] }],
53 'arguments': 'GLenum target, GLuint id', }, 50 'arguments': 'GLenum target, GLuint id', },
54 { 'return_type': 'void', 51 { 'return_type': 'void',
55 'names': ['glBeginQueryARB', 'glBeginQueryEXT'], 52 'versions': [{ 'name': 'glBeginQueryARB' },
53 { 'name': 'glBeginQueryEXT',
54 'extensions': ['GL_EXT_occlusion_query_boolean'] }],
56 'arguments': 'GLenum target, GLuint id', }, 55 'arguments': 'GLenum target, GLuint id', },
57 { 'return_type': 'void', 56 { 'return_type': 'void',
58 'versions': [{ 'name': 'glBeginTransformFeedback', 57 'versions': [{ 'name': 'glBeginTransformFeedback' }],
59 'gl_versions': ['gl3', 'gl4', 'es3'] }],
60 'arguments': 'GLenum primitiveMode', }, 58 'arguments': 'GLenum primitiveMode', },
61 { 'return_type': 'void', 59 { 'return_type': 'void',
62 'names': ['glBindAttribLocation'], 60 'names': ['glBindAttribLocation'],
63 'arguments': 'GLuint program, GLuint index, const char* name', }, 61 'arguments': 'GLuint program, GLuint index, const char* name', },
64 { 'return_type': 'void', 62 { 'return_type': 'void',
65 'names': ['glBindBuffer'], 63 'names': ['glBindBuffer'],
66 'arguments': 'GLenum target, GLuint buffer', }, 64 'arguments': 'GLenum target, GLuint buffer', },
67 { 'return_type': 'void', 65 { 'return_type': 'void',
68 'versions': [{ 'name': 'glBindBufferBase', 66 'versions': [{ 'name': 'glBindBufferBase' }],
69 'gl_versions': ['gl3', 'gl4', 'es3'] }],
70 'arguments': 'GLenum target, GLuint index, GLuint buffer', }, 67 'arguments': 'GLenum target, GLuint index, GLuint buffer', },
71 { 'return_type': 'void', 68 { 'return_type': 'void',
72 'versions': [{ 'name': 'glBindBufferRange', 69 'versions': [{ 'name': 'glBindBufferRange' }],
73 'gl_versions': ['gl3', 'gl4', 'es3'] }],
74 'arguments': 'GLenum target, GLuint index, GLuint buffer, GLintptr offset, ' 70 'arguments': 'GLenum target, GLuint index, GLuint buffer, GLintptr offset, '
75 'GLsizeiptr size', }, 71 'GLsizeiptr size', },
76 { 'return_type': 'void', 72 { 'return_type': 'void',
77 'names': ['glBindFragDataLocation'], 73 'names': ['glBindFragDataLocation'],
78 'arguments': 'GLuint program, GLuint colorNumber, const char* name', }, 74 'arguments': 'GLuint program, GLuint colorNumber, const char* name', },
79 { 'return_type': 'void', 75 { 'return_type': 'void',
80 'names': ['glBindFragDataLocationIndexed'], 76 'names': ['glBindFragDataLocationIndexed'],
81 'arguments': 77 'arguments':
82 'GLuint program, GLuint colorNumber, GLuint index, const char* name', }, 78 'GLuint program, GLuint colorNumber, GLuint index, const char* name', },
83 { 'return_type': 'void', 79 { 'return_type': 'void',
84 'names': ['glBindFramebufferEXT', 'glBindFramebuffer'], 80 'names': ['glBindFramebufferEXT', 'glBindFramebuffer'],
85 'arguments': 'GLenum target, GLuint framebuffer', }, 81 'arguments': 'GLenum target, GLuint framebuffer', },
86 { 'return_type': 'void', 82 { 'return_type': 'void',
87 'names': ['glBindRenderbufferEXT', 'glBindRenderbuffer'], 83 'names': ['glBindRenderbufferEXT', 'glBindRenderbuffer'],
88 'arguments': 'GLenum target, GLuint renderbuffer', }, 84 'arguments': 'GLenum target, GLuint renderbuffer', },
89 { 'return_type': 'void', 85 { 'return_type': 'void',
90 'versions': [{ 'name': 'glBindSampler', 86 'versions': [{ 'name': 'glBindSampler' }],
91 'gl_versions': ['gl3', 'gl4', 'es3'] }], # GL 3.2 or higher.
92 'arguments': 'GLuint unit, GLuint sampler', }, 87 'arguments': 'GLuint unit, GLuint sampler', },
93 { 'return_type': 'void', 88 { 'return_type': 'void',
94 'names': ['glBindTexture'], 89 'names': ['glBindTexture'],
95 'arguments': 'GLenum target, GLuint texture', }, 90 'arguments': 'GLenum target, GLuint texture', },
96 { 'return_type': 'void', 91 { 'return_type': 'void',
97 'versions': [{ 'name': 'glBindTransformFeedback', 92 'versions': [{ 'name': 'glBindTransformFeedback' }],
98 'gl_versions': ['gl4', 'es3'] }],
99 'arguments': 'GLenum target, GLuint id', }, 93 'arguments': 'GLenum target, GLuint id', },
100 { 'return_type': 'void', 94 { 'return_type': 'void',
101 'known_as': 'glBindVertexArrayOES', 95 'known_as': 'glBindVertexArrayOES',
102 'versions': [{ 'name': 'glBindVertexArray', 96 'versions': [{ 'name': 'glBindVertexArray',
103 'gl_versions': ['gl3', 'gl4', 'es3'] }, 97 'extensions': ['GL_ARB_vertex_array_object'], },
104 { 'name': 'glBindVertexArray',
105 'extensions': ['GL_ARB_vertex_array_object'] },
106 { 'name': 'glBindVertexArrayOES' }, 98 { 'name': 'glBindVertexArrayOES' },
107 { 'name': 'glBindVertexArrayAPPLE', 99 { 'name': 'glBindVertexArrayAPPLE',
108 'extensions': ['GL_APPLE_vertex_array_object'] }], 100 'extensions': ['GL_APPLE_vertex_array_object'] }],
109 'arguments': 'GLuint array' }, 101 'arguments': 'GLuint array' },
110 { 'return_type': 'void', 102 { 'return_type': 'void',
111 'known_as': 'glBlendBarrierKHR', 103 'known_as': 'glBlendBarrierKHR',
112 'versions': [{ 'name': 'glBlendBarrierNV', 104 'versions': [{ 'name': 'glBlendBarrierNV',
113 'extensions': ['GL_NV_blend_equation_advanced'] }, 105 'extensions': ['GL_NV_blend_equation_advanced'] },
114 { 'name': 'glBlendBarrierKHR', 106 { 'name': 'glBlendBarrierKHR',
115 'extensions': ['GL_KHR_blend_equation_advanced'] }], 107 'extensions': ['GL_KHR_blend_equation_advanced'] }],
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 'names': ['glCheckFramebufferStatusEXT', 149 'names': ['glCheckFramebufferStatusEXT',
158 'glCheckFramebufferStatus'], 150 'glCheckFramebufferStatus'],
159 'arguments': 'GLenum target', 151 'arguments': 'GLenum target',
160 'logging_code': """ 152 'logging_code': """
161 GL_SERVICE_LOG("GL_RESULT: " << GLEnums::GetStringEnum(result)); 153 GL_SERVICE_LOG("GL_RESULT: " << GLEnums::GetStringEnum(result));
162 """, }, 154 """, },
163 { 'return_type': 'void', 155 { 'return_type': 'void',
164 'names': ['glClear'], 156 'names': ['glClear'],
165 'arguments': 'GLbitfield mask', }, 157 'arguments': 'GLbitfield mask', },
166 { 'return_type': 'void', 158 { 'return_type': 'void',
167 'versions': [{ 'name': 'glClearBufferfi', 159 'versions': [{ 'name': 'glClearBufferfi' }],
168 'gl_versions': ['gl3', 'gl4', 'es3'] }],
169 'arguments': 'GLenum buffer, GLint drawbuffer, const GLfloat depth, ' 160 'arguments': 'GLenum buffer, GLint drawbuffer, const GLfloat depth, '
170 'GLint stencil', }, 161 'GLint stencil', },
171 { 'return_type': 'void', 162 { 'return_type': 'void',
172 'versions': [{ 'name': 'glClearBufferfv', 163 'versions': [{ 'name': 'glClearBufferfv' }],
173 'gl_versions': ['gl3', 'gl4', 'es3'] }],
174 'arguments': 'GLenum buffer, GLint drawbuffer, const GLfloat* value', }, 164 'arguments': 'GLenum buffer, GLint drawbuffer, const GLfloat* value', },
175 { 'return_type': 'void', 165 { 'return_type': 'void',
176 'versions': [{ 'name': 'glClearBufferiv', 166 'versions': [{ 'name': 'glClearBufferiv' }],
177 'gl_versions': ['gl3', 'gl4', 'es3'] }],
178 'arguments': 'GLenum buffer, GLint drawbuffer, const GLint* value', }, 167 'arguments': 'GLenum buffer, GLint drawbuffer, const GLint* value', },
179 { 'return_type': 'void', 168 { 'return_type': 'void',
180 'versions': [{ 'name': 'glClearBufferuiv', 169 'versions': [{ 'name': 'glClearBufferuiv' }],
181 'gl_versions': ['gl3', 'gl4', 'es3'] }],
182 'arguments': 'GLenum buffer, GLint drawbuffer, const GLuint* value', }, 170 'arguments': 'GLenum buffer, GLint drawbuffer, const GLuint* value', },
183 { 'return_type': 'void', 171 { 'return_type': 'void',
184 'names': ['glClearColor'], 172 'names': ['glClearColor'],
185 'arguments': 'GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha', }, 173 'arguments': 'GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha', },
186 { 'return_type': 'void', 174 { 'return_type': 'void',
187 'names': ['glClearDepth'], 175 'versions': [{ 'name': 'glClearDepth',
176 'extensions': ['GL_CHROMIUM_gles_depth_binding_hack'] }],
188 'arguments': 'GLclampd depth', }, 177 'arguments': 'GLclampd depth', },
189 { 'return_type': 'void', 178 { 'return_type': 'void',
190 'names': ['glClearDepthf'], 179 'names': ['glClearDepthf'],
191 'arguments': 'GLclampf depth', }, 180 'arguments': 'GLclampf depth', },
192 { 'return_type': 'void', 181 { 'return_type': 'void',
193 'names': ['glClearStencil'], 182 'names': ['glClearStencil'],
194 'arguments': 'GLint s', }, 183 'arguments': 'GLint s', },
195 { 'return_type': 'GLenum', 184 { 'return_type': 'GLenum',
196 'names': ['glClientWaitSync'], 185 'versions': [{ 'name': 'glClientWaitSync',
186 'extensions': ['GL_ARB_sync'] }],
197 'arguments': 'GLsync sync, GLbitfield flags, GLuint64 timeout', }, 187 'arguments': 'GLsync sync, GLbitfield flags, GLuint64 timeout', },
198 { 'return_type': 'void', 188 { 'return_type': 'void',
199 'names': ['glColorMask'], 189 'names': ['glColorMask'],
200 'arguments': 190 'arguments':
201 'GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha', }, 191 'GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha', },
202 { 'return_type': 'void', 192 { 'return_type': 'void',
203 'names': ['glCompileShader'], 193 'names': ['glCompileShader'],
204 'arguments': 'GLuint shader', }, 194 'arguments': 'GLuint shader', },
205 { 'return_type': 'void', 195 { 'return_type': 'void',
206 'names': ['glCompressedTexImage2D'], 196 'names': ['glCompressedTexImage2D'],
207 'arguments': 197 'arguments':
208 'GLenum target, GLint level, GLenum internalformat, GLsizei width, ' 198 'GLenum target, GLint level, GLenum internalformat, GLsizei width, '
209 'GLsizei height, GLint border, GLsizei imageSize, const void* data', }, 199 'GLsizei height, GLint border, GLsizei imageSize, const void* data', },
210 { 'return_type': 'void', 200 { 'return_type': 'void',
211 'versions': [{ 'name': 'glCompressedTexImage3D', 201 'versions': [{ 'name': 'glCompressedTexImage3D' }],
212 'gl_versions': ['gl3', 'gl4', 'es3'] }],
213 'arguments': 202 'arguments':
214 'GLenum target, GLint level, GLenum internalformat, GLsizei width, ' 203 'GLenum target, GLint level, GLenum internalformat, GLsizei width, '
215 'GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, ' 204 'GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, '
216 'const void* data', }, 205 'const void* data', },
217 { 'return_type': 'void', 206 { 'return_type': 'void',
218 'names': ['glCompressedTexSubImage2D'], 207 'names': ['glCompressedTexSubImage2D'],
219 'arguments': 208 'arguments':
220 'GLenum target, GLint level, GLint xoffset, GLint yoffset, ' 209 'GLenum target, GLint level, GLint xoffset, GLint yoffset, '
221 'GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, ' 210 'GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, '
222 'const void* data', }, 211 'const void* data', },
223 # TODO(zmo): wait for MOCK_METHOD11. 212 # TODO(zmo): wait for MOCK_METHOD11.
224 # { 'return_type': 'void', 213 # { 'return_type': 'void',
225 # 'versions': [{ 'name': 'glCompressedTexSubImage3D', 214 # 'versions': [{ 'name': 'glCompressedTexSubImage3D' }],
226 # 'gl_versions': ['gl3', 'gl4', 'es3'] }],
227 # 'arguments': 215 # 'arguments':
228 # 'GLenum target, GLint level, GLint xoffset, GLint yoffset, ' 216 # 'GLenum target, GLint level, GLint xoffset, GLint yoffset, '
229 # 'GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, ' 217 # 'GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, '
230 # 'GLenum format, GLsizei imageSize, const void* data', }, 218 # 'GLenum format, GLsizei imageSize, const void* data', },
231 { 'return_type': 'void', 219 { 'return_type': 'void',
232 'versions': [{ 'name': 'glCopyBufferSubData', 220 'versions': [{ 'name': 'glCopyBufferSubData' }],
233 'gl_versions': ['gl3', 'gl4', 'es3'] }], # GL 3.1 or higher.
234 'arguments': 221 'arguments':
235 'GLenum readTarget, GLenum writeTarget, GLintptr readOffset, ' 222 'GLenum readTarget, GLenum writeTarget, GLintptr readOffset, '
236 'GLintptr writeOffset, GLsizeiptr size', }, 223 'GLintptr writeOffset, GLsizeiptr size', },
237 { 'return_type': 'void', 224 { 'return_type': 'void',
238 'names': ['glCopyTexImage2D'], 225 'names': ['glCopyTexImage2D'],
239 'arguments': 226 'arguments':
240 'GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, ' 227 'GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, '
241 'GLsizei width, GLsizei height, GLint border', }, 228 'GLsizei width, GLsizei height, GLint border', },
242 { 'return_type': 'void', 229 { 'return_type': 'void',
243 'names': ['glCopyTexSubImage2D'], 230 'names': ['glCopyTexSubImage2D'],
244 'arguments': 231 'arguments':
245 'GLenum target, GLint level, GLint xoffset, ' 232 'GLenum target, GLint level, GLint xoffset, '
246 'GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height', }, 233 'GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height', },
247 { 'return_type': 'void', 234 { 'return_type': 'void',
248 'versions': [{ 'name': 'glCopyTexSubImage3D', 235 'versions': [{ 'name': 'glCopyTexSubImage3D' }],
249 'gl_versions': ['gl3', 'gl4', 'es3'] }],
250 'arguments': 236 'arguments':
251 'GLenum target, GLint level, GLint xoffset, GLint yoffset, ' 237 'GLenum target, GLint level, GLint xoffset, GLint yoffset, '
252 'GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height', }, 238 'GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height', },
253 { 'return_type': 'GLuint', 239 { 'return_type': 'GLuint',
254 'names': ['glCreateProgram'], 240 'names': ['glCreateProgram'],
255 'arguments': 'void', }, 241 'arguments': 'void', },
256 { 'return_type': 'GLuint', 242 { 'return_type': 'GLuint',
257 'names': ['glCreateShader'], 243 'names': ['glCreateShader'],
258 'arguments': 'GLenum type', }, 244 'arguments': 'GLenum type', },
259 { 'return_type': 'void', 245 { 'return_type': 'void',
260 'names': ['glCullFace'], 246 'names': ['glCullFace'],
261 'arguments': 'GLenum mode', }, 247 'arguments': 'GLenum mode', },
262 { 'return_type': 'void', 248 { 'return_type': 'void',
263 'names': ['glDeleteBuffersARB', 'glDeleteBuffers'], 249 'names': ['glDeleteBuffers'],
250 'known_as': 'glDeleteBuffersARB',
264 'arguments': 'GLsizei n, const GLuint* buffers', }, 251 'arguments': 'GLsizei n, const GLuint* buffers', },
265 { 'return_type': 'void', 252 { 'return_type': 'void',
266 'known_as': 'glDeleteFencesAPPLE', 253 'known_as': 'glDeleteFencesAPPLE',
267 'versions': [{ 'name': 'glDeleteFencesAPPLE', 254 'versions': [{ 'name': 'glDeleteFencesAPPLE',
268 'extensions': ['GL_APPLE_fence'] }], 255 'extensions': ['GL_APPLE_fence'] }],
269 'arguments': 'GLsizei n, const GLuint* fences', }, 256 'arguments': 'GLsizei n, const GLuint* fences', },
270 { 'return_type': 'void', 257 { 'return_type': 'void',
271 'names': ['glDeleteFencesNV'], 258 'names': ['glDeleteFencesNV'],
272 'arguments': 'GLsizei n, const GLuint* fences', }, 259 'arguments': 'GLsizei n, const GLuint* fences', },
273 { 'return_type': 'void', 260 { 'return_type': 'void',
274 'names': ['glDeleteFramebuffersEXT', 'glDeleteFramebuffers'], 261 'names': ['glDeleteFramebuffersEXT', 'glDeleteFramebuffers'],
275 'arguments': 'GLsizei n, const GLuint* framebuffers', }, 262 'arguments': 'GLsizei n, const GLuint* framebuffers', },
276 { 'return_type': 'void', 263 { 'return_type': 'void',
277 'names': ['glDeleteProgram'], 264 'names': ['glDeleteProgram'],
278 'arguments': 'GLuint program', }, 265 'arguments': 'GLuint program', },
279 { 'return_type': 'void', 266 { 'return_type': 'void',
280 'versions': [{ 'name': 'glDeleteQueries', 267 'versions': [{ 'name': 'glDeleteQueries' }],
281 'gl_versions': ['gl3', 'gl4', 'es3'] }],
282 'arguments': 'GLsizei n, const GLuint* ids', }, 268 'arguments': 'GLsizei n, const GLuint* ids', },
283 { 'return_type': 'void', 269 { 'return_type': 'void',
284 'names': ['glDeleteQueriesARB', 'glDeleteQueriesEXT'], 270 'versions': [{ 'name': 'glDeleteQueriesARB'},
271 { 'name': 'glDeleteQueriesEXT',
272 'extensions': ['GL_EXT_occlusion_query_boolean'] }],
285 'arguments': 'GLsizei n, const GLuint* ids', }, 273 'arguments': 'GLsizei n, const GLuint* ids', },
286 { 'return_type': 'void', 274 { 'return_type': 'void',
287 'names': ['glDeleteRenderbuffersEXT', 'glDeleteRenderbuffers'], 275 'names': ['glDeleteRenderbuffersEXT', 'glDeleteRenderbuffers'],
288 'arguments': 'GLsizei n, const GLuint* renderbuffers', }, 276 'arguments': 'GLsizei n, const GLuint* renderbuffers', },
289 { 'return_type': 'void', 277 { 'return_type': 'void',
290 'versions': [{ 'name': 'glDeleteSamplers', 278 'versions': [{ 'name': 'glDeleteSamplers' }],
291 'gl_versions': ['gl3', 'gl4', 'es3'] }], # GL 3.2 or higher.
292 'arguments': 'GLsizei n, const GLuint* samplers', }, 279 'arguments': 'GLsizei n, const GLuint* samplers', },
293 { 'return_type': 'void', 280 { 'return_type': 'void',
294 'names': ['glDeleteShader'], 281 'names': ['glDeleteShader'],
295 'arguments': 'GLuint shader', }, 282 'arguments': 'GLuint shader', },
296 { 'return_type': 'void', 283 { 'return_type': 'void',
297 'names': ['glDeleteSync'], 284 'versions': [{ 'name': 'glDeleteSync',
285 'extensions': ['GL_ARB_sync'] }],
298 'arguments': 'GLsync sync', }, 286 'arguments': 'GLsync sync', },
299 { 'return_type': 'void', 287 { 'return_type': 'void',
300 'names': ['glDeleteTextures'], 288 'names': ['glDeleteTextures'],
301 'arguments': 'GLsizei n, const GLuint* textures', }, 289 'arguments': 'GLsizei n, const GLuint* textures', },
302 { 'return_type': 'void', 290 { 'return_type': 'void',
303 'versions': [{ 'name': 'glDeleteTransformFeedbacks', 291 'versions': [{ 'name': 'glDeleteTransformFeedbacks' }],
304 'gl_versions': ['gl4', 'es3'] }],
305 'arguments': 'GLsizei n, const GLuint* ids', }, 292 'arguments': 'GLsizei n, const GLuint* ids', },
306 { 'return_type': 'void', 293 { 'return_type': 'void',
307 'known_as': 'glDeleteVertexArraysOES', 294 'known_as': 'glDeleteVertexArraysOES',
308 'versions': [{ 'name': 'glDeleteVertexArrays', 295 'versions': [{ 'name': 'glDeleteVertexArrays',
309 'gl_versions': ['gl3', 'gl4', 'es3'] }, 296 'extensions': ['GL_ARB_vertex_array_object'], },
310 { 'name': 'glDeleteVertexArrays',
311 'extensions': ['GL_ARB_vertex_array_object'] },
312 { 'name': 'glDeleteVertexArraysOES' }, 297 { 'name': 'glDeleteVertexArraysOES' },
313 { 'name': 'glDeleteVertexArraysAPPLE', 298 { 'name': 'glDeleteVertexArraysAPPLE',
314 'extensions': ['GL_APPLE_vertex_array_object'] }], 299 'extensions': ['GL_APPLE_vertex_array_object'] }],
315 'arguments': 'GLsizei n, const GLuint* arrays' }, 300 'arguments': 'GLsizei n, const GLuint* arrays' },
316 { 'return_type': 'void', 301 { 'return_type': 'void',
317 'names': ['glDepthFunc'], 302 'names': ['glDepthFunc'],
318 'arguments': 'GLenum func', }, 303 'arguments': 'GLenum func', },
319 { 'return_type': 'void', 304 { 'return_type': 'void',
320 'names': ['glDepthMask'], 305 'names': ['glDepthMask'],
321 'arguments': 'GLboolean flag', }, 306 'arguments': 'GLboolean flag', },
322 { 'return_type': 'void', 307 { 'return_type': 'void',
323 'names': ['glDepthRange'], 308 'versions': [{ 'name': 'glDepthRange',
309 'extensions': ['GL_CHROMIUM_gles_depth_binding_hack'] }],
324 'arguments': 'GLclampd zNear, GLclampd zFar', }, 310 'arguments': 'GLclampd zNear, GLclampd zFar', },
325 { 'return_type': 'void', 311 { 'return_type': 'void',
326 'names': ['glDepthRangef'], 312 'names': ['glDepthRangef'],
327 'arguments': 'GLclampf zNear, GLclampf zFar', }, 313 'arguments': 'GLclampf zNear, GLclampf zFar', },
328 { 'return_type': 'void', 314 { 'return_type': 'void',
329 'names': ['glDetachShader'], 315 'names': ['glDetachShader'],
330 'arguments': 'GLuint program, GLuint shader', }, 316 'arguments': 'GLuint program, GLuint shader', },
331 { 'return_type': 'void', 317 { 'return_type': 'void',
332 'names': ['glDisable'], 318 'names': ['glDisable'],
333 'arguments': 'GLenum cap', }, 319 'arguments': 'GLenum cap', },
(...skipping 24 matching lines...) Expand all
358 'arguments': 344 'arguments':
359 'GLenum mode, GLsizei count, GLenum type, const void* indices', }, 345 'GLenum mode, GLsizei count, GLenum type, const void* indices', },
360 { 'return_type': 'void', 346 { 'return_type': 'void',
361 'known_as': 'glDrawElementsInstancedANGLE', 347 'known_as': 'glDrawElementsInstancedANGLE',
362 'names': ['glDrawElementsInstancedARB', 'glDrawElementsInstancedANGLE', 348 'names': ['glDrawElementsInstancedARB', 'glDrawElementsInstancedANGLE',
363 'glDrawElementsInstanced'], 349 'glDrawElementsInstanced'],
364 'arguments': 350 'arguments':
365 'GLenum mode, GLsizei count, GLenum type, const void* indices, ' 351 'GLenum mode, GLsizei count, GLenum type, const void* indices, '
366 'GLsizei primcount', }, 352 'GLsizei primcount', },
367 { 'return_type': 'void', 353 { 'return_type': 'void',
368 'versions': [{ 'name': 'glDrawRangeElements', 354 'versions': [{ 'name': 'glDrawRangeElements' }],
369 'gl_versions': ['gl3', 'gl4', 'es3'] }],
370 'arguments': 'GLenum mode, GLuint start, GLuint end, GLsizei count, ' 355 'arguments': 'GLenum mode, GLuint start, GLuint end, GLsizei count, '
371 'GLenum type, const void* indices', }, 356 'GLenum type, const void* indices', },
372 { 'return_type': 'void', 357 { 'return_type': 'void',
373 'names': ['glEGLImageTargetRenderbufferStorageOES'], 358 'names': ['glEGLImageTargetRenderbufferStorageOES'],
374 'arguments': 'GLenum target, GLeglImageOES image', }, 359 'arguments': 'GLenum target, GLeglImageOES image', },
375 { 'return_type': 'void', 360 { 'return_type': 'void',
376 'names': ['glEGLImageTargetTexture2DOES'], 361 'names': ['glEGLImageTargetTexture2DOES'],
377 'arguments': 'GLenum target, GLeglImageOES image', }, 362 'arguments': 'GLenum target, GLeglImageOES image', },
378 { 'return_type': 'void', 363 { 'return_type': 'void',
379 'names': ['glEnable'], 364 'names': ['glEnable'],
380 'arguments': 'GLenum cap', }, 365 'arguments': 'GLenum cap', },
381 { 'return_type': 'void', 366 { 'return_type': 'void',
382 'names': ['glEnableVertexAttribArray'], 367 'names': ['glEnableVertexAttribArray'],
383 'arguments': 'GLuint index', }, 368 'arguments': 'GLuint index', },
384 { 'return_type': 'void', 369 { 'return_type': 'void',
385 'versions': [{ 'name': 'glEndQuery', 370 'versions': [{ 'name': 'glEndQuery' }],
386 'gl_versions': ['gl3', 'gl4', 'es3'] }],
387 'arguments': 'GLenum target', }, 371 'arguments': 'GLenum target', },
388 { 'return_type': 'void', 372 { 'return_type': 'void',
389 'names': ['glEndQueryARB', 'glEndQueryEXT'], 373 'versions': [{ 'name': 'glEndQueryARB' },
374 { 'name': 'glEndQueryEXT',
375 'extensions': ['GL_EXT_occlusion_query_boolean'] }],
390 'arguments': 'GLenum target', }, 376 'arguments': 'GLenum target', },
391 { 'return_type': 'void', 377 { 'return_type': 'void',
392 'versions': [{ 'name': 'glEndTransformFeedback', 378 'versions': [{ 'name': 'glEndTransformFeedback' }],
393 'gl_versions': ['gl3', 'gl4', 'es3'] }],
394 'arguments': 'void', }, 379 'arguments': 'void', },
395 { 'return_type': 'GLsync', 380 { 'return_type': 'GLsync',
396 'names': ['glFenceSync'], 381 'versions': [{ 'name': 'glFenceSync',
382 'extensions': ['GL_ARB_sync'] }],
397 'arguments': 'GLenum condition, GLbitfield flags', }, 383 'arguments': 'GLenum condition, GLbitfield flags', },
398 { 'return_type': 'void', 384 { 'return_type': 'void',
399 'names': ['glFinish'], 385 'names': ['glFinish'],
400 'arguments': 'void', }, 386 'arguments': 'void', },
401 { 'return_type': 'void', 387 { 'return_type': 'void',
402 'known_as': 'glFinishFenceAPPLE', 388 'known_as': 'glFinishFenceAPPLE',
403 'versions': [{ 'name': 'glFinishFenceAPPLE', 389 'versions': [{ 'name': 'glFinishFenceAPPLE',
404 'extensions': ['GL_APPLE_fence'] }], 390 'extensions': ['GL_APPLE_fence'] }],
405 'arguments': 'GLuint fence', }, 391 'arguments': 'GLuint fence', },
406 { 'return_type': 'void', 392 { 'return_type': 'void',
(...skipping 19 matching lines...) Expand all
426 'names': ['glFramebufferTexture2DMultisampleEXT'], 412 'names': ['glFramebufferTexture2DMultisampleEXT'],
427 'arguments': 413 'arguments':
428 'GLenum target, GLenum attachment, GLenum textarget, GLuint texture, ' 414 'GLenum target, GLenum attachment, GLenum textarget, GLuint texture, '
429 'GLint level, GLsizei samples', }, 415 'GLint level, GLsizei samples', },
430 { 'return_type': 'void', 416 { 'return_type': 'void',
431 'names': ['glFramebufferTexture2DMultisampleIMG'], 417 'names': ['glFramebufferTexture2DMultisampleIMG'],
432 'arguments': 418 'arguments':
433 'GLenum target, GLenum attachment, GLenum textarget, GLuint texture, ' 419 'GLenum target, GLenum attachment, GLenum textarget, GLuint texture, '
434 'GLint level, GLsizei samples', }, 420 'GLint level, GLsizei samples', },
435 { 'return_type': 'void', 421 { 'return_type': 'void',
436 'versions': [{ 'name': 'glFramebufferTextureLayer', 422 'versions': [{ 'name': 'glFramebufferTextureLayer' }],
437 'gl_versions': ['gl3', 'gl4', 'es3'] }],
438 'arguments': 'GLenum target, GLenum attachment, GLuint texture, GLint level, ' 423 'arguments': 'GLenum target, GLenum attachment, GLuint texture, GLint level, '
439 'GLint layer', }, 424 'GLint layer', },
440 { 'return_type': 'void', 425 { 'return_type': 'void',
441 'names': ['glFrontFace'], 426 'names': ['glFrontFace'],
442 'arguments': 'GLenum mode', }, 427 'arguments': 'GLenum mode', },
443 { 'return_type': 'void', 428 { 'return_type': 'void',
444 'names': ['glGenBuffersARB', 'glGenBuffers'], 429 'names': ['glGenBuffers'],
430 'known_as': 'glGenBuffersARB',
445 'arguments': 'GLsizei n, GLuint* buffers', }, 431 'arguments': 'GLsizei n, GLuint* buffers', },
446 { 'return_type': 'void', 432 { 'return_type': 'void',
447 'names': ['glGenerateMipmapEXT', 'glGenerateMipmap'], 433 'names': ['glGenerateMipmapEXT', 'glGenerateMipmap'],
448 'arguments': 'GLenum target', }, 434 'arguments': 'GLenum target', },
449 { 'return_type': 'void', 435 { 'return_type': 'void',
450 'known_as': 'glGenFencesAPPLE', 436 'known_as': 'glGenFencesAPPLE',
451 'versions': [{ 'name': 'glGenFencesAPPLE', 437 'versions': [{ 'name': 'glGenFencesAPPLE',
452 'extensions': ['GL_APPLE_fence'] }], 438 'extensions': ['GL_APPLE_fence'] }],
453 'arguments': 'GLsizei n, GLuint* fences', }, 439 'arguments': 'GLsizei n, GLuint* fences', },
454 { 'return_type': 'void', 440 { 'return_type': 'void',
455 'names': ['glGenFencesNV'], 441 'names': ['glGenFencesNV'],
456 'arguments': 'GLsizei n, GLuint* fences', }, 442 'arguments': 'GLsizei n, GLuint* fences', },
457 { 'return_type': 'void', 443 { 'return_type': 'void',
458 'names': ['glGenFramebuffersEXT', 'glGenFramebuffers'], 444 'names': ['glGenFramebuffersEXT', 'glGenFramebuffers'],
459 'arguments': 'GLsizei n, GLuint* framebuffers', }, 445 'arguments': 'GLsizei n, GLuint* framebuffers', },
460 { 'return_type': 'void', 446 { 'return_type': 'void',
461 'versions': [{ 'name': 'glGenQueries', 447 'versions': [{ 'name': 'glGenQueries' }],
462 'gl_versions': ['gl3', 'gl4', 'es3'] }],
463 'arguments': 'GLsizei n, GLuint* ids', }, 448 'arguments': 'GLsizei n, GLuint* ids', },
464 { 'return_type': 'void', 449 { 'return_type': 'void',
465 'names': ['glGenQueriesARB', 'glGenQueriesEXT'], 450 'versions': [{ 'name': 'glGenQueriesARB', },
451 { 'name' : 'glGenQueriesEXT',
452 'extensions': ['GL_EXT_occlusion_query_boolean'] }],
466 'arguments': 'GLsizei n, GLuint* ids', }, 453 'arguments': 'GLsizei n, GLuint* ids', },
467 { 'return_type': 'void', 454 { 'return_type': 'void',
468 'names': ['glGenRenderbuffersEXT', 'glGenRenderbuffers'], 455 'names': ['glGenRenderbuffersEXT', 'glGenRenderbuffers'],
469 'arguments': 'GLsizei n, GLuint* renderbuffers', }, 456 'arguments': 'GLsizei n, GLuint* renderbuffers', },
470 { 'return_type': 'void', 457 { 'return_type': 'void',
471 'versions': [{ 'name': 'glGenSamplers', 458 'versions': [{ 'name': 'glGenSamplers' }],
472 'gl_versions': ['gl3', 'gl4', 'es3'] }], # GL 3.2 or higher.
473 'arguments': 'GLsizei n, GLuint* samplers', }, 459 'arguments': 'GLsizei n, GLuint* samplers', },
474 { 'return_type': 'void', 460 { 'return_type': 'void',
475 'names': ['glGenTextures'], 461 'names': ['glGenTextures'],
476 'arguments': 'GLsizei n, GLuint* textures', }, 462 'arguments': 'GLsizei n, GLuint* textures', },
477 { 'return_type': 'void', 463 { 'return_type': 'void',
478 'versions': [{ 'name': 'glGenTransformFeedbacks', 464 'versions': [{ 'name': 'glGenTransformFeedbacks' }],
479 'gl_versions': ['gl4', 'es3'] }],
480 'arguments': 'GLsizei n, GLuint* ids', }, 465 'arguments': 'GLsizei n, GLuint* ids', },
481 { 'return_type': 'void', 466 { 'return_type': 'void',
482 'known_as': 'glGenVertexArraysOES', 467 'known_as': 'glGenVertexArraysOES',
483 'versions': [{ 'name': 'glGenVertexArrays', 468 'versions': [{ 'name': 'glGenVertexArrays',
484 'gl_versions': ['gl3', 'gl4', 'es3'] }, 469 'extensions': ['GL_ARB_vertex_array_object'], },
485 { 'name': 'glGenVertexArrays',
486 'extensions': ['GL_ARB_vertex_array_object'] },
487 { 'name': 'glGenVertexArraysOES' }, 470 { 'name': 'glGenVertexArraysOES' },
488 { 'name': 'glGenVertexArraysAPPLE', 471 { 'name': 'glGenVertexArraysAPPLE',
489 'extensions': ['GL_APPLE_vertex_array_object'] }], 472 'extensions': ['GL_APPLE_vertex_array_object'] }],
490 'arguments': 'GLsizei n, GLuint* arrays', }, 473 'arguments': 'GLsizei n, GLuint* arrays', },
491 { 'return_type': 'void', 474 { 'return_type': 'void',
492 'names': ['glGetActiveAttrib'], 475 'names': ['glGetActiveAttrib'],
493 'arguments': 476 'arguments':
494 'GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, ' 477 'GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, '
495 'GLint* size, GLenum* type, char* name', }, 478 'GLint* size, GLenum* type, char* name', },
496 { 'return_type': 'void', 479 { 'return_type': 'void',
497 'names': ['glGetActiveUniform'], 480 'names': ['glGetActiveUniform'],
498 'arguments': 481 'arguments':
499 'GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, ' 482 'GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, '
500 'GLint* size, GLenum* type, char* name', }, 483 'GLint* size, GLenum* type, char* name', },
501 { 'return_type': 'void', 484 { 'return_type': 'void',
502 'versions': [{ 'name': 'glGetActiveUniformBlockiv', 485 'versions': [{ 'name': 'glGetActiveUniformBlockiv' }],
503 'gl_versions': ['gl3', 'gl4', 'es3'] }], # GL 3.1 or higher.
504 'arguments': 'GLuint program, GLuint uniformBlockIndex, GLenum pname, ' 486 'arguments': 'GLuint program, GLuint uniformBlockIndex, GLenum pname, '
505 'GLint* params', }, 487 'GLint* params', },
506 { 'return_type': 'void', 488 { 'return_type': 'void',
507 'versions': [{ 'name': 'glGetActiveUniformBlockName', 489 'versions': [{ 'name': 'glGetActiveUniformBlockName' }],
508 'gl_versions': ['gl3', 'gl4', 'es3'] }], # GL 3.1 or higher.
509 'arguments': 'GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, ' 490 'arguments': 'GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, '
510 'GLsizei* length, char* uniformBlockName', }, 491 'GLsizei* length, char* uniformBlockName', },
511 { 'return_type': 'void', 492 { 'return_type': 'void',
512 'versions': [{ 'name': 'glGetActiveUniformsiv', 493 'versions': [{ 'name': 'glGetActiveUniformsiv' }],
513 'gl_versions': ['gl3', 'gl4', 'es3'] }], # GL 3.1 or higher.
514 'arguments': 'GLuint program, GLsizei uniformCount, ' 494 'arguments': 'GLuint program, GLsizei uniformCount, '
515 'const GLuint* uniformIndices, GLenum pname, GLint* params', }, 495 'const GLuint* uniformIndices, GLenum pname, GLint* params', },
516 { 'return_type': 'void', 496 { 'return_type': 'void',
517 'names': ['glGetAttachedShaders'], 497 'names': ['glGetAttachedShaders'],
518 'arguments': 498 'arguments':
519 'GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders', }, 499 'GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders', },
520 { 'return_type': 'GLint', 500 { 'return_type': 'GLint',
521 'names': ['glGetAttribLocation'], 501 'names': ['glGetAttribLocation'],
522 'arguments': 'GLuint program, const char* name', }, 502 'arguments': 'GLuint program, const char* name', },
523 { 'return_type': 'void', 503 { 'return_type': 'void',
524 'names': ['glGetBooleanv'], 504 'names': ['glGetBooleanv'],
525 'arguments': 'GLenum pname, GLboolean* params', }, 505 'arguments': 'GLenum pname, GLboolean* params', },
526 { 'return_type': 'void', 506 { 'return_type': 'void',
527 'names': ['glGetBufferParameteriv'], 507 'names': ['glGetBufferParameteriv'],
528 'arguments': 'GLenum target, GLenum pname, GLint* params', }, 508 'arguments': 'GLenum target, GLenum pname, GLint* params', },
529 { 'return_type': 'GLenum', 509 { 'return_type': 'GLenum',
530 'names': ['glGetError'], 510 'names': ['glGetError'],
531 'arguments': 'void', 511 'arguments': 'void',
532 'logging_code': """ 512 'logging_code': """
533 GL_SERVICE_LOG("GL_RESULT: " << GLEnums::GetStringError(result)); 513 GL_SERVICE_LOG("GL_RESULT: " << GLEnums::GetStringError(result));
534 """, }, 514 """, },
535 { 'return_type': 'void', 515 { 'return_type': 'void',
536 'names': ['glGetFenceivNV'], 516 'names': ['glGetFenceivNV'],
537 'arguments': 'GLuint fence, GLenum pname, GLint* params', }, 517 'arguments': 'GLuint fence, GLenum pname, GLint* params', },
538 { 'return_type': 'void', 518 { 'return_type': 'void',
539 'names': ['glGetFloatv'], 519 'names': ['glGetFloatv'],
540 'arguments': 'GLenum pname, GLfloat* params', }, 520 'arguments': 'GLenum pname, GLfloat* params', },
541 { 'return_type': 'GLint', 521 { 'return_type': 'GLint',
542 'versions': [{ 'name': 'glGetFragDataLocation', 522 'versions': [{ 'name': 'glGetFragDataLocation' }],
543 'gl_versions': ['gl3', 'gl4', 'es3'] }],
544 'arguments': 'GLuint program, const char* name', }, 523 'arguments': 'GLuint program, const char* name', },
545 { 'return_type': 'void', 524 { 'return_type': 'void',
546 'names': ['glGetFramebufferAttachmentParameterivEXT', 525 'names': ['glGetFramebufferAttachmentParameterivEXT',
547 'glGetFramebufferAttachmentParameteriv'], 526 'glGetFramebufferAttachmentParameteriv'],
548 'arguments': 'GLenum target, ' 527 'arguments': 'GLenum target, '
549 'GLenum attachment, GLenum pname, GLint* params', }, 528 'GLenum attachment, GLenum pname, GLint* params', },
550 { 'return_type': 'GLenum', 529 { 'return_type': 'GLenum',
551 'names': ['glGetGraphicsResetStatusARB', 530 'names': ['glGetGraphicsResetStatusARB',
552 'glGetGraphicsResetStatusKHR', 531 'glGetGraphicsResetStatusKHR',
553 'glGetGraphicsResetStatusEXT', 532 'glGetGraphicsResetStatusEXT',
554 'glGetGraphicsResetStatus'], 533 'glGetGraphicsResetStatus'],
555 'arguments': 'void', }, 534 'arguments': 'void', },
556 { 'return_type': 'void', 535 { 'return_type': 'void',
557 'versions': [{ 'name': 'glGetInteger64i_v', 536 'versions': [{ 'name': 'glGetInteger64i_v' }],
558 'gl_versions': ['gl3', 'gl4', 'es3'] }], # GL 3.2 or higher.
559 'arguments': 'GLenum target, GLuint index, GLint64* data', }, 537 'arguments': 'GLenum target, GLuint index, GLint64* data', },
560 { 'return_type': 'void', 538 { 'return_type': 'void',
561 'names': ['glGetInteger64v'], 539 'names': ['glGetInteger64v'],
562 'arguments': 'GLenum pname, GLint64* params', }, 540 'arguments': 'GLenum pname, GLint64* params', },
563 { 'return_type': 'void', 541 { 'return_type': 'void',
564 'versions': [{ 'name': 'glGetIntegeri_v', 542 'versions': [{ 'name': 'glGetIntegeri_v' }],
565 'gl_versions': ['gl3', 'gl4', 'es3'] }],
566 'arguments': 'GLenum target, GLuint index, GLint* data', }, 543 'arguments': 'GLenum target, GLuint index, GLint* data', },
567 { 'return_type': 'void', 544 { 'return_type': 'void',
568 'names': ['glGetIntegerv'], 545 'names': ['glGetIntegerv'],
569 'arguments': 'GLenum pname, GLint* params', }, 546 'arguments': 'GLenum pname, GLint* params', },
570 { 'return_type': 'void', 547 { 'return_type': 'void',
571 'versions': [{ 'name': 'glGetInternalformativ', 548 'versions': [{ 'name': 'glGetInternalformativ' }],
572 'gl_versions': ['gl4', 'es3'] }], # GL 4.2 or higher.
573 'arguments': 'GLenum target, GLenum internalformat, GLenum pname, ' 549 'arguments': 'GLenum target, GLenum internalformat, GLenum pname, '
574 'GLsizei bufSize, GLint* params', }, 550 'GLsizei bufSize, GLint* params', },
575 { 'return_type': 'void', 551 { 'return_type': 'void',
576 'known_as': 'glGetProgramBinary', 552 'known_as': 'glGetProgramBinary',
577 'versions': [{ 'name': 'glGetProgramBinaryOES' }, 553 'versions': [{ 'name': 'glGetProgramBinaryOES' },
578 { 'name': 'glGetProgramBinary', 554 { 'name': 'glGetProgramBinary',
579 'extensions': ['GL_ARB_get_program_binary'] }, 555 'extensions': ['GL_ARB_get_program_binary'] }],
580 { 'name': 'glGetProgramBinary' }],
581 'arguments': 'GLuint program, GLsizei bufSize, GLsizei* length, ' 556 'arguments': 'GLuint program, GLsizei bufSize, GLsizei* length, '
582 'GLenum* binaryFormat, GLvoid* binary' }, 557 'GLenum* binaryFormat, GLvoid* binary' },
583 { 'return_type': 'void', 558 { 'return_type': 'void',
584 'names': ['glGetProgramInfoLog'], 559 'names': ['glGetProgramInfoLog'],
585 'arguments': 560 'arguments':
586 'GLuint program, GLsizei bufsize, GLsizei* length, char* infolog', }, 561 'GLuint program, GLsizei bufsize, GLsizei* length, char* infolog', },
587 { 'return_type': 'void', 562 { 'return_type': 'void',
588 'names': ['glGetProgramiv'], 563 'names': ['glGetProgramiv'],
589 'arguments': 'GLuint program, GLenum pname, GLint* params', }, 564 'arguments': 'GLuint program, GLenum pname, GLint* params', },
590 { 'return_type': 'void', 565 { 'return_type': 'void',
591 'versions': [{ 'name': 'glGetQueryiv', 566 'versions': [{ 'name': 'glGetQueryiv' }],
592 'gl_versions': ['gl3', 'gl4', 'es3'] }],
593 'arguments': 'GLenum target, GLenum pname, GLint* params', }, 567 'arguments': 'GLenum target, GLenum pname, GLint* params', },
594 { 'return_type': 'void', 568 { 'return_type': 'void',
595 'names': ['glGetQueryivARB', 'glGetQueryivEXT'], 569 'versions': [{ 'name': 'glGetQueryivARB' },
570 { 'name': 'glGetQueryivEXT',
571 'extensions': ['GL_EXT_occlusion_query_boolean'] }],
596 'arguments': 'GLenum target, GLenum pname, GLint* params', }, 572 'arguments': 'GLenum target, GLenum pname, GLint* params', },
597 { 'return_type': 'void', 573 { 'return_type': 'void',
598 'names': ['glGetQueryObjecti64v'], 574 'versions': [{ 'name': 'glGetQueryObjecti64v',
575 'extensions': ['GL_ARB_timer_query'] },
576 { 'name': 'glGetQueryObjecti64vEXT' }],
599 'arguments': 'GLuint id, GLenum pname, GLint64* params', }, 577 'arguments': 'GLuint id, GLenum pname, GLint64* params', },
600 { 'return_type': 'void', 578 { 'return_type': 'void',
601 'versions': [{ 'name': 'glGetQueryObjectiv', 579 'names': ['glGetQueryObjectiv'],
602 'gl_versions': ['gl3', 'gl4', 'es3'] }],
603 'arguments': 'GLuint id, GLenum pname, GLint* params', }, 580 'arguments': 'GLuint id, GLenum pname, GLint* params', },
604 { 'return_type': 'void', 581 { 'return_type': 'void',
605 'names': ['glGetQueryObjectivARB', 'glGetQueryObjectivEXT'], 582 'names': ['glGetQueryObjectivARB', 'glGetQueryObjectivEXT'],
606 'arguments': 'GLuint id, GLenum pname, GLint* params', }, 583 'arguments': 'GLuint id, GLenum pname, GLint* params', },
607 { 'return_type': 'void', 584 { 'return_type': 'void',
608 'names': ['glGetQueryObjectui64v', 'glGetQueryObjectui64vEXT'], 585 'versions': [{ 'name': 'glGetQueryObjectui64v',
586 'extensions': ['GL_ARB_timer_query'] },
587 { 'name': 'glGetQueryObjectui64vEXT' }],
609 'arguments': 'GLuint id, GLenum pname, GLuint64* params', }, 588 'arguments': 'GLuint id, GLenum pname, GLuint64* params', },
610 { 'return_type': 'void', 589 { 'return_type': 'void',
611 'versions': [{ 'name': 'glGetQueryObjectuiv', 590 'versions': [{ 'name': 'glGetQueryObjectuiv' }],
612 'gl_versions': ['gl3', 'gl4', 'es3'] }],
613 'arguments': 'GLuint id, GLenum pname, GLuint* params', }, 591 'arguments': 'GLuint id, GLenum pname, GLuint* params', },
614 { 'return_type': 'void', 592 { 'return_type': 'void',
615 'names': ['glGetQueryObjectuivARB', 'glGetQueryObjectuivEXT'], 593 'versions': [{ 'name': 'glGetQueryObjectuivARB' },
594 { 'name': 'glGetQueryObjectuivEXT',
595 'extensions': ['GL_EXT_occlusion_query_boolean'] }],
616 'arguments': 'GLuint id, GLenum pname, GLuint* params', }, 596 'arguments': 'GLuint id, GLenum pname, GLuint* params', },
617 { 'return_type': 'void', 597 { 'return_type': 'void',
618 'names': ['glGetRenderbufferParameterivEXT', 'glGetRenderbufferParameteriv'], 598 'names': ['glGetRenderbufferParameterivEXT', 'glGetRenderbufferParameteriv'],
619 'arguments': 'GLenum target, GLenum pname, GLint* params', }, 599 'arguments': 'GLenum target, GLenum pname, GLint* params', },
620 { 'return_type': 'void', 600 { 'return_type': 'void',
621 'versions': [{ 'name': 'glGetSamplerParameterfv', 601 'versions': [{ 'name': 'glGetSamplerParameterfv' }],
622 'gl_versions': ['gl3', 'gl4', 'es3'] }], # GL 3.2 or higher.
623 'arguments': 'GLuint sampler, GLenum pname, GLfloat* params', }, 602 'arguments': 'GLuint sampler, GLenum pname, GLfloat* params', },
624 { 'return_type': 'void', 603 { 'return_type': 'void',
625 'versions': [{ 'name': 'glGetSamplerParameteriv', 604 'versions': [{ 'name': 'glGetSamplerParameteriv' }],
626 'gl_versions': ['gl3', 'gl4', 'es3'] }], # GL 3.2 or higher.
627 'arguments': 'GLuint sampler, GLenum pname, GLint* params', }, 605 'arguments': 'GLuint sampler, GLenum pname, GLint* params', },
628 { 'return_type': 'void', 606 { 'return_type': 'void',
629 'names': ['glGetShaderInfoLog'], 607 'names': ['glGetShaderInfoLog'],
630 'arguments': 608 'arguments':
631 'GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog', }, 609 'GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog', },
632 { 'return_type': 'void', 610 { 'return_type': 'void',
633 'names': ['glGetShaderiv'], 611 'names': ['glGetShaderiv'],
634 'arguments': 'GLuint shader, GLenum pname, GLint* params', }, 612 'arguments': 'GLuint shader, GLenum pname, GLint* params', },
635 { 'return_type': 'void', 613 { 'return_type': 'void',
636 'names': ['glGetShaderPrecisionFormat'], 614 'names': ['glGetShaderPrecisionFormat'],
637 'arguments': 'GLenum shadertype, GLenum precisiontype, ' 615 'arguments': 'GLenum shadertype, GLenum precisiontype, '
638 'GLint* range, GLint* precision', }, 616 'GLint* range, GLint* precision', },
639 { 'return_type': 'void', 617 { 'return_type': 'void',
640 'names': ['glGetShaderSource'], 618 'names': ['glGetShaderSource'],
641 'arguments': 619 'arguments':
642 'GLuint shader, GLsizei bufsize, GLsizei* length, char* source', }, 620 'GLuint shader, GLsizei bufsize, GLsizei* length, char* source', },
643 { 'return_type': 'const GLubyte*', 621 { 'return_type': 'const GLubyte*',
644 'names': ['glGetString'], 622 'names': ['glGetString'],
645 'arguments': 'GLenum name', }, 623 'arguments': 'GLenum name', },
646 { 'return_type': 'void', 624 { 'return_type': 'void',
647 'names': ['glGetSynciv'], 625 'versions': [{ 'name': 'glGetSynciv',
626 'extensions': ['GL_ARB_sync'] }],
648 'arguments': 627 'arguments':
649 'GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length,' 628 'GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length,'
650 'GLint* values', }, 629 'GLint* values', },
651 { 'return_type': 'void', 630 { 'return_type': 'void',
652 'names': ['glGetTexLevelParameterfv'], 631 'names': ['glGetTexLevelParameterfv'],
653 'arguments': 'GLenum target, GLint level, GLenum pname, GLfloat* params', }, 632 'arguments': 'GLenum target, GLint level, GLenum pname, GLfloat* params', },
654 { 'return_type': 'void', 633 { 'return_type': 'void',
655 'names': ['glGetTexLevelParameteriv'], 634 'names': ['glGetTexLevelParameteriv'],
656 'arguments': 'GLenum target, GLint level, GLenum pname, GLint* params', }, 635 'arguments': 'GLenum target, GLint level, GLenum pname, GLint* params', },
657 { 'return_type': 'void', 636 { 'return_type': 'void',
658 'names': ['glGetTexParameterfv'], 637 'names': ['glGetTexParameterfv'],
659 'arguments': 'GLenum target, GLenum pname, GLfloat* params', }, 638 'arguments': 'GLenum target, GLenum pname, GLfloat* params', },
660 { 'return_type': 'void', 639 { 'return_type': 'void',
661 'names': ['glGetTexParameteriv'], 640 'names': ['glGetTexParameteriv'],
662 'arguments': 'GLenum target, GLenum pname, GLint* params', }, 641 'arguments': 'GLenum target, GLenum pname, GLint* params', },
663 { 'return_type': 'void', 642 { 'return_type': 'void',
664 'versions': [{ 'name': 'glGetTransformFeedbackVarying', 643 'versions': [{ 'name': 'glGetTransformFeedbackVarying' }],
665 'gl_versions': ['gl3', 'gl4', 'es3'] }],
666 'arguments': 'GLuint program, GLuint index, GLsizei bufSize, ' 644 'arguments': 'GLuint program, GLuint index, GLsizei bufSize, '
667 'GLsizei* length, GLenum* type, char* name', }, 645 'GLsizei* length, GLenum* type, char* name', },
668 { 'return_type': 'void', 646 { 'return_type': 'void',
669 'names': ['glGetTranslatedShaderSourceANGLE'], 647 'names': ['glGetTranslatedShaderSourceANGLE'],
670 'arguments': 648 'arguments':
671 'GLuint shader, GLsizei bufsize, GLsizei* length, char* source', }, 649 'GLuint shader, GLsizei bufsize, GLsizei* length, char* source', },
672 { 'return_type': 'GLuint', 650 { 'return_type': 'GLuint',
673 'versions': [{ 'name': 'glGetUniformBlockIndex', 651 'versions': [{ 'name': 'glGetUniformBlockIndex' }],
674 'gl_versions': ['gl3', 'gl4', 'es3'] }], # GL 3.1 or higher.
675 'arguments': 'GLuint program, const char* uniformBlockName', }, 652 'arguments': 'GLuint program, const char* uniformBlockName', },
676 { 'return_type': 'void', 653 { 'return_type': 'void',
677 'names': ['glGetUniformfv'], 654 'names': ['glGetUniformfv'],
678 'arguments': 'GLuint program, GLint location, GLfloat* params', }, 655 'arguments': 'GLuint program, GLint location, GLfloat* params', },
679 { 'return_type': 'void', 656 { 'return_type': 'void',
680 'versions': [{ 'name': 'glGetUniformIndices', 657 'versions': [{ 'name': 'glGetUniformIndices' }],
681 'gl_versions': ['gl3', 'gl4', 'es3'] }], # GL 3.1 or higher.
682 'arguments': 'GLuint program, GLsizei uniformCount, ' 658 'arguments': 'GLuint program, GLsizei uniformCount, '
683 'const char* const* uniformNames, GLuint* uniformIndices', }, 659 'const char* const* uniformNames, GLuint* uniformIndices', },
684 { 'return_type': 'void', 660 { 'return_type': 'void',
685 'names': ['glGetUniformiv'], 661 'names': ['glGetUniformiv'],
686 'arguments': 'GLuint program, GLint location, GLint* params', }, 662 'arguments': 'GLuint program, GLint location, GLint* params', },
687 { 'return_type': 'GLint', 663 { 'return_type': 'GLint',
688 'names': ['glGetUniformLocation'], 664 'names': ['glGetUniformLocation'],
689 'arguments': 'GLuint program, const char* name', }, 665 'arguments': 'GLuint program, const char* name', },
690 { 'return_type': 'void', 666 { 'return_type': 'void',
691 'names': ['glGetVertexAttribfv'], 667 'names': ['glGetVertexAttribfv'],
692 'arguments': 'GLuint index, GLenum pname, GLfloat* params', }, 668 'arguments': 'GLuint index, GLenum pname, GLfloat* params', },
693 { 'return_type': 'void', 669 { 'return_type': 'void',
694 'names': ['glGetVertexAttribiv'], 670 'names': ['glGetVertexAttribiv'],
695 'arguments': 'GLuint index, GLenum pname, GLint* params', }, 671 'arguments': 'GLuint index, GLenum pname, GLint* params', },
696 { 'return_type': 'void', 672 { 'return_type': 'void',
697 'names': ['glGetVertexAttribPointerv'], 673 'names': ['glGetVertexAttribPointerv'],
698 'arguments': 'GLuint index, GLenum pname, void** pointer', }, 674 'arguments': 'GLuint index, GLenum pname, void** pointer', },
699 { 'return_type': 'void', 675 { 'return_type': 'void',
700 'names': ['glHint'], 676 'names': ['glHint'],
701 'arguments': 'GLenum target, GLenum mode', }, 677 'arguments': 'GLenum target, GLenum mode', },
702 { 'return_type': 'void', 678 { 'return_type': 'void',
703 'names': ['glInsertEventMarkerEXT'], 679 'names': ['glInsertEventMarkerEXT'],
704 'arguments': 'GLsizei length, const char* marker', }, 680 'arguments': 'GLsizei length, const char* marker', },
705 { 'return_type': 'void', 681 { 'return_type': 'void',
706 'versions': [{ 'name': 'glInvalidateFramebuffer', 682 'versions': [{ 'name': 'glInvalidateFramebuffer' }],
707 'gl_versions': ['gl4', 'es3'] }], # GL 4.3 or higher.
708 'arguments': 'GLenum target, GLsizei numAttachments, ' 683 'arguments': 'GLenum target, GLsizei numAttachments, '
709 'const GLenum* attachments' }, 684 'const GLenum* attachments' },
710 { 'return_type': 'void', 685 { 'return_type': 'void',
711 'versions': [{ 'name': 'glInvalidateSubFramebuffer', 686 'versions': [{ 'name': 'glInvalidateSubFramebuffer' }],
712 'gl_versions': ['gl4', 'es3'] }], # GL 4.3 or higher.
713 'arguments': 687 'arguments':
714 'GLenum target, GLsizei numAttachments, const GLenum* attachments, ' 688 'GLenum target, GLsizei numAttachments, const GLenum* attachments, '
715 'GLint x, GLint y, GLint width, GLint height', }, 689 'GLint x, GLint y, GLint width, GLint height', },
716 { 'return_type': 'GLboolean', 690 { 'return_type': 'GLboolean',
717 'names': ['glIsBuffer'], 691 'names': ['glIsBuffer'],
718 'arguments': 'GLuint buffer', }, 692 'arguments': 'GLuint buffer', },
719 { 'return_type': 'GLboolean', 693 { 'return_type': 'GLboolean',
720 'names': ['glIsEnabled'], 694 'names': ['glIsEnabled'],
721 'arguments': 'GLenum cap', }, 695 'arguments': 'GLenum cap', },
722 { 'return_type': 'GLboolean', 696 { 'return_type': 'GLboolean',
723 'known_as': 'glIsFenceAPPLE', 697 'known_as': 'glIsFenceAPPLE',
724 'versions': [{ 'name': 'glIsFenceAPPLE', 698 'versions': [{ 'name': 'glIsFenceAPPLE',
725 'extensions': ['GL_APPLE_fence'] }], 699 'extensions': ['GL_APPLE_fence'] }],
726 'arguments': 'GLuint fence', }, 700 'arguments': 'GLuint fence', },
727 { 'return_type': 'GLboolean', 701 { 'return_type': 'GLboolean',
728 'names': ['glIsFenceNV'], 702 'names': ['glIsFenceNV'],
729 'arguments': 'GLuint fence', }, 703 'arguments': 'GLuint fence', },
730 { 'return_type': 'GLboolean', 704 { 'return_type': 'GLboolean',
731 'names': ['glIsFramebufferEXT', 'glIsFramebuffer'], 705 'names': ['glIsFramebufferEXT', 'glIsFramebuffer'],
732 'arguments': 'GLuint framebuffer', }, 706 'arguments': 'GLuint framebuffer', },
733 { 'return_type': 'GLboolean', 707 { 'return_type': 'GLboolean',
734 'names': ['glIsProgram'], 708 'names': ['glIsProgram'],
735 'arguments': 'GLuint program', }, 709 'arguments': 'GLuint program', },
736 { 'return_type': 'GLboolean', 710 { 'return_type': 'GLboolean',
737 'versions': [{ 'name': 'glIsQuery', 711 'versions': [{ 'name': 'glIsQuery' }],
738 'gl_versions': ['gl3', 'gl4', 'es3'] }],
739 'arguments': 'GLuint query', }, 712 'arguments': 'GLuint query', },
740 { 'return_type': 'GLboolean', 713 { 'return_type': 'GLboolean',
741 'names': ['glIsQueryARB', 'glIsQueryEXT'], 714 'versions': [{ 'name': 'glIsQueryARB' },
715 { 'name': 'glIsQueryEXT',
716 'extensions': ['GL_EXT_occlusion_query_boolean'] }],
742 'arguments': 'GLuint query', }, 717 'arguments': 'GLuint query', },
743 { 'return_type': 'GLboolean', 718 { 'return_type': 'GLboolean',
744 'names': ['glIsRenderbufferEXT', 'glIsRenderbuffer'], 719 'names': ['glIsRenderbufferEXT', 'glIsRenderbuffer'],
745 'arguments': 'GLuint renderbuffer', }, 720 'arguments': 'GLuint renderbuffer', },
746 { 'return_type': 'GLboolean', 721 { 'return_type': 'GLboolean',
747 'versions': [{ 'name': 'glIsSampler', 722 'versions': [{ 'name': 'glIsSampler' }],
748 'gl_versions': ['gl3', 'gl4', 'es3'] }], # GL 3.2 or higher.
749 'arguments': 'GLuint sampler', }, 723 'arguments': 'GLuint sampler', },
750 { 'return_type': 'GLboolean', 724 { 'return_type': 'GLboolean',
751 'names': ['glIsShader'], 725 'names': ['glIsShader'],
752 'arguments': 'GLuint shader', }, 726 'arguments': 'GLuint shader', },
753 { 'return_type': 'GLboolean', 727 { 'return_type': 'GLboolean',
754 'names': ['glIsSync'], 728 'versions': [{ 'name': 'glIsSync',
729 'extensions': ['GL_ARB_sync'] }],
755 'arguments': 'GLsync sync', }, 730 'arguments': 'GLsync sync', },
756 { 'return_type': 'GLboolean', 731 { 'return_type': 'GLboolean',
757 'names': ['glIsTexture'], 732 'names': ['glIsTexture'],
758 'arguments': 'GLuint texture', }, 733 'arguments': 'GLuint texture', },
759 { 'return_type': 'GLboolean', 734 { 'return_type': 'GLboolean',
760 'versions': [{ 'name': 'glIsTransformFeedback', 735 'versions': [{ 'name': 'glIsTransformFeedback' }],
761 'gl_versions': ['gl4', 'es3'] }],
762 'arguments': 'GLuint id', }, 736 'arguments': 'GLuint id', },
763 { 'return_type': 'GLboolean', 737 { 'return_type': 'GLboolean',
764 'known_as': 'glIsVertexArrayOES', 738 'known_as': 'glIsVertexArrayOES',
765 'versions': [{ 'name': 'glIsVertexArray', 739 'versions': [{ 'name': 'glIsVertexArray',
766 'gl_versions': ['gl3', 'gl4', 'es3'] }, 740 'extensions': ['GL_ARB_vertex_array_object'], },
767 { 'name': 'glIsVertexArray',
768 'extensions': ['GL_ARB_vertex_array_object'] },
769 { 'name': 'glIsVertexArrayOES' }, 741 { 'name': 'glIsVertexArrayOES' },
770 { 'name': 'glIsVertexArrayAPPLE', 742 { 'name': 'glIsVertexArrayAPPLE',
771 'extensions': ['GL_APPLE_vertex_array_object'] }], 743 'extensions': ['GL_APPLE_vertex_array_object'] }],
772 'arguments': 'GLuint array' }, 744 'arguments': 'GLuint array' },
773 { 'return_type': 'void', 745 { 'return_type': 'void',
774 'names': ['glLineWidth'], 746 'names': ['glLineWidth'],
775 'arguments': 'GLfloat width', }, 747 'arguments': 'GLfloat width', },
776 { 'return_type': 'void', 748 { 'return_type': 'void',
777 'names': ['glLinkProgram'], 749 'names': ['glLinkProgram'],
778 'arguments': 'GLuint program', }, 750 'arguments': 'GLuint program', },
779 { 'return_type': 'void*', 751 { 'return_type': 'void*',
780 'known_as': 'glMapBuffer', 752 'known_as': 'glMapBuffer',
781 'names': ['glMapBufferOES', 'glMapBuffer'], 753 'names': ['glMapBufferOES', 'glMapBuffer'],
782 'arguments': 'GLenum target, GLenum access', }, 754 'arguments': 'GLenum target, GLenum access', },
783 { 'return_type': 'void*', 755 { 'return_type': 'void*',
784 'known_as': 'glMapBufferRange', 756 'known_as': 'glMapBufferRange',
785 'versions': [{ 'name': 'glMapBufferRange', 757 'versions': [{ 'name': 'glMapBufferRange',
786 'gl_versions': ['gl3', 'gl4', 'es3'] },
787 { 'name': 'glMapBufferRange',
788 'extensions': ['GL_ARB_map_buffer_range'] }, 758 'extensions': ['GL_ARB_map_buffer_range'] },
789 { 'name': 'glMapBufferRangeEXT', 759 { 'name': 'glMapBufferRangeEXT',
790 'extensions': ['GL_EXT_map_buffer_range'] }], 760 'extensions': ['GL_EXT_map_buffer_range'] }],
791 'arguments': 761 'arguments':
792 'GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access', }, 762 'GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access', },
793 { 'return_type': 'void', 763 { 'return_type': 'void',
794 'known_as': 'glMatrixLoadfEXT', 764 'known_as': 'glMatrixLoadfEXT',
795 'versions': [{ 'name': 'glMatrixLoadfEXT', 765 'versions': [{ 'name': 'glMatrixLoadfEXT',
796 'gl_versions': ['gl4'], 766 'extensions': ['GL_EXT_direct_state_access',
797 'extensions': ['GL_EXT_direct_state_access'] }, 767 'GL_NV_path_rendering'] }],
798 { 'name': 'glMatrixLoadfEXT',
799 'gl_versions': ['es3'],
800 'extensions': ['GL_NV_path_rendering'] }],
801 'arguments': 'GLenum matrixMode, const GLfloat* m' }, 768 'arguments': 'GLenum matrixMode, const GLfloat* m' },
802 { 'return_type': 'void', 769 { 'return_type': 'void',
803 'known_as': 'glMatrixLoadIdentityEXT', 770 'known_as': 'glMatrixLoadIdentityEXT',
804 'versions': [{ 'name': 'glMatrixLoadIdentityEXT', 771 'versions': [{ 'name': 'glMatrixLoadIdentityEXT',
805 'gl_versions': ['gl4'], 772 'extensions': ['GL_EXT_direct_state_access',
806 'extensions': ['GL_EXT_direct_state_access'] }, 773 'GL_NV_path_rendering'] },],
807 { 'name': 'glMatrixLoadIdentityEXT',
808 'gl_versions': ['es3'],
809 'extensions': ['GL_NV_path_rendering'] }],
810 'arguments': 'GLenum matrixMode' }, 774 'arguments': 'GLenum matrixMode' },
811 { 'return_type': 'void', 775 { 'return_type': 'void',
812 'versions': [{ 'name': 'glPauseTransformFeedback', 776 'versions': [{ 'name': 'glPauseTransformFeedback' }],
813 'gl_versions': ['gl4', 'es3'] }],
814 'arguments': 'void', }, 777 'arguments': 'void', },
815 { 'return_type': 'void', 778 { 'return_type': 'void',
816 'names': ['glPixelStorei'], 779 'names': ['glPixelStorei'],
817 'arguments': 'GLenum pname, GLint param', }, 780 'arguments': 'GLenum pname, GLint param', },
818 { 'return_type': 'void', 781 { 'return_type': 'void',
819 'names': ['glPointParameteri'], 782 'names': ['glPointParameteri'],
820 'arguments': 'GLenum pname, GLint param', }, 783 'arguments': 'GLenum pname, GLint param', },
821 { 'return_type': 'void', 784 { 'return_type': 'void',
822 'names': ['glPolygonOffset'], 785 'names': ['glPolygonOffset'],
823 'arguments': 'GLfloat factor, GLfloat units', }, 786 'arguments': 'GLfloat factor, GLfloat units', },
824 { 'return_type': 'void', 787 { 'return_type': 'void',
825 'names': ['glPopGroupMarkerEXT'], 788 'names': ['glPopGroupMarkerEXT'],
826 'arguments': 'void', }, 789 'arguments': 'void', },
827 { 'return_type': 'void', 790 { 'return_type': 'void',
828 'known_as': 'glProgramBinary', 791 'known_as': 'glProgramBinary',
829 'versions': [{ 'name': 'glProgramBinaryOES' }, 792 'versions': [{ 'name': 'glProgramBinaryOES' },
830 { 'name': 'glProgramBinary', 793 { 'name': 'glProgramBinary',
831 'extensions': ['GL_ARB_get_program_binary'] }, 794 'extensions': ['GL_ARB_get_program_binary'] }],
832 { 'name': 'glProgramBinary' }],
833 'arguments': 'GLuint program, GLenum binaryFormat, ' 795 'arguments': 'GLuint program, GLenum binaryFormat, '
834 'const GLvoid* binary, GLsizei length' }, 796 'const GLvoid* binary, GLsizei length' },
835 { 'return_type': 'void', 797 { 'return_type': 'void',
836 'versions': [{ 'name': 'glProgramParameteri', 798 'versions': [{ 'name': 'glProgramParameteri',
837 'extensions': ['GL_ARB_get_program_binary'] }, 799 'extensions': ['GL_ARB_get_program_binary'] }],
838 { 'name': 'glProgramParameteri' }],
839 'arguments': 'GLuint program, GLenum pname, GLint value' }, 800 'arguments': 'GLuint program, GLenum pname, GLint value' },
840 { 'return_type': 'void', 801 { 'return_type': 'void',
841 'names': ['glPushGroupMarkerEXT'], 802 'names': ['glPushGroupMarkerEXT'],
842 'arguments': 'GLsizei length, const char* marker', }, 803 'arguments': 'GLsizei length, const char* marker', },
843 { 'return_type': 'void', 804 { 'return_type': 'void',
844 'names': ['glQueryCounter', 'glQueryCounterEXT'], 805 'versions': [{ 'name': 'glQueryCounter',
806 'extensions': ['GL_ARB_timer_query'] },
807 { 'name': 'glQueryCounterEXT' }],
845 'arguments': 'GLuint id, GLenum target', }, 808 'arguments': 'GLuint id, GLenum target', },
846 { 'return_type': 'void', 809 { 'return_type': 'void',
847 'names': ['glReadBuffer'], 810 'names': ['glReadBuffer'],
848 'arguments': 'GLenum src', }, 811 'arguments': 'GLenum src', },
849 { 'return_type': 'void', 812 { 'return_type': 'void',
850 'names': ['glReadPixels'], 813 'names': ['glReadPixels'],
851 'arguments': 814 'arguments':
852 'GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, ' 815 'GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, '
853 'GLenum type, void* pixels', }, 816 'GLenum type, void* pixels', },
854 { 'return_type': 'void', 817 { 'return_type': 'void',
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 { 'return_type': 'void', 850 { 'return_type': 'void',
888 'names': ['glRenderbufferStorageMultisampleEXT', 851 'names': ['glRenderbufferStorageMultisampleEXT',
889 'glRenderbufferStorageMultisample'], 852 'glRenderbufferStorageMultisample'],
890 'arguments': 'GLenum target, GLsizei samples, GLenum internalformat, ' 853 'arguments': 'GLenum target, GLsizei samples, GLenum internalformat, '
891 'GLsizei width, GLsizei height', }, 854 'GLsizei width, GLsizei height', },
892 { 'return_type': 'void', 855 { 'return_type': 'void',
893 'names': ['glRenderbufferStorageMultisampleIMG'], 856 'names': ['glRenderbufferStorageMultisampleIMG'],
894 'arguments': 'GLenum target, GLsizei samples, GLenum internalformat, ' 857 'arguments': 'GLenum target, GLsizei samples, GLenum internalformat, '
895 'GLsizei width, GLsizei height', }, 858 'GLsizei width, GLsizei height', },
896 { 'return_type': 'void', 859 { 'return_type': 'void',
897 'versions': [{ 'name': 'glResumeTransformFeedback', 860 'versions': [{ 'name': 'glResumeTransformFeedback' }],
898 'gl_versions': ['gl4', 'es3'] }],
899 'arguments': 'void', }, 861 'arguments': 'void', },
900 { 'return_type': 'void', 862 { 'return_type': 'void',
901 'names': ['glSampleCoverage'], 863 'names': ['glSampleCoverage'],
902 'arguments': 'GLclampf value, GLboolean invert', }, 864 'arguments': 'GLclampf value, GLboolean invert', },
903 { 'return_type': 'void', 865 { 'return_type': 'void',
904 'versions': [{ 'name': 'glSamplerParameterf', 866 'versions': [{ 'name': 'glSamplerParameterf' }],
905 'gl_versions': ['gl3', 'gl4', 'es3'] }], # GL 3.2 or higher.
906 'arguments': 'GLuint sampler, GLenum pname, GLfloat param', }, 867 'arguments': 'GLuint sampler, GLenum pname, GLfloat param', },
907 { 'return_type': 'void', 868 { 'return_type': 'void',
908 'versions': [{ 'name': 'glSamplerParameterfv', 869 'versions': [{ 'name': 'glSamplerParameterfv' }],
909 'gl_versions': ['gl3', 'gl4', 'es3'] }], # GL 3.2 or higher.
910 'arguments': 'GLuint sampler, GLenum pname, const GLfloat* params', }, 870 'arguments': 'GLuint sampler, GLenum pname, const GLfloat* params', },
911 { 'return_type': 'void', 871 { 'return_type': 'void',
912 'versions': [{ 'name': 'glSamplerParameteri', 872 'versions': [{ 'name': 'glSamplerParameteri' }],
913 'gl_versions': ['gl3', 'gl4', 'es3'] }], # GL 3.2 or higher.
914 'arguments': 'GLuint sampler, GLenum pname, GLint param', }, 873 'arguments': 'GLuint sampler, GLenum pname, GLint param', },
915 { 'return_type': 'void', 874 { 'return_type': 'void',
916 'versions': [{ 'name': 'glSamplerParameteriv', 875 'versions': [{ 'name': 'glSamplerParameteriv' }],
917 'gl_versions': ['gl3', 'gl4', 'es3'] }], # GL 3.2 or higher.
918 'arguments': 'GLuint sampler, GLenum pname, const GLint* params', }, 876 'arguments': 'GLuint sampler, GLenum pname, const GLint* params', },
919 { 'return_type': 'void', 877 { 'return_type': 'void',
920 'names': ['glScissor'], 878 'names': ['glScissor'],
921 'arguments': 'GLint x, GLint y, GLsizei width, GLsizei height', }, 879 'arguments': 'GLint x, GLint y, GLsizei width, GLsizei height', },
922 { 'return_type': 'void', 880 { 'return_type': 'void',
923 'known_as': 'glSetFenceAPPLE', 881 'known_as': 'glSetFenceAPPLE',
924 'versions': [{ 'name': 'glSetFenceAPPLE', 882 'versions': [{ 'name': 'glSetFenceAPPLE',
925 'extensions': ['GL_APPLE_fence'] }], 883 'extensions': ['GL_APPLE_fence'] }],
926 'arguments': 'GLuint fence', }, 884 'arguments': 'GLuint fence', },
927 { 'return_type': 'void', 885 { 'return_type': 'void',
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 { 'return_type': 'GLboolean', 935 { 'return_type': 'GLboolean',
978 'names': ['glTestFenceNV'], 936 'names': ['glTestFenceNV'],
979 'arguments': 'GLuint fence', }, 937 'arguments': 'GLuint fence', },
980 { 'return_type': 'void', 938 { 'return_type': 'void',
981 'names': ['glTexImage2D'], 939 'names': ['glTexImage2D'],
982 'arguments': 940 'arguments':
983 'GLenum target, GLint level, GLint internalformat, GLsizei width, ' 941 'GLenum target, GLint level, GLint internalformat, GLsizei width, '
984 'GLsizei height, GLint border, GLenum format, GLenum type, ' 942 'GLsizei height, GLint border, GLenum format, GLenum type, '
985 'const void* pixels', }, 943 'const void* pixels', },
986 { 'return_type': 'void', 944 { 'return_type': 'void',
987 'versions': [{ 'name': 'glTexImage3D', 945 'versions': [{ 'name': 'glTexImage3D' }],
988 'gl_versions': ['gl3', 'gl4', 'es3'] }],
989 'arguments': 946 'arguments':
990 'GLenum target, GLint level, GLint internalformat, GLsizei width, ' 947 'GLenum target, GLint level, GLint internalformat, GLsizei width, '
991 'GLsizei height, GLsizei depth, GLint border, GLenum format, ' 948 'GLsizei height, GLsizei depth, GLint border, GLenum format, '
992 'GLenum type, const void* pixels', }, 949 'GLenum type, const void* pixels', },
993 { 'return_type': 'void', 950 { 'return_type': 'void',
994 'names': ['glTexParameterf'], 951 'names': ['glTexParameterf'],
995 'arguments': 'GLenum target, GLenum pname, GLfloat param', }, 952 'arguments': 'GLenum target, GLenum pname, GLfloat param', },
996 { 'return_type': 'void', 953 { 'return_type': 'void',
997 'names': ['glTexParameterfv'], 954 'names': ['glTexParameterfv'],
998 'arguments': 'GLenum target, GLenum pname, const GLfloat* params', }, 955 'arguments': 'GLenum target, GLenum pname, const GLfloat* params', },
999 { 'return_type': 'void', 956 { 'return_type': 'void',
1000 'names': ['glTexParameteri'], 957 'names': ['glTexParameteri'],
1001 'arguments': 'GLenum target, GLenum pname, GLint param', }, 958 'arguments': 'GLenum target, GLenum pname, GLint param', },
1002 { 'return_type': 'void', 959 { 'return_type': 'void',
1003 'names': ['glTexParameteriv'], 960 'names': ['glTexParameteriv'],
1004 'arguments': 'GLenum target, GLenum pname, const GLint* params', }, 961 'arguments': 'GLenum target, GLenum pname, const GLint* params', },
1005 { 'return_type': 'void', 962 { 'return_type': 'void',
1006 'known_as': 'glTexStorage2DEXT', 963 'known_as': 'glTexStorage2DEXT',
1007 'versions': [{ 'name': 'glTexStorage2D', 964 'versions': [{ 'name': 'glTexStorage2D',
1008 'gl_versions': ['es3'] },
1009 { 'name': 'glTexStorage2D',
1010 'extensions': ['GL_ARB_texture_storage'] }, 965 'extensions': ['GL_ARB_texture_storage'] },
1011 { 'name': 'glTexStorage2DEXT', 966 { 'name': 'glTexStorage2DEXT',
1012 'extensions': ['GL_EXT_texture_storage'] }], 967 'extensions': ['GL_EXT_texture_storage'] }],
1013 'arguments': 'GLenum target, GLsizei levels, GLenum internalformat, ' 968 'arguments': 'GLenum target, GLsizei levels, GLenum internalformat, '
1014 'GLsizei width, GLsizei height', }, 969 'GLsizei width, GLsizei height', },
1015 { 'return_type': 'void', 970 { 'return_type': 'void',
1016 'versions': [{ 'name': 'glTexStorage3D', 971 'versions': [{ 'name': 'glTexStorage3D' }],
1017 'gl_versions': ['gl4', 'es3'] }], # GL 4.2 or higher.
1018 'arguments': 'GLenum target, GLsizei levels, GLenum internalformat, ' 972 'arguments': 'GLenum target, GLsizei levels, GLenum internalformat, '
1019 'GLsizei width, GLsizei height, GLsizei depth', }, 973 'GLsizei width, GLsizei height, GLsizei depth', },
1020 { 'return_type': 'void', 974 { 'return_type': 'void',
1021 'names': ['glTexSubImage2D'], 975 'names': ['glTexSubImage2D'],
1022 'arguments': 976 'arguments':
1023 'GLenum target, GLint level, GLint xoffset, GLint yoffset, ' 977 'GLenum target, GLint level, GLint xoffset, GLint yoffset, '
1024 'GLsizei width, GLsizei height, GLenum format, GLenum type, ' 978 'GLsizei width, GLsizei height, GLenum format, GLenum type, '
1025 'const void* pixels', }, 979 'const void* pixels', },
1026 # TODO(zmo): wait for MOCK_METHOD11. 980 # TODO(zmo): wait for MOCK_METHOD11.
1027 # { 'return_type': 'void', 981 # { 'return_type': 'void',
1028 # 'versions': [{ 'name': 'glTexSubImage3D', 982 # 'versions': [{ 'name': 'glTexSubImage3D' }],
1029 # 'gl_versions': ['gl3', 'gl4', 'es3'] }],
1030 # 'arguments': 983 # 'arguments':
1031 # 'GLenum target, GLint level, GLint xoffset, GLint yoffset, ' 984 # 'GLenum target, GLint level, GLint xoffset, GLint yoffset, '
1032 # 'GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, ' 985 # 'GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, '
1033 # 'GLenum format, GLenum type, const void* pixels', }, 986 # 'GLenum format, GLenum type, const void* pixels', },
1034 { 'return_type': 'void', 987 { 'return_type': 'void',
1035 'versions': [{ 'name': 'glTransformFeedbackVaryings', 988 'versions': [{ 'name': 'glTransformFeedbackVaryings' }],
1036 'gl_versions': ['gl3', 'gl4', 'es3'] }],
1037 'arguments': 'GLuint program, GLsizei count, const char* const* varyings, ' 989 'arguments': 'GLuint program, GLsizei count, const char* const* varyings, '
1038 'GLenum bufferMode', }, 990 'GLenum bufferMode', },
1039 { 'return_type': 'void', 991 { 'return_type': 'void',
1040 'names': ['glUniform1f'], 992 'names': ['glUniform1f'],
1041 'arguments': 'GLint location, GLfloat x', }, 993 'arguments': 'GLint location, GLfloat x', },
1042 { 'return_type': 'void', 994 { 'return_type': 'void',
1043 'names': ['glUniform1fv'], 995 'names': ['glUniform1fv'],
1044 'arguments': 'GLint location, GLsizei count, const GLfloat* v', }, 996 'arguments': 'GLint location, GLsizei count, const GLfloat* v', },
1045 { 'return_type': 'void', 997 { 'return_type': 'void',
1046 'names': ['glUniform1i'], 998 'names': ['glUniform1i'],
1047 'arguments': 'GLint location, GLint x', }, 999 'arguments': 'GLint location, GLint x', },
1048 { 'return_type': 'void', 1000 { 'return_type': 'void',
1049 'names': ['glUniform1iv'], 1001 'names': ['glUniform1iv'],
1050 'arguments': 'GLint location, GLsizei count, const GLint* v', }, 1002 'arguments': 'GLint location, GLsizei count, const GLint* v', },
1051 { 'return_type': 'void', 1003 { 'return_type': 'void',
1052 'versions': [{ 'name': 'glUniform1ui', 1004 'versions': [{ 'name': 'glUniform1ui' }],
1053 'gl_versions': ['gl3', 'gl4', 'es3'] }],
1054 'arguments': 'GLint location, GLuint v0', }, 1005 'arguments': 'GLint location, GLuint v0', },
1055 { 'return_type': 'void', 1006 { 'return_type': 'void',
1056 'versions': [{ 'name': 'glUniform1uiv', 1007 'versions': [{ 'name': 'glUniform1uiv' }],
1057 'gl_versions': ['gl3', 'gl4', 'es3'] }],
1058 'arguments': 'GLint location, GLsizei count, const GLuint* v', }, 1008 'arguments': 'GLint location, GLsizei count, const GLuint* v', },
1059 { 'return_type': 'void', 1009 { 'return_type': 'void',
1060 'names': ['glUniform2f'], 1010 'names': ['glUniform2f'],
1061 'arguments': 'GLint location, GLfloat x, GLfloat y', }, 1011 'arguments': 'GLint location, GLfloat x, GLfloat y', },
1062 { 'return_type': 'void', 1012 { 'return_type': 'void',
1063 'names': ['glUniform2fv'], 1013 'names': ['glUniform2fv'],
1064 'arguments': 'GLint location, GLsizei count, const GLfloat* v', }, 1014 'arguments': 'GLint location, GLsizei count, const GLfloat* v', },
1065 { 'return_type': 'void', 1015 { 'return_type': 'void',
1066 'names': ['glUniform2i'], 1016 'names': ['glUniform2i'],
1067 'arguments': 'GLint location, GLint x, GLint y', }, 1017 'arguments': 'GLint location, GLint x, GLint y', },
1068 { 'return_type': 'void', 1018 { 'return_type': 'void',
1069 'names': ['glUniform2iv'], 1019 'names': ['glUniform2iv'],
1070 'arguments': 'GLint location, GLsizei count, const GLint* v', }, 1020 'arguments': 'GLint location, GLsizei count, const GLint* v', },
1071 { 'return_type': 'void', 1021 { 'return_type': 'void',
1072 'versions': [{ 'name': 'glUniform2ui', 1022 'versions': [{ 'name': 'glUniform2ui' }],
1073 'gl_versions': ['gl3', 'gl4', 'es3'] }],
1074 'arguments': 'GLint location, GLuint v0, GLuint v1', }, 1023 'arguments': 'GLint location, GLuint v0, GLuint v1', },
1075 { 'return_type': 'void', 1024 { 'return_type': 'void',
1076 'versions': [{ 'name': 'glUniform2uiv', 1025 'versions': [{ 'name': 'glUniform2uiv' }],
1077 'gl_versions': ['gl3', 'gl4', 'es3'] }],
1078 'arguments': 'GLint location, GLsizei count, const GLuint* v', }, 1026 'arguments': 'GLint location, GLsizei count, const GLuint* v', },
1079 { 'return_type': 'void', 1027 { 'return_type': 'void',
1080 'names': ['glUniform3f'], 1028 'names': ['glUniform3f'],
1081 'arguments': 'GLint location, GLfloat x, GLfloat y, GLfloat z', }, 1029 'arguments': 'GLint location, GLfloat x, GLfloat y, GLfloat z', },
1082 { 'return_type': 'void', 1030 { 'return_type': 'void',
1083 'names': ['glUniform3fv'], 1031 'names': ['glUniform3fv'],
1084 'arguments': 'GLint location, GLsizei count, const GLfloat* v', }, 1032 'arguments': 'GLint location, GLsizei count, const GLfloat* v', },
1085 { 'return_type': 'void', 1033 { 'return_type': 'void',
1086 'names': ['glUniform3i'], 1034 'names': ['glUniform3i'],
1087 'arguments': 'GLint location, GLint x, GLint y, GLint z', }, 1035 'arguments': 'GLint location, GLint x, GLint y, GLint z', },
1088 { 'return_type': 'void', 1036 { 'return_type': 'void',
1089 'names': ['glUniform3iv'], 1037 'names': ['glUniform3iv'],
1090 'arguments': 'GLint location, GLsizei count, const GLint* v', }, 1038 'arguments': 'GLint location, GLsizei count, const GLint* v', },
1091 { 'return_type': 'void', 1039 { 'return_type': 'void',
1092 'versions': [{ 'name': 'glUniform3ui', 1040 'versions': [{ 'name': 'glUniform3ui' }],
1093 'gl_versions': ['gl3', 'gl4', 'es3'] }],
1094 'arguments': 'GLint location, GLuint v0, GLuint v1, GLuint v2', }, 1041 'arguments': 'GLint location, GLuint v0, GLuint v1, GLuint v2', },
1095 { 'return_type': 'void', 1042 { 'return_type': 'void',
1096 'versions': [{ 'name': 'glUniform3uiv', 1043 'versions': [{ 'name': 'glUniform3uiv' }],
1097 'gl_versions': ['gl3', 'gl4', 'es3'] }],
1098 'arguments': 'GLint location, GLsizei count, const GLuint* v', }, 1044 'arguments': 'GLint location, GLsizei count, const GLuint* v', },
1099 { 'return_type': 'void', 1045 { 'return_type': 'void',
1100 'names': ['glUniform4f'], 1046 'names': ['glUniform4f'],
1101 'arguments': 'GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w', }, 1047 'arguments': 'GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w', },
1102 { 'return_type': 'void', 1048 { 'return_type': 'void',
1103 'names': ['glUniform4fv'], 1049 'names': ['glUniform4fv'],
1104 'arguments': 'GLint location, GLsizei count, const GLfloat* v', }, 1050 'arguments': 'GLint location, GLsizei count, const GLfloat* v', },
1105 { 'return_type': 'void', 1051 { 'return_type': 'void',
1106 'names': ['glUniform4i'], 1052 'names': ['glUniform4i'],
1107 'arguments': 'GLint location, GLint x, GLint y, GLint z, GLint w', }, 1053 'arguments': 'GLint location, GLint x, GLint y, GLint z, GLint w', },
1108 { 'return_type': 'void', 1054 { 'return_type': 'void',
1109 'names': ['glUniform4iv'], 1055 'names': ['glUniform4iv'],
1110 'arguments': 'GLint location, GLsizei count, const GLint* v', }, 1056 'arguments': 'GLint location, GLsizei count, const GLint* v', },
1111 { 'return_type': 'void', 1057 { 'return_type': 'void',
1112 'versions': [{ 'name': 'glUniform4ui', 1058 'versions': [{ 'name': 'glUniform4ui' }],
1113 'gl_versions': ['gl3', 'gl4', 'es3'] }],
1114 'arguments': 'GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3', }, 1059 'arguments': 'GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3', },
1115 { 'return_type': 'void', 1060 { 'return_type': 'void',
1116 'versions': [{ 'name': 'glUniform4uiv', 1061 'versions': [{ 'name': 'glUniform4uiv' }],
1117 'gl_versions': ['gl3', 'gl4', 'es3'] }],
1118 'arguments': 'GLint location, GLsizei count, const GLuint* v', }, 1062 'arguments': 'GLint location, GLsizei count, const GLuint* v', },
1119 { 'return_type': 'void', 1063 { 'return_type': 'void',
1120 'versions': [{ 'name': 'glUniformBlockBinding', 1064 'versions': [{ 'name': 'glUniformBlockBinding' }],
1121 'gl_versions': ['gl3', 'gl4', 'es3'] }], # GL 3.1 or higher.
1122 'arguments': 'GLuint program, GLuint uniformBlockIndex, ' 1065 'arguments': 'GLuint program, GLuint uniformBlockIndex, '
1123 'GLuint uniformBlockBinding', }, 1066 'GLuint uniformBlockBinding', },
1124 { 'return_type': 'void', 1067 { 'return_type': 'void',
1125 'names': ['glUniformMatrix2fv'], 1068 'names': ['glUniformMatrix2fv'],
1126 'arguments': 'GLint location, GLsizei count, ' 1069 'arguments': 'GLint location, GLsizei count, '
1127 'GLboolean transpose, const GLfloat* value', }, 1070 'GLboolean transpose, const GLfloat* value', },
1128 { 'return_type': 'void', 1071 { 'return_type': 'void',
1129 'versions': [{ 'name': 'glUniformMatrix2x3fv', 1072 'versions': [{ 'name': 'glUniformMatrix2x3fv' }],
1130 'gl_versions': ['gl3', 'gl4', 'es3'] }],
1131 'arguments': 'GLint location, GLsizei count, ' 1073 'arguments': 'GLint location, GLsizei count, '
1132 'GLboolean transpose, const GLfloat* value', }, 1074 'GLboolean transpose, const GLfloat* value', },
1133 { 'return_type': 'void', 1075 { 'return_type': 'void',
1134 'versions': [{ 'name': 'glUniformMatrix2x4fv', 1076 'versions': [{ 'name': 'glUniformMatrix2x4fv' }],
1135 'gl_versions': ['gl3', 'gl4', 'es3'] }],
1136 'arguments': 'GLint location, GLsizei count, ' 1077 'arguments': 'GLint location, GLsizei count, '
1137 'GLboolean transpose, const GLfloat* value', }, 1078 'GLboolean transpose, const GLfloat* value', },
1138 { 'return_type': 'void', 1079 { 'return_type': 'void',
1139 'names': ['glUniformMatrix3fv'], 1080 'names': ['glUniformMatrix3fv'],
1140 'arguments': 'GLint location, GLsizei count, ' 1081 'arguments': 'GLint location, GLsizei count, '
1141 'GLboolean transpose, const GLfloat* value', }, 1082 'GLboolean transpose, const GLfloat* value', },
1142 { 'return_type': 'void', 1083 { 'return_type': 'void',
1143 'versions': [{ 'name': 'glUniformMatrix3x2fv', 1084 'versions': [{ 'name': 'glUniformMatrix3x2fv' }],
1144 'gl_versions': ['gl3', 'gl4', 'es3'] }],
1145 'arguments': 'GLint location, GLsizei count, ' 1085 'arguments': 'GLint location, GLsizei count, '
1146 'GLboolean transpose, const GLfloat* value', }, 1086 'GLboolean transpose, const GLfloat* value', },
1147 { 'return_type': 'void', 1087 { 'return_type': 'void',
1148 'versions': [{ 'name': 'glUniformMatrix3x4fv', 1088 'versions': [{ 'name': 'glUniformMatrix3x4fv' }],
1149 'gl_versions': ['gl3', 'gl4', 'es3'] }],
1150 'arguments': 'GLint location, GLsizei count, ' 1089 'arguments': 'GLint location, GLsizei count, '
1151 'GLboolean transpose, const GLfloat* value', }, 1090 'GLboolean transpose, const GLfloat* value', },
1152 { 'return_type': 'void', 1091 { 'return_type': 'void',
1153 'names': ['glUniformMatrix4fv'], 1092 'names': ['glUniformMatrix4fv'],
1154 'arguments': 'GLint location, GLsizei count, ' 1093 'arguments': 'GLint location, GLsizei count, '
1155 'GLboolean transpose, const GLfloat* value', }, 1094 'GLboolean transpose, const GLfloat* value', },
1156 { 'return_type': 'void', 1095 { 'return_type': 'void',
1157 'versions': [{ 'name': 'glUniformMatrix4x2fv', 1096 'versions': [{ 'name': 'glUniformMatrix4x2fv' }],
1158 'gl_versions': ['gl3', 'gl4', 'es3'] }],
1159 'arguments': 'GLint location, GLsizei count, ' 1097 'arguments': 'GLint location, GLsizei count, '
1160 'GLboolean transpose, const GLfloat* value', }, 1098 'GLboolean transpose, const GLfloat* value', },
1161 { 'return_type': 'void', 1099 { 'return_type': 'void',
1162 'versions': [{ 'name': 'glUniformMatrix4x3fv', 1100 'versions': [{ 'name': 'glUniformMatrix4x3fv' }],
1163 'gl_versions': ['gl3', 'gl4', 'es3'] }],
1164 'arguments': 'GLint location, GLsizei count, ' 1101 'arguments': 'GLint location, GLsizei count, '
1165 'GLboolean transpose, const GLfloat* value', }, 1102 'GLboolean transpose, const GLfloat* value', },
1166 { 'return_type': 'GLboolean', 1103 { 'return_type': 'GLboolean',
1167 'known_as': 'glUnmapBuffer', 1104 'known_as': 'glUnmapBuffer',
1168 'names': ['glUnmapBufferOES', 'glUnmapBuffer'], 1105 'names': ['glUnmapBufferOES', 'glUnmapBuffer'],
1169 'arguments': 'GLenum target', }, 1106 'arguments': 'GLenum target', },
1170 { 'return_type': 'void', 1107 { 'return_type': 'void',
1171 'names': ['glUseProgram'], 1108 'names': ['glUseProgram'],
1172 'arguments': 'GLuint program', }, 1109 'arguments': 'GLuint program', },
1173 { 'return_type': 'void', 1110 { 'return_type': 'void',
(...skipping 23 matching lines...) Expand all
1197 { 'return_type': 'void', 1134 { 'return_type': 'void',
1198 'names': ['glVertexAttrib4fv'], 1135 'names': ['glVertexAttrib4fv'],
1199 'arguments': 'GLuint indx, const GLfloat* values', }, 1136 'arguments': 'GLuint indx, const GLfloat* values', },
1200 { 'return_type': 'void', 1137 { 'return_type': 'void',
1201 'known_as': 'glVertexAttribDivisorANGLE', 1138 'known_as': 'glVertexAttribDivisorANGLE',
1202 'names': ['glVertexAttribDivisorARB', 'glVertexAttribDivisorANGLE', 1139 'names': ['glVertexAttribDivisorARB', 'glVertexAttribDivisorANGLE',
1203 'glVertexAttribDivisor'], 1140 'glVertexAttribDivisor'],
1204 'arguments': 1141 'arguments':
1205 'GLuint index, GLuint divisor', }, 1142 'GLuint index, GLuint divisor', },
1206 { 'return_type': 'void', 1143 { 'return_type': 'void',
1207 'versions': [{ 'name': 'glVertexAttribI4i', 1144 'versions': [{ 'name': 'glVertexAttribI4i' }],
1208 'gl_versions': ['gl3', 'gl4', 'es3'] }],
1209 'arguments': 'GLuint indx, GLint x, GLint y, GLint z, GLint w', }, 1145 'arguments': 'GLuint indx, GLint x, GLint y, GLint z, GLint w', },
1210 { 'return_type': 'void', 1146 { 'return_type': 'void',
1211 'versions': [{ 'name': 'glVertexAttribI4iv', 1147 'versions': [{ 'name': 'glVertexAttribI4iv' }],
1212 'gl_versions': ['gl3', 'gl4', 'es3'] }],
1213 'arguments': 'GLuint indx, const GLint* values', }, 1148 'arguments': 'GLuint indx, const GLint* values', },
1214 { 'return_type': 'void', 1149 { 'return_type': 'void',
1215 'versions': [{ 'name': 'glVertexAttribI4ui', 1150 'versions': [{ 'name': 'glVertexAttribI4ui' }],
1216 'gl_versions': ['gl3', 'gl4', 'es3'] }],
1217 'arguments': 'GLuint indx, GLuint x, GLuint y, GLuint z, GLuint w', }, 1151 'arguments': 'GLuint indx, GLuint x, GLuint y, GLuint z, GLuint w', },
1218 { 'return_type': 'void', 1152 { 'return_type': 'void',
1219 'versions': [{ 'name': 'glVertexAttribI4uiv', 1153 'versions': [{ 'name': 'glVertexAttribI4uiv' }],
1220 'gl_versions': ['gl3', 'gl4', 'es3'] }],
1221 'arguments': 'GLuint indx, const GLuint* values', }, 1154 'arguments': 'GLuint indx, const GLuint* values', },
1222 { 'return_type': 'void', 1155 { 'return_type': 'void',
1223 'versions': [{ 'name': 'glVertexAttribIPointer', 1156 'versions': [{ 'name': 'glVertexAttribIPointer' }],
1224 'gl_versions': ['gl3', 'gl4', 'es3'] }],
1225 'arguments': 'GLuint indx, GLint size, GLenum type, GLsizei stride, ' 1157 'arguments': 'GLuint indx, GLint size, GLenum type, GLsizei stride, '
1226 'const void* ptr', }, 1158 'const void* ptr', },
1227 { 'return_type': 'void', 1159 { 'return_type': 'void',
1228 'names': ['glVertexAttribPointer'], 1160 'names': ['glVertexAttribPointer'],
1229 'arguments': 'GLuint indx, GLint size, GLenum type, GLboolean normalized, ' 1161 'arguments': 'GLuint indx, GLint size, GLenum type, GLboolean normalized, '
1230 'GLsizei stride, const void* ptr', }, 1162 'GLsizei stride, const void* ptr', },
1231 { 'return_type': 'void', 1163 { 'return_type': 'void',
1232 'names': ['glViewport'], 1164 'names': ['glViewport'],
1233 'arguments': 'GLint x, GLint y, GLsizei width, GLsizei height', }, 1165 'arguments': 'GLint x, GLint y, GLsizei width, GLsizei height', },
1234 { 'return_type': 'GLenum', 1166 { 'return_type': 'GLenum',
1235 'names': ['glWaitSync'], 1167 'versions': [{ 'name': 'glWaitSync',
1168 'extensions': ['GL_ARB_sync'] }],
1236 'arguments': 1169 'arguments':
1237 'GLsync sync, GLbitfield flags, GLuint64 timeout', }, 1170 'GLsync sync, GLbitfield flags, GLuint64 timeout', },
1238 ] 1171 ]
1239 1172
1240 OSMESA_FUNCTIONS = [ 1173 OSMESA_FUNCTIONS = [
1241 { 'return_type': 'void', 1174 { 'return_type': 'void',
1242 'names': ['OSMesaColorClamp'], 1175 'names': ['OSMesaColorClamp'],
1243 'arguments': 'GLboolean enable', }, 1176 'arguments': 'GLboolean enable', },
1244 { 'return_type': 'OSMesaContext', 1177 { 'return_type': 'OSMesaContext',
1245 'names': ['OSMesaCreateContext'], 1178 'names': ['OSMesaCreateContext'],
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
1668 { 'return_type': 'int', 1601 { 'return_type': 'int',
1669 'names': ['glXWaitVideoSyncSGI'], 1602 'names': ['glXWaitVideoSyncSGI'],
1670 'arguments': 'int divisor, int remainder, unsigned int* count', }, 1603 'arguments': 'int divisor, int remainder, unsigned int* count', },
1671 { 'return_type': 'void', 1604 { 'return_type': 'void',
1672 'names': ['glXWaitX'], 1605 'names': ['glXWaitX'],
1673 'arguments': 'void', }, 1606 'arguments': 'void', },
1674 ] 1607 ]
1675 1608
1676 FUNCTION_SETS = [ 1609 FUNCTION_SETS = [
1677 [GL_FUNCTIONS, 'gl', [ 1610 [GL_FUNCTIONS, 'gl', [
1678 'GL/glext.h', 1611 'GL/gl.h',
1612 'noninclude/GL/glext.h',
1679 'GLES2/gl2ext.h', 1613 'GLES2/gl2ext.h',
1614 'GLES3/gl3.h',
1615 'GLES3/gl31.h',
1680 # Files below are Chromium-specific and shipped with Chromium sources. 1616 # Files below are Chromium-specific and shipped with Chromium sources.
1681 'GL/glextchromium.h', 1617 'GL/glextchromium.h',
1682 'GLES2/gl2chromium.h', 1618 'GLES2/gl2chromium.h',
1683 'GLES2/gl2extchromium.h' 1619 'GLES2/gl2extchromium.h'
1684 ], []], 1620 ], []],
1685 [OSMESA_FUNCTIONS, 'osmesa', [], []], 1621 [OSMESA_FUNCTIONS, 'osmesa', [], []],
1686 [EGL_FUNCTIONS, 'egl', [ 1622 [EGL_FUNCTIONS, 'egl', [
1687 'EGL/eglext.h', 1623 'EGL/eglext.h',
1688 # Files below are Chromium-specific and shipped with Chromium sources. 1624 # Files below are Chromium-specific and shipped with Chromium sources.
1689 'EGL/eglextchromium.h', 1625 'EGL/eglextchromium.h',
1690 ], 1626 ],
1691 [ 1627 [
1692 'EGL_ANGLE_d3d_share_handle_client_buffer', 1628 'EGL_ANGLE_d3d_share_handle_client_buffer',
1693 'EGL_ANGLE_surface_d3d_texture_2d_share_handle', 1629 'EGL_ANGLE_surface_d3d_texture_2d_share_handle',
1694 ], 1630 ],
1695 ], 1631 ],
1696 [WGL_FUNCTIONS, 'wgl', ['GL/wglext.h'], []], 1632 [WGL_FUNCTIONS, 'wgl', ['noninclude/GL/wglext.h'], []],
1697 [GLX_FUNCTIONS, 'glx', ['GL/glx.h', 'GL/glxext.h'], []], 1633 [GLX_FUNCTIONS, 'glx', ['GL/glx.h', 'noninclude/GL/glxext.h'], []],
1698 ] 1634 ]
1699 1635
1700 GLES2_HEADERS_WITH_ENUMS = [ 1636 GLES2_HEADERS_WITH_ENUMS = [
1701 'GLES2/gl2.h', 1637 'GLES2/gl2.h',
1702 'GLES2/gl2ext.h', 1638 'GLES2/gl2ext.h',
1703 'GLES2/gl2chromium.h', 1639 'GLES2/gl2chromium.h',
1704 'GLES2/gl2extchromium.h', 1640 'GLES2/gl2extchromium.h',
1705 'GLES3/gl3.h', 1641 'GLES3/gl3.h',
1706 ] 1642 ]
1707 1643
1708 SELF_LOCATION = os.path.dirname(os.path.abspath(__file__)) 1644 SELF_LOCATION = os.path.dirname(os.path.abspath(__file__))
1709 1645
1710 LICENSE_AND_HEADER = """\ 1646 LICENSE_AND_HEADER = """\
1711 // Copyright 2014 The Chromium Authors. All rights reserved. 1647 // Copyright 2014 The Chromium Authors. All rights reserved.
1712 // Use of this source code is governed by a BSD-style license that can be 1648 // Use of this source code is governed by a BSD-style license that can be
1713 // found in the LICENSE file. 1649 // found in the LICENSE file.
1714 // 1650 //
1715 // This file is auto-generated from 1651 // This file is auto-generated from
1716 // ui/gl/generate_bindings.py 1652 // ui/gl/generate_bindings.py
1717 // It's formatted by clang-format using chromium coding style: 1653 // It's formatted by clang-format using chromium coding style:
1718 // clang-format -i -style=chromium filename 1654 // clang-format -i -style=chromium filename
1719 // DO NOT EDIT! 1655 // DO NOT EDIT!
1720 1656
1721 """ 1657 """
1722 1658
1659 GLVersion = namedtuple('GLVersion', 'is_es major_version minor_version')
1660
1661 def GLVersionBindAlways(version):
1662 return version.major_version <= 2
1663
1664
1665 def GetStaticBinding(func):
1666 """If this function has a name assigned to it that should be bound always,
1667 then return this name.
1668
1669 This will be the case if either a function name is specified
1670 that depends on an extension from UNCONDITIONALLY_BOUND_EXTENSIONS,
1671 or if the GL version it depends on is assumed to be available (e.g. <=2.1).
1672 There can only be one name that satisfies this condition (or the bindings
1673 would be ambiguous)."""
1674
1675 static_bindings = set([])
1676
1677 for version in func['versions']:
1678 if 'extensions' in version:
1679 extensions = version['extensions']
1680 num_unconditional_extensions = len(
1681 extensions & UNCONDITIONALLY_BOUND_EXTENSIONS)
1682 if num_unconditional_extensions:
1683 static_bindings.add(version['name'])
1684 elif 'gl_versions' in version:
1685 versions = [v for v in version['gl_versions'] if GLVersionBindAlways(v)]
1686 # It's only unconditional if it exists in GL and GLES
1687 if len(versions) == 2:
1688 assert versions[0].is_es != versions[1].is_es
1689 static_bindings.add(version['name'])
1690 else:
1691 static_bindings.add(version['name'])
1692
1693 # Avoid ambiguous bindings (static binding with different names)
1694 assert len(static_bindings) <= 1
1695 if len(static_bindings):
1696 static_name = static_bindings.pop()
1697 # Avoid ambiguous bindings (static and dynamic bindings with
1698 # different names)
1699 assert len([v['name'] for v in func['versions']
1700 if v['name'] != static_name]) == 0, func
1701 return static_name
1702 else:
1703 return None
1704
1705
1723 def GenerateHeader(file, functions, set_name, used_extensions): 1706 def GenerateHeader(file, functions, set_name, used_extensions):
1724 """Generates gl_bindings_autogen_x.h""" 1707 """Generates gl_bindings_autogen_x.h"""
1725 1708
1726 # Write file header. 1709 # Write file header.
1727 file.write(LICENSE_AND_HEADER + 1710 file.write(LICENSE_AND_HEADER +
1728 """ 1711 """
1729 1712
1730 #ifndef UI_GFX_GL_GL_BINDINGS_AUTOGEN_%(name)s_H_ 1713 #ifndef UI_GFX_GL_GL_BINDINGS_AUTOGEN_%(name)s_H_
1731 #define UI_GFX_GL_GL_BINDINGS_AUTOGEN_%(name)s_H_ 1714 #define UI_GFX_GL_GL_BINDINGS_AUTOGEN_%(name)s_H_
1732 1715
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
1817 file.write(' MOCK_METHOD%d(%s, %s(%s));\n' % 1800 file.write(' MOCK_METHOD%d(%s, %s(%s));\n' %
1818 (arg_count, func['known_as'][2:], func['return_type'], args)) 1801 (arg_count, func['known_as'][2:], func['return_type'], args))
1819 1802
1820 file.write('\n') 1803 file.write('\n')
1821 1804
1822 1805
1823 def GenerateSource(file, functions, set_name, used_extensions): 1806 def GenerateSource(file, functions, set_name, used_extensions):
1824 """Generates gl_bindings_autogen_x.cc""" 1807 """Generates gl_bindings_autogen_x.cc"""
1825 1808
1826 set_header_name = "ui/gl/gl_" + set_name.lower() + "_api_implementation.h" 1809 set_header_name = "ui/gl/gl_" + set_name.lower() + "_api_implementation.h"
1827 include_list = [ 'base/debug/trace_event.h', 1810 include_list = [ 'base/trace_event/trace_event.h',
1828 'ui/gl/gl_enums.h', 1811 'ui/gl/gl_enums.h',
1829 'ui/gl/gl_bindings.h', 1812 'ui/gl/gl_bindings.h',
1830 'ui/gl/gl_context.h', 1813 'ui/gl/gl_context.h',
1831 'ui/gl/gl_implementation.h', 1814 'ui/gl/gl_implementation.h',
1832 'ui/gl/gl_version_info.h', 1815 'ui/gl/gl_version_info.h',
1833 set_header_name ] 1816 set_header_name ]
1817
1834 includes_string = "\n".join(["#include \"{0}\"".format(h) 1818 includes_string = "\n".join(["#include \"{0}\"".format(h)
1835 for h in sorted(include_list)]) 1819 for h in sorted(include_list)])
1836 1820
1837 # Write file header. 1821 # Write file header.
1838 file.write(LICENSE_AND_HEADER + 1822 file.write(LICENSE_AND_HEADER +
1839 """ 1823 """
1840 1824
1841 #include <string> 1825 #include <string>
1842 1826
1843 %s 1827 %s
1844 1828
1845 namespace gfx { 1829 namespace gfx {
1846 """ % includes_string) 1830 """ % includes_string)
1847 1831
1848 file.write('\n') 1832 file.write('\n')
1849 file.write('static bool g_debugBindingsInitialized;\n') 1833 file.write('static bool g_debugBindingsInitialized;\n')
1850 file.write('Driver%s g_driver_%s;\n' % (set_name.upper(), set_name.lower())) 1834 file.write('Driver%s g_driver_%s;\n' % (set_name.upper(), set_name.lower()))
1851 file.write('\n') 1835 file.write('\n')
1852 1836
1853 # Write stub functions that take the place of some functions before a context 1837 # Write stub functions that take the place of some functions before a context
1854 # is initialized. This is done to provide clear asserts on debug build and to 1838 # is initialized. This is done to provide clear asserts on debug build and to
1855 # avoid crashing in case of a bug on release build. 1839 # avoid crashing in case of a bug on release build.
1856 file.write('\n') 1840 file.write('\n')
1841 num_dynamic = 0
1857 for func in functions: 1842 for func in functions:
1858 unique_names = set([version['name'] for version in func['versions']]) 1843 static_binding = GetStaticBinding(func)
1859 if len(unique_names) > 1: 1844 if static_binding:
1860 file.write('%s %sNotBound(%s) {\n' % 1845 func['static_binding'] = static_binding
1861 (func['return_type'], func['known_as'], func['arguments'])) 1846 else:
1862 file.write(' NOTREACHED();\n') 1847 num_dynamic = num_dynamic + 1
1863 return_type = func['return_type'].lower() 1848
1864 # Returning 0 works for booleans, integers and pointers. 1849 print "[%s] %d static bindings, %d dynamic bindings" % (
1865 if return_type != 'void': 1850 set_name, len(functions) - num_dynamic, num_dynamic)
1866 file.write(' return 0;\n')
1867 file.write('}\n')
1868 1851
1869 # Write function to initialize the function pointers that are always the same 1852 # Write function to initialize the function pointers that are always the same
1870 # and to initialize bindings where choice of the function depends on the 1853 # and to initialize bindings where choice of the function depends on the
1871 # extension string or the GL version to point to stub functions. 1854 # extension string or the GL version to point to stub functions.
1872 file.write('\n') 1855 file.write('\n')
1873 file.write('void Driver%s::InitializeStaticBindings() {\n' % 1856 file.write('void Driver%s::InitializeStaticBindings() {\n' %
1874 set_name.upper()) 1857 set_name.upper())
1875 1858
1876 def WriteFuncBinding(file, known_as, version_name): 1859 def WriteFuncBinding(file, known_as, version_name):
1877 file.write( 1860 file.write(
1878 ' fn.%sFn = reinterpret_cast<%sProc>(GetGLProcAddress("%s"));\n' % 1861 ' fn.%sFn = reinterpret_cast<%sProc>(GetGLProcAddress("%s"));\n' %
1879 (known_as, known_as, version_name)) 1862 (known_as, known_as, version_name))
1880 1863
1881 for func in functions: 1864 for func in functions:
1882 unique_names = set([version['name'] for version in func['versions']]) 1865 if 'static_binding' in func:
1883 if len(unique_names) == 1: 1866 WriteFuncBinding(file, func['known_as'], func['static_binding'])
1884 WriteFuncBinding(file, func['known_as'], func['known_as'])
1885 else: 1867 else:
1886 file.write(' fn.%sFn = reinterpret_cast<%sProc>(%sNotBound);\n' % 1868 file.write(' fn.%sFn = 0;\n' % func['known_as'])
1887 (func['known_as'], func['known_as'], func['known_as']))
1888 1869
1889 file.write('}\n') 1870 if set_name == 'gl':
1890 file.write('\n') 1871 # Write the deferred bindings for GL that need a current context and depend
1891 1872 # on GL_VERSION and GL_EXTENSIONS.
1892 # Write function to initialize bindings where choice of the function depends 1873 file.write('}\n\n')
1893 # on the extension string or the GL version. 1874 file.write("""void DriverGL::InitializeDynamicBindings(GLContext* context) {
1894 file.write("""void Driver%s::InitializeDynamicBindings(GLContext* context) {
1895 DCHECK(context && context->IsCurrent(NULL)); 1875 DCHECK(context && context->IsCurrent(NULL));
1896 const GLVersionInfo* ver = context->GetVersionInfo(); 1876 const GLVersionInfo* ver = context->GetVersionInfo();
1897 ALLOW_UNUSED_LOCAL(ver); 1877 ALLOW_UNUSED_LOCAL(ver);
1898 std::string extensions = context->GetExtensions() + " "; 1878 std::string extensions = context->GetExtensions() + " ";
1899 ALLOW_UNUSED_LOCAL(extensions); 1879 ALLOW_UNUSED_LOCAL(extensions);
1900 1880
1901 """ % set_name.upper()) 1881 """)
1882 else:
1883 file.write("""std::string extensions(GetPlatformExtensions());
1884 extensions += " ";
1885 ALLOW_UNUSED_LOCAL(extensions);
1886
1887 """)
1888
1902 for extension in sorted(used_extensions): 1889 for extension in sorted(used_extensions):
1903 # Extra space at the end of the extension name is intentional, it is used 1890 # Extra space at the end of the extension name is intentional, it is used
1904 # as a separator 1891 # as a separator
1905 file.write(' ext.b_%s = extensions.find("%s ") != std::string::npos;\n' % 1892 file.write(' ext.b_%s = extensions.find("%s ") != std::string::npos;\n' %
1906 (extension, extension)) 1893 (extension, extension))
1907 1894
1908 def WrapOr(cond): 1895 def GetGLVersionCondition(gl_version):
1909 if ' || ' in cond: 1896 if GLVersionBindAlways(gl_version):
1910 return '(%s)' % cond 1897 if gl_version.is_es:
1911 return cond 1898 return 'ver->is_es'
1899 else:
1900 return '!ver->is_es'
1901 elif gl_version.is_es:
1902 return 'ver->IsAtLeastGLES(%du, %du)' % (
1903 gl_version.major_version, gl_version.minor_version)
1904 else:
1905 return 'ver->IsAtLeastGL(%du, %du)' % (
1906 gl_version.major_version, gl_version.minor_version)
1912 1907
1913 def WrapAnd(cond): 1908 def GetBindingCondition(version):
1914 if ' && ' in cond:
1915 return '(%s)' % cond
1916 return cond
1917
1918 def VersionCondition(version):
1919 conditions = [] 1909 conditions = []
1920 if 'gl_versions' in version: 1910 if 'gl_versions' in version:
1921 gl_versions = version['gl_versions'] 1911 conditions.extend(
1922 version_cond = ' || '.join(['ver->is_%s' % gl for gl in gl_versions]) 1912 [GetGLVersionCondition(v) for v in version['gl_versions']])
1923 conditions.append(WrapOr(version_cond))
1924 if 'extensions' in version and version['extensions']: 1913 if 'extensions' in version and version['extensions']:
1925 ext_cond = ' || '.join(['ext.b_%s' % e for e in version['extensions']]) 1914 conditions.extend(
1926 conditions.append(WrapOr(ext_cond)) 1915 ['ext.b_%s' % e for e in version['extensions']])
1927 return ' && '.join(conditions) 1916 return ' || '.join(conditions)
1928 1917
1929 def WriteConditionalFuncBinding(file, func): 1918 def WriteConditionalFuncBinding(file, func):
1930 # Functions with only one version are always bound unconditionally 1919 assert len(func['versions']) > 0
1931 assert len(func['versions']) > 1
1932 known_as = func['known_as'] 1920 known_as = func['known_as']
1933 i = 0 1921 i = 0
1934 first_version = True 1922 first_version = True
1935 while i < len(func['versions']): 1923 while i < len(func['versions']):
1936 version = func['versions'][i] 1924 version = func['versions'][i]
1937 cond = VersionCondition(version) 1925 cond = GetBindingCondition(version)
1938 combined_conditions = [WrapAnd(cond)] 1926 if first_version:
1939 last_version = i + 1 == len(func['versions']) 1927 file.write(' if (%s) {\n ' % cond)
1940 while not last_version and \ 1928 else:
1941 func['versions'][i + 1]['name'] == version['name']: 1929 file.write(' else if (%s) {\n ' % (cond))
1942 i += 1 1930
1943 combinable_cond = VersionCondition(func['versions'][i])
1944 combined_conditions.append(WrapAnd(combinable_cond))
1945 last_version = i + 1 == len(func['versions'])
1946 if len(combined_conditions) > 1:
1947 if [1 for cond in combined_conditions if cond == '']:
1948 cond = ''
1949 else:
1950 cond = ' || '.join(combined_conditions)
1951 # Don't make the last possible binding conditional on anything else but
1952 # that the function isn't already bound to avoid verbose specification
1953 # of functions which have both ARB and core versions with the same name,
1954 # and to be able to bind to mock extension functions in unit tests which
1955 # call InitializeDynamicGLBindings with a stub context that doesn't have
1956 # extensions in its extension string.
1957 # TODO(oetuaho@nvidia.com): Get rid of the fallback.
1958 # http://crbug.com/325668
1959 if cond != '' and not last_version:
1960 if not first_version:
1961 file.write(' if (!fn.%sFn && (%s)) {\n ' % (known_as, cond))
1962 else:
1963 file.write(' if (%s) {\n ' % cond)
1964 elif not first_version:
1965 file.write(' if (!fn.%sFn) {\n ' % known_as)
1966 WriteFuncBinding(file, known_as, version['name']) 1931 WriteFuncBinding(file, known_as, version['name'])
1932 file.write('DCHECK(fn.%sFn);\n' % known_as)
1967 file.write('}\n') 1933 file.write('}\n')
1968 i += 1 1934 i += 1
1969 first_version = False 1935 first_version = False
1970 1936
1971 for func in functions: 1937 for func in functions:
1972 unique_names = set([version['name'] for version in func['versions']]) 1938 if not 'static_binding' in func:
1973 if len(unique_names) > 1:
1974 file.write('\n') 1939 file.write('\n')
1975 file.write(' fn.%sFn = 0;\n' % func['known_as'])
1976 file.write(' debug_fn.%sFn = 0;\n' % func['known_as']) 1940 file.write(' debug_fn.%sFn = 0;\n' % func['known_as'])
1977 WriteConditionalFuncBinding(file, func) 1941 WriteConditionalFuncBinding(file, func)
1978 1942
1979 # Some new function pointers have been added, so update them in debug bindings 1943 # Some new function pointers have been added, so update them in debug bindings
1980 file.write('\n') 1944 file.write('\n')
1981 file.write(' if (g_debugBindingsInitialized)\n') 1945 file.write(' if (g_debugBindingsInitialized)\n')
1982 file.write(' InitializeDebugBindings();\n') 1946 file.write(' InitializeDebugBindings();\n')
1983 file.write('}\n') 1947 file.write('}\n')
1984 file.write('\n') 1948 file.write('\n')
1985 1949
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
2268 out_file.write("""}; 2232 out_file.write("""};
2269 2233
2270 const GLEnums::EnumToString* const GLEnums::enum_to_string_table_ = 2234 const GLEnums::EnumToString* const GLEnums::enum_to_string_table_ =
2271 enum_to_string_table; 2235 enum_to_string_table;
2272 const size_t GLEnums::enum_to_string_table_len_ = 2236 const size_t GLEnums::enum_to_string_table_len_ =
2273 sizeof(enum_to_string_table) / sizeof(enum_to_string_table[0]); 2237 sizeof(enum_to_string_table) / sizeof(enum_to_string_table[0]);
2274 2238
2275 """) 2239 """)
2276 2240
2277 2241
2278 def ParseExtensionFunctionsFromHeader(header_file): 2242 def ParseFunctionsFromHeader(header_file, extensions, versions):
2279 """Parse a C extension header file and return a map from extension names to 2243 """Parse a C extension header file and return a map from extension names to
2280 a list of functions. 2244 a list of functions.
2281 2245
2282 Args: 2246 Args:
2283 header_file: Line-iterable C header file. 2247 header_file: Line-iterable C header file.
2284 Returns: 2248 Returns:
2285 Map of extension name => functions. 2249 Map of extension name => functions, Map of gl version => functions.
2250 Functions will only be in either one of the two maps.
2286 """ 2251 """
2252 version_start = re.compile(
2253 r'#ifndef GL_(ES_|)VERSION((?:_[0-9])+)$')
2287 extension_start = re.compile( 2254 extension_start = re.compile(
2288 r'#ifndef ((?:GL|EGL|WGL|GLX)_[A-Z]+_[a-zA-Z]\w+)') 2255 r'#ifndef ((?:GL|EGL|WGL|GLX)_[A-Z]+_[a-zA-Z]\w+)')
2289 extension_function = re.compile(r'.+\s+([a-z]+\w+)\s*\(') 2256 extension_function = re.compile(r'.+\s+([a-z]+\w+)\s*\(')
2290 typedef = re.compile(r'typedef .*') 2257 typedef = re.compile(r'typedef .*')
2291 macro_start = re.compile(r'^#(if|ifdef|ifndef).*') 2258 macro_start = re.compile(r'^#(if|ifdef|ifndef).*')
2292 macro_end = re.compile(r'^#endif.*') 2259 macro_end = re.compile(r'^#endif.*')
2293 macro_depth = 0 2260 macro_depth = 0
2261 current_version = None
2262 current_version_depth = 0
2294 current_extension = None 2263 current_extension = None
2295 current_extension_depth = 0 2264 current_extension_depth = 0
2296 extensions = collections.defaultdict(lambda: []) 2265
2266 # Pick up all core functions here, since some of them are missing in the
2267 # Khronos headers.
2268 hdr = os.path.basename(header_file.name)
2269 if hdr == "gl.h":
2270 current_version = GLVersion(False, 1, 0)
2271
2272 line_num = 1
2297 for line in header_file: 2273 for line in header_file:
2274 version_match = version_start.match(line)
2298 if macro_start.match(line): 2275 if macro_start.match(line):
2299 macro_depth += 1 2276 macro_depth += 1
2277 if version_match:
2278 if current_version:
2279 raise RuntimeError('Nested GL version macro in %s at line %d' % (
2280 header_file.name, line_num))
2281 current_version_depth = macro_depth
2282 es = version_match.group(1)
2283 major_version, minor_version =\
2284 version_match.group(2).lstrip('_').split('_')
2285 is_es = len(es) > 0
2286 if (not is_es) and (major_version == '1'):
2287 minor_version = 0
2288 current_version = GLVersion(
2289 is_es, int(major_version), int(minor_version))
2300 elif macro_end.match(line): 2290 elif macro_end.match(line):
2301 macro_depth -= 1 2291 macro_depth -= 1
2302 if macro_depth < current_extension_depth: 2292 if macro_depth < current_extension_depth:
2303 current_extension = None 2293 current_extension = None
2294 if macro_depth < current_version_depth:
2295 current_version = None
2296
2304 match = extension_start.match(line) 2297 match = extension_start.match(line)
2305 if match: 2298 if match and not version_match:
2299 if current_version and hdr != "gl.h":
2300 raise RuntimeError('Nested GL version macro in %s at line %d' % (
2301 header_file.name, line_num))
2306 current_extension = match.group(1) 2302 current_extension = match.group(1)
2307 current_extension_depth = macro_depth 2303 current_extension_depth = macro_depth
2308 assert current_extension not in extensions, \ 2304
2309 "Duplicate extension: " + current_extension
2310 match = extension_function.match(line) 2305 match = extension_function.match(line)
2311 if match and current_extension and not typedef.match(line): 2306 if match and not typedef.match(line):
2312 extensions[current_extension].append(match.group(1)) 2307 if current_extension:
2313 return extensions 2308 extensions[current_extension].add(match.group(1))
2309 elif current_version:
2310 versions[current_version].add(match.group(1))
2311 line_num = line_num + 1
2314 2312
2315 2313
2316 def GetExtensionFunctions(extension_headers): 2314 def GetDynamicFunctions(extension_headers):
2317 """Parse extension functions from a list of header files. 2315 """Parse all optional functions from a list of header files.
2318 2316
2319 Args: 2317 Args:
2320 extension_headers: List of header file names. 2318 extension_headers: List of header file names.
2321 Returns: 2319 Returns:
2322 Map of extension name => list of functions. 2320 Map of extension name => list of functions,
2321 Map of gl version => list of functions.
2323 """ 2322 """
2324 extensions = {} 2323 extensions = collections.defaultdict(lambda: set([]))
2324 gl_versions = collections.defaultdict(lambda: set([]))
2325 for header in extension_headers: 2325 for header in extension_headers:
2326 extensions.update(ParseExtensionFunctionsFromHeader(open(header))) 2326 ParseFunctionsFromHeader(open(header), extensions, gl_versions)
2327 return extensions 2327 return extensions, gl_versions
2328 2328
2329 2329
2330 def GetFunctionToExtensionMap(extensions): 2330 def GetFunctionToExtensionsMap(extensions):
2331 """Construct map from a function names to extensions which define the 2331 """Construct map from a function names to extensions which define the
2332 function. 2332 function.
2333 2333
2334 Args: 2334 Args:
2335 extensions: Map of extension name => functions. 2335 extensions: Map of extension name => functions.
2336 Returns: 2336 Returns:
2337 Map of function name => extension name. 2337 Map of function name => extension names.
2338 """ 2338 """
2339 function_to_extensions = {} 2339 function_to_extensions = {}
2340 for extension, functions in extensions.items(): 2340 for extension, functions in extensions.items():
2341 for function in functions: 2341 for function in functions:
2342 if not function in function_to_extensions: 2342 if not function in function_to_extensions:
2343 function_to_extensions[function] = [] 2343 function_to_extensions[function] = set([])
2344 function_to_extensions[function].append(extension) 2344 function_to_extensions[function].add(extension)
2345 return function_to_extensions 2345 return function_to_extensions
2346 2346
2347 def GetFunctionToGLVersionsMap(gl_versions):
2348 """Construct map from a function names to GL versions which define the
2349 function.
2350
2351 Args:
2352 extensions: Map of gl versions => functions.
2353 Returns:
2354 Map of function name => gl versions.
2355 """
2356 function_to_gl_versions = {}
2357 for gl_version, functions in gl_versions.items():
2358 for function in functions:
2359 if not function in function_to_gl_versions:
2360 function_to_gl_versions[function] = set([])
2361 function_to_gl_versions[function].add(gl_version)
2362 return function_to_gl_versions
2363
2347 2364
2348 def LooksLikeExtensionFunction(function): 2365 def LooksLikeExtensionFunction(function):
2349 """Heuristic to see if a function name is consistent with extension function 2366 """Heuristic to see if a function name is consistent with extension function
2350 naming.""" 2367 naming."""
2351 vendor = re.match(r'\w+?([A-Z][A-Z]+)$', function) 2368 vendor = re.match(r'\w+?([A-Z][A-Z]+)$', function)
2352 return vendor is not None and not vendor.group(1) in ['GL', 'API', 'DC'] 2369 return vendor is not None and not vendor.group(1) in ['GL', 'API', 'DC']
2353 2370
2354 2371
2372 def SortVersions(key):
2373 # Prefer functions from the core for binding
2374 if 'gl_versions' in key:
2375 return 0
2376 else:
2377 return 1
2378
2355 def FillExtensionsFromHeaders(functions, extension_headers, extra_extensions): 2379 def FillExtensionsFromHeaders(functions, extension_headers, extra_extensions):
2356 """Determine which functions belong to extensions based on extension headers, 2380 """Determine which functions belong to extensions based on extension headers,
2357 and fill in this information to the functions table for functions that don't 2381 and fill in this information to the functions table for functions that don't
2358 already have the information. 2382 already have the information.
2359 2383
2360 Args: 2384 Args:
2361 functions: List of (return type, function versions, arguments). 2385 functions: List of (return type, function versions, arguments).
2362 extension_headers: List of header file names. 2386 extension_headers: List of header file names.
2363 extra_extensions: Extensions to add to the list. 2387 extra_extensions: Extensions to add to the list.
2364 Returns: 2388 Returns:
2365 Set of used extensions. 2389 Set of used extensions.
2366 """ 2390 """
2367 # Parse known extensions. 2391 # Parse known extensions.
2368 extensions = GetExtensionFunctions(extension_headers) 2392 extensions, gl_versions = GetDynamicFunctions(extension_headers)
2369 functions_to_extensions = GetFunctionToExtensionMap(extensions) 2393 functions_to_extensions = GetFunctionToExtensionsMap(extensions)
2394 functions_to_gl_versions = GetFunctionToGLVersionsMap(gl_versions)
2370 2395
2371 # Fill in the extension information. 2396 # Fill in the extension information.
2372 used_extensions = set() 2397 used_extensions = set()
2398 used_functions_by_version = collections.defaultdict(lambda: set([]))
2373 for func in functions: 2399 for func in functions:
2374 for version in func['versions']: 2400 for version in func['versions']:
2375 name = version['name'] 2401 name = version['name']
2402
2403 # There should only be one version entry per name string.
2404 if len([v for v in func['versions'] if v['name'] == name]) > 1:
2405 raise RuntimeError(
2406 'Duplicate version entries with same name for %s' % name)
2407
2376 # Make sure we know about all extensions and extension functions. 2408 # Make sure we know about all extensions and extension functions.
2409 extensions_from_headers = set([])
2410 if name in functions_to_extensions:
2411 extensions_from_headers = set(functions_to_extensions[name])
2412
2413 explicit_extensions = set([])
2377 if 'extensions' in version: 2414 if 'extensions' in version:
2415 explicit_extensions = set(version['extensions'])
2416
2417 in_both = explicit_extensions.intersection(extensions_from_headers)
2418 if len(in_both):
2419 print "[%s] Specified redundant extensions for binding: %s" % (
2420 name, ', '.join(in_both))
2421 diff = explicit_extensions - extensions_from_headers
2422 if len(diff):
2423 print "[%s] Specified extra extensions for binding: %s" % (
2424 name, ', '.join(diff))
2425
2426 all_extensions = extensions_from_headers.union(explicit_extensions)
2427 if len(all_extensions):
2428 version['extensions'] = all_extensions
2429
2430 if 'extensions' in version:
2431 assert len(version['extensions'])
2378 used_extensions.update(version['extensions']) 2432 used_extensions.update(version['extensions'])
2379 elif name in functions_to_extensions: 2433
2380 # If there are multiple versions with the same name, assume that they 2434 if not 'extensions' in version and LooksLikeExtensionFunction(name):
2381 # already have all the correct conditions, we can't just blindly add
2382 # the same extension conditions to all of them
2383 if len([v for v in func['versions'] if v['name'] == name]) == 1:
2384 version['extensions'] = functions_to_extensions[name]
2385 used_extensions.update(version['extensions'])
2386 elif LooksLikeExtensionFunction(name):
2387 raise RuntimeError('%s looks like an extension function but does not ' 2435 raise RuntimeError('%s looks like an extension function but does not '
2388 'belong to any of the known extensions.' % name) 2436 'belong to any of the known extensions.' % name)
2389 2437
2438 if name in functions_to_gl_versions:
2439 assert not 'gl_versions' in version
2440 version['gl_versions'] = functions_to_gl_versions[name]
2441 for v in version['gl_versions']:
2442 used_functions_by_version[v].add(name)
2443
2444 func['versions'] = sorted(func['versions'], key=SortVersions)
2445
2390 # Add extensions that do not have any functions. 2446 # Add extensions that do not have any functions.
2391 used_extensions.update(extra_extensions) 2447 used_extensions.update(extra_extensions)
2392 2448
2449 # Print out used function count by GL(ES) version.
2450 for v in sorted([v for v in used_functions_by_version if v.is_es]):
2451 print "OpenGL ES %d.%d: %d used functions" % (
2452 v.major_version, v.minor_version, len(used_functions_by_version[v]))
2453 for v in sorted([v for v in used_functions_by_version if not v.is_es]):
2454 print "OpenGL %d.%d: %d used functions" % (
2455 v.major_version, v.minor_version, len(used_functions_by_version[v]))
2456
2393 return used_extensions 2457 return used_extensions
2394 2458
2395 2459
2396 def ResolveHeader(header, header_paths): 2460 def ResolveHeader(header, header_paths):
2397 for path in header_paths: 2461 for path in header_paths:
2398 result = os.path.join(path, header) 2462 result = os.path.join(path, header)
2399 if not os.path.isabs(path): 2463 if not os.path.isabs(path):
2400 result = os.path.abspath(os.path.join(SELF_LOCATION, result)) 2464 result = os.path.abspath(os.path.join(SELF_LOCATION, result))
2401 if os.path.exists(result): 2465 if os.path.exists(result):
2402 # Always use forward slashes as path separators. Otherwise backslashes 2466 # Always use forward slashes as path separators. Otherwise backslashes
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
2505 'gl_enums_implementation_autogen.h'), 2569 'gl_enums_implementation_autogen.h'),
2506 'wb') 2570 'wb')
2507 GenerateEnumUtils(header_file, enum_header_filenames) 2571 GenerateEnumUtils(header_file, enum_header_filenames)
2508 header_file.close() 2572 header_file.close()
2509 ClangFormat(header_file.name) 2573 ClangFormat(header_file.name)
2510 return 0 2574 return 0
2511 2575
2512 2576
2513 if __name__ == '__main__': 2577 if __name__ == '__main__':
2514 sys.exit(main(sys.argv[1:])) 2578 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « ui/gl/android/surface_texture.cc ('k') | ui/gl/gl.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698