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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 // Non-GL commands. | 178 // Non-GL commands. |
179 GL_APICALL void GL_APIENTRY glSwapBuffers (void); | 179 GL_APICALL void GL_APIENTRY glSwapBuffers (void); |
180 GL_APICALL GLuint GL_APIENTRY glGetMaxValueInBuffer (GLidBuffer buffer_id,
GLsizei count, GLenumGetMaxIndexType type, GLuint offset); | 180 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); | 181 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); | 182 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); | 183 GL_APICALL void GL_APIENTRY glRegisterSharedIds (GLuint namespace_id, GL
sizei n, const GLuint* ids); |
184 GL_APICALL void GL_APIENTRY glCommandBufferEnable (GLenumCommandBufferSt
ate cap, GLboolean enable);""" | 184 GL_APICALL GLboolean GL_APIENTRY glCommandBufferEnable (const char* feature); |
| 185 """ |
185 | 186 |
186 # This is the list of all commmands that will be generated and their Id. | 187 # This is the list of all commmands that will be generated and their Id. |
187 # If a command is not listed in this table it is an error. | 188 # If a command is not listed in this table it is an error. |
188 # This lets us make sure that command ids do not change as the generator | 189 # This lets us make sure that command ids do not change as the generator |
189 # generates new variations of commands. | 190 # generates new variations of commands. |
190 | 191 |
191 _CMD_ID_TABLE = { | 192 _CMD_ID_TABLE = { |
192 'ActiveTexture': 256, | 193 'ActiveTexture': 256, |
193 'AttachShader': 257, | 194 'AttachShader': 257, |
194 'BindAttribLocation': 258, | 195 'BindAttribLocation': 258, |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 'GL_SUBPIXEL_BITS', | 516 'GL_SUBPIXEL_BITS', |
516 'GL_TEXTURE_BINDING_2D', | 517 'GL_TEXTURE_BINDING_2D', |
517 'GL_TEXTURE_BINDING_CUBE_MAP', | 518 'GL_TEXTURE_BINDING_CUBE_MAP', |
518 'GL_UNPACK_ALIGNMENT', | 519 'GL_UNPACK_ALIGNMENT', |
519 'GL_VIEWPORT', | 520 'GL_VIEWPORT', |
520 ], | 521 ], |
521 'invalid': [ | 522 'invalid': [ |
522 'GL_FOG_HINT', | 523 'GL_FOG_HINT', |
523 ], | 524 ], |
524 }, | 525 }, |
525 'CommandBufferState': { | |
526 'type': 'GLenum', | |
527 'valid': [ | |
528 'GLES2_ALLOW_BUFFERS_ON_MULTIPLE_TARGETS', | |
529 ], | |
530 }, | |
531 'TextureTarget': { | 526 'TextureTarget': { |
532 'type': 'GLenum', | 527 'type': 'GLenum', |
533 'valid': [ | 528 'valid': [ |
534 'GL_TEXTURE_2D', | 529 'GL_TEXTURE_2D', |
535 'GL_TEXTURE_CUBE_MAP_POSITIVE_X', | 530 'GL_TEXTURE_CUBE_MAP_POSITIVE_X', |
536 'GL_TEXTURE_CUBE_MAP_NEGATIVE_X', | 531 'GL_TEXTURE_CUBE_MAP_NEGATIVE_X', |
537 'GL_TEXTURE_CUBE_MAP_POSITIVE_Y', | 532 'GL_TEXTURE_CUBE_MAP_POSITIVE_Y', |
538 'GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', | 533 'GL_TEXTURE_CUBE_MAP_NEGATIVE_Y', |
539 'GL_TEXTURE_CUBE_MAP_POSITIVE_Z', | 534 'GL_TEXTURE_CUBE_MAP_POSITIVE_Z', |
540 'GL_TEXTURE_CUBE_MAP_NEGATIVE_Z', | 535 'GL_TEXTURE_CUBE_MAP_NEGATIVE_Z', |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1020 'BufferData': {'type': 'Manual', 'immediate': True}, | 1015 'BufferData': {'type': 'Manual', 'immediate': True}, |
1021 'BufferSubData': {'type': 'Data', 'decoder_func': 'DoBufferSubData'}, | 1016 'BufferSubData': {'type': 'Data', 'decoder_func': 'DoBufferSubData'}, |
1022 'CheckFramebufferStatus': { | 1017 'CheckFramebufferStatus': { |
1023 'type': 'Is', | 1018 'type': 'Is', |
1024 'decoder_func': 'DoCheckFramebufferStatus', | 1019 'decoder_func': 'DoCheckFramebufferStatus', |
1025 'gl_test_func': 'glCheckFramebufferStatusEXT', | 1020 'gl_test_func': 'glCheckFramebufferStatusEXT', |
1026 'result': ['GLenum'], | 1021 'result': ['GLenum'], |
1027 }, | 1022 }, |
1028 'ClearDepthf': {'decoder_func': 'glClearDepth'}, | 1023 'ClearDepthf': {'decoder_func': 'glClearDepth'}, |
1029 'CommandBufferEnable': { | 1024 'CommandBufferEnable': { |
| 1025 'type': 'Custom', |
| 1026 'immediate': False, |
1030 'decoder_func': 'DoCommandBufferEnable', | 1027 'decoder_func': 'DoCommandBufferEnable', |
1031 'expectation': False, | 1028 'expectation': False, |
| 1029 'cmd_args': 'GLuint bucket_id, GLint* result', |
| 1030 'result': ['GLint'], |
1032 }, | 1031 }, |
1033 'CompileShader': {'decoder_func': 'DoCompileShader', 'unit_test': False}, | 1032 'CompileShader': {'decoder_func': 'DoCompileShader', 'unit_test': False}, |
1034 'CompressedTexImage2D': { | 1033 'CompressedTexImage2D': { |
1035 'type': 'Manual', | 1034 'type': 'Manual', |
1036 'immediate': True, | 1035 'immediate': True, |
1037 'bucket': True, | 1036 'bucket': True, |
1038 }, | 1037 }, |
1039 'CompressedTexSubImage2D': { | 1038 'CompressedTexSubImage2D': { |
1040 'type': 'Data', | 1039 'type': 'Data', |
1041 'bucket': True, | 1040 'bucket': True, |
(...skipping 3888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4930 | 4929 |
4931 if options.generate_docs: | 4930 if options.generate_docs: |
4932 gen.WriteDocs("docs/gles2_cmd_format_docs_autogen.h") | 4931 gen.WriteDocs("docs/gles2_cmd_format_docs_autogen.h") |
4933 | 4932 |
4934 if gen.errors > 0: | 4933 if gen.errors > 0: |
4935 print "%d errors" % gen.errors | 4934 print "%d errors" % gen.errors |
4936 sys.exit(1) | 4935 sys.exit(1) |
4937 | 4936 |
4938 if __name__ == '__main__': | 4937 if __name__ == '__main__': |
4939 main(sys.argv[1:]) | 4938 main(sys.argv[1:]) |
OLD | NEW |