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