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

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

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

Powered by Google App Engine
This is Rietveld 408576698