| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # | 2 # |
| 3 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 """code generator for GLES2 command buffers.""" | 7 """code generator for GLES2 command buffers.""" |
| 8 | 8 |
| 9 import os | 9 import os |
| 10 import os.path | 10 import os.path |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint indx, GLfloat x); | 168 GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint indx, GLfloat x); |
| 169 GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint indx, const GLfloa
t* values); | 169 GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint indx, const GLfloa
t* values); |
| 170 GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint indx, GLfloat x, GL
float y); | 170 GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint indx, GLfloat x, GL
float y); |
| 171 GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint indx, const GLfloa
t* values); | 171 GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint indx, const GLfloa
t* values); |
| 172 GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint indx, GLfloat x, GL
float y, GLfloat z); | 172 GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint indx, GLfloat x, GL
float y, GLfloat z); |
| 173 GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint indx, const GLfloa
t* values); | 173 GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint indx, const GLfloa
t* values); |
| 174 GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint indx, GLfloat x, GL
float y, GLfloat z, GLfloat w); | 174 GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint indx, GLfloat x, GL
float y, GLfloat z, GLfloat w); |
| 175 GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint indx, const GLfloa
t* values); | 175 GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint indx, const GLfloa
t* values); |
| 176 GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint indx, GLintVer
texAttribSize size, GLenumVertexAttribType type, GLboolean normalized, GLsizei s
tride, const void* ptr); | 176 GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint indx, GLintVer
texAttribSize size, GLenumVertexAttribType type, GLboolean normalized, GLsizei s
tride, const void* ptr); |
| 177 GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width,
GLsizei height); | 177 GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width,
GLsizei height); |
| 178 GL_APICALL void GL_APIENTRY glBlitFramebufferEXT (GLint srcX0, GLint src
Y0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1
, GLbitfield mask, GLenumBlitFilter filter); |
| 179 GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleEXT (GLenumR
enderBufferTarget target, GLsizei samples, GLenumRenderBufferFormat internalform
at, GLsizei width, GLsizei height); |
| 178 // Non-GL commands. | 180 // Non-GL commands. |
| 179 GL_APICALL void GL_APIENTRY glSwapBuffers (void); | 181 GL_APICALL void GL_APIENTRY glSwapBuffers (void); |
| 180 GL_APICALL GLuint GL_APIENTRY glGetMaxValueInBuffer (GLidBuffer buffer_id,
GLsizei count, GLenumGetMaxIndexType type, GLuint offset); | 182 GL_APICALL GLuint GL_APIENTRY glGetMaxValueInBuffer (GLidBuffer buffer_id,
GLsizei count, GLenumGetMaxIndexType type, GLuint offset); |
| 181 GL_APICALL void GL_APIENTRY glGenSharedIds (GLuint namespace_id, GLuint
id_offset, GLsizei n, GLuint* ids); | 183 GL_APICALL void GL_APIENTRY glGenSharedIds (GLuint namespace_id, GLuint
id_offset, GLsizei n, GLuint* ids); |
| 182 GL_APICALL void GL_APIENTRY glDeleteSharedIds (GLuint namespace_id, GLsi
zei n, const GLuint* ids); | 184 GL_APICALL void GL_APIENTRY glDeleteSharedIds (GLuint namespace_id, GLsi
zei n, const GLuint* ids); |
| 183 GL_APICALL void GL_APIENTRY glRegisterSharedIds (GLuint namespace_id, GL
sizei n, const GLuint* ids); | 185 GL_APICALL void GL_APIENTRY glRegisterSharedIds (GLuint namespace_id, GL
sizei n, const GLuint* ids); |
| 184 GL_APICALL GLboolean GL_APIENTRY glCommandBufferEnable (const char* feature); | 186 GL_APICALL GLboolean GL_APIENTRY glCommandBufferEnable (const char* feature); |
| 185 GL_APICALL void* GL_APIENTRY glMapBufferSubData (GLuint target, GLintptr
offset, GLsizeiptr size, GLenum access); | 187 GL_APICALL void* GL_APIENTRY glMapBufferSubData (GLuint target, GLintptr
offset, GLsizeiptr size, GLenum access); |
| 186 GL_APICALL void GL_APIENTRY glUnmapBufferSubData (const void* mem); | 188 GL_APICALL void GL_APIENTRY glUnmapBufferSubData (const void* mem); |
| 187 GL_APICALL void* GL_APIENTRY glMapTexSubImage2D (GLenum target, GLint lev
el, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format,
GLenum type, GLenum access); | 189 GL_APICALL void* GL_APIENTRY glMapTexSubImage2D (GLenum target, GLint lev
el, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format,
GLenum type, GLenum access); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 'ShaderSourceBucket': 435, | 378 'ShaderSourceBucket': 435, |
| 377 'ShaderBinary': 436, | 379 'ShaderBinary': 436, |
| 378 'ReleaseShaderCompiler': 437, | 380 'ReleaseShaderCompiler': 437, |
| 379 'GetMaxValueInBuffer': 438, | 381 'GetMaxValueInBuffer': 438, |
| 380 'GenSharedIds': 439, | 382 'GenSharedIds': 439, |
| 381 'DeleteSharedIds': 440, | 383 'DeleteSharedIds': 440, |
| 382 'RegisterSharedIds': 441, | 384 'RegisterSharedIds': 441, |
| 383 'CommandBufferEnable': 442, | 385 'CommandBufferEnable': 442, |
| 384 'CompressedTexImage2DBucket': 443, | 386 'CompressedTexImage2DBucket': 443, |
| 385 'CompressedTexSubImage2DBucket': 444, | 387 'CompressedTexSubImage2DBucket': 444, |
| 388 'RenderbufferStorageMultisampleEXT': 445, |
| 389 'BlitFramebufferEXT': 446, |
| 386 } | 390 } |
| 387 | 391 |
| 388 # This is a list of enum names and their valid values. It is used to map | 392 # This is a list of enum names and their valid values. It is used to map |
| 389 # GLenum arguments to a specific set of valid values. | 393 # GLenum arguments to a specific set of valid values. |
| 390 _ENUM_LISTS = { | 394 _ENUM_LISTS = { |
| 395 'BlitFilter': { |
| 396 'type': 'GLenum', |
| 397 'valid': [ |
| 398 'GL_NEAREST', |
| 399 'GL_LINEAR', |
| 400 ], |
| 401 'invalid': [ |
| 402 'GL_LINEAR_MIPMAP_LINEAR', |
| 403 ], |
| 404 }, |
| 391 'FrameBufferTarget': { | 405 'FrameBufferTarget': { |
| 392 'type': 'GLenum', | 406 'type': 'GLenum', |
| 393 'valid': [ | 407 'valid': [ |
| 394 'GL_FRAMEBUFFER', | 408 'GL_FRAMEBUFFER', |
| 395 ], | 409 ], |
| 396 'invalid': [ | 410 'invalid': [ |
| 397 'GL_RENDERBUFFER', | 411 'GL_READ_FRAMEBUFFER' , |
| 398 ], | 412 ], |
| 399 }, | 413 }, |
| 400 'RenderBufferTarget': { | 414 'RenderBufferTarget': { |
| 401 'type': 'GLenum', | 415 'type': 'GLenum', |
| 402 'valid': [ | 416 'valid': [ |
| 403 'GL_RENDERBUFFER', | 417 'GL_RENDERBUFFER', |
| 404 ], | 418 ], |
| 405 'invalid': [ | 419 'invalid': [ |
| 406 'GL_FRAMEBUFFER', | 420 'GL_FRAMEBUFFER', |
| 407 ], | 421 ], |
| (...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1023 'type': 'Bind', | 1037 'type': 'Bind', |
| 1024 'decoder_func': 'DoBindRenderbuffer', | 1038 'decoder_func': 'DoBindRenderbuffer', |
| 1025 'gl_test_func': 'glBindRenderbufferEXT', | 1039 'gl_test_func': 'glBindRenderbufferEXT', |
| 1026 'gen_func': 'GenRenderbuffersEXT', | 1040 'gen_func': 'GenRenderbuffersEXT', |
| 1027 }, | 1041 }, |
| 1028 'BindTexture': { | 1042 'BindTexture': { |
| 1029 'type': 'Bind', | 1043 'type': 'Bind', |
| 1030 'decoder_func': 'DoBindTexture', | 1044 'decoder_func': 'DoBindTexture', |
| 1031 'gen_func': 'GenTextures', | 1045 'gen_func': 'GenTextures', |
| 1032 }, | 1046 }, |
| 1047 'BlitFramebufferEXT': { |
| 1048 'decoder_func': 'DoBlitFramebufferEXT', |
| 1049 'unit_test': False, |
| 1050 }, |
| 1033 'BufferData': {'type': 'Manual', 'immediate': True}, | 1051 'BufferData': {'type': 'Manual', 'immediate': True}, |
| 1034 'BufferSubData': {'type': 'Data', 'decoder_func': 'DoBufferSubData'}, | 1052 'BufferSubData': {'type': 'Data', 'decoder_func': 'DoBufferSubData'}, |
| 1035 'CheckFramebufferStatus': { | 1053 'CheckFramebufferStatus': { |
| 1036 'type': 'Is', | 1054 'type': 'Is', |
| 1037 'decoder_func': 'DoCheckFramebufferStatus', | 1055 'decoder_func': 'DoCheckFramebufferStatus', |
| 1038 'gl_test_func': 'glCheckFramebufferStatusEXT', | 1056 'gl_test_func': 'glCheckFramebufferStatusEXT', |
| 1039 'result': ['GLenum'], | 1057 'result': ['GLenum'], |
| 1040 }, | 1058 }, |
| 1041 'ClearColor': {'decoder_func': 'DoClearColor'}, | 1059 'ClearColor': {'decoder_func': 'DoClearColor'}, |
| 1042 'ClearDepthf': { | 1060 'ClearDepthf': { |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1348 }, | 1366 }, |
| 1349 'LinkProgram': {'decoder_func': 'DoLinkProgram'}, | 1367 'LinkProgram': {'decoder_func': 'DoLinkProgram'}, |
| 1350 'MapBufferSubData': {'gen_cmd': False}, | 1368 'MapBufferSubData': {'gen_cmd': False}, |
| 1351 'MapTexSubImage2D': {'gen_cmd': False}, | 1369 'MapTexSubImage2D': {'gen_cmd': False}, |
| 1352 'PixelStorei': {'type': 'Manual'}, | 1370 'PixelStorei': {'type': 'Manual'}, |
| 1353 'RenderbufferStorage': { | 1371 'RenderbufferStorage': { |
| 1354 'decoder_func': 'DoRenderbufferStorage', | 1372 'decoder_func': 'DoRenderbufferStorage', |
| 1355 'gl_test_func': 'glRenderbufferStorageEXT', | 1373 'gl_test_func': 'glRenderbufferStorageEXT', |
| 1356 'expectation': False, | 1374 'expectation': False, |
| 1357 }, | 1375 }, |
| 1376 'RenderbufferStorageMultisampleEXT': { |
| 1377 'decoder_func': 'DoRenderbufferStorageMultisample', |
| 1378 'gl_test_func': 'glRenderbufferStorageMultisampleEXT', |
| 1379 'expectation': False, |
| 1380 'unit_test': False, |
| 1381 }, |
| 1358 'ReadPixels': { | 1382 'ReadPixels': { |
| 1359 'cmd_comment': | 1383 'cmd_comment': |
| 1360 '// ReadPixels has the result separated from the pixel buffer so that\n' | 1384 '// ReadPixels has the result separated from the pixel buffer so that\n' |
| 1361 '// it is easier to specify the result going to some specific place\n' | 1385 '// it is easier to specify the result going to some specific place\n' |
| 1362 '// that exactly fits the rectangle of pixels.\n', | 1386 '// that exactly fits the rectangle of pixels.\n', |
| 1363 'type': 'Custom', | 1387 'type': 'Custom', |
| 1364 'immediate': False, | 1388 'immediate': False, |
| 1365 'impl_func': False, | 1389 'impl_func': False, |
| 1366 'cmd_args': | 1390 'cmd_args': |
| 1367 'GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, ' | 1391 'GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, ' |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1616 self.file.close() | 1640 self.file.close() |
| 1617 | 1641 |
| 1618 | 1642 |
| 1619 class CHeaderWriter(CWriter): | 1643 class CHeaderWriter(CWriter): |
| 1620 """Writes a C Header file.""" | 1644 """Writes a C Header file.""" |
| 1621 | 1645 |
| 1622 _non_alnum_re = re.compile(r'[^a-zA-Z0-9]') | 1646 _non_alnum_re = re.compile(r'[^a-zA-Z0-9]') |
| 1623 | 1647 |
| 1624 def __init__(self, filename, file_comment = None): | 1648 def __init__(self, filename, file_comment = None): |
| 1625 CWriter.__init__(self, filename) | 1649 CWriter.__init__(self, filename) |
| 1626 | |
| 1627 base = os.path.dirname( | 1650 base = os.path.dirname( |
| 1628 os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | 1651 os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) |
| 1629 hpath = os.path.abspath(filename)[len(base) + 1:] | 1652 hpath = os.path.abspath(filename)[len(base) + 1:] |
| 1630 self.guard = self._non_alnum_re.sub('_', hpath).upper() + '_' | 1653 self.guard = self._non_alnum_re.sub('_', hpath).upper() + '_' |
| 1631 | 1654 |
| 1632 self.Write(_LICENSE) | 1655 self.Write(_LICENSE) |
| 1633 self.Write( | 1656 self.Write( |
| 1634 "// This file is auto-generated. DO NOT EDIT!\n" | 1657 "// This file is auto-generated. DO NOT EDIT!\n" |
| 1635 "\n") | 1658 "\n") |
| 1636 if not file_comment == None: | 1659 if not file_comment == None: |
| (...skipping 3460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5097 | 5120 |
| 5098 if options.generate_docs: | 5121 if options.generate_docs: |
| 5099 gen.WriteDocs("docs/gles2_cmd_format_docs_autogen.h") | 5122 gen.WriteDocs("docs/gles2_cmd_format_docs_autogen.h") |
| 5100 | 5123 |
| 5101 if gen.errors > 0: | 5124 if gen.errors > 0: |
| 5102 print "%d errors" % gen.errors | 5125 print "%d errors" % gen.errors |
| 5103 sys.exit(1) | 5126 sys.exit(1) |
| 5104 | 5127 |
| 5105 if __name__ == '__main__': | 5128 if __name__ == '__main__': |
| 5106 main(sys.argv[1:]) | 5129 main(sys.argv[1:]) |
| OLD | NEW |