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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 GLboolean GL_APIENTRY glCommandBufferEnable (const char* feature); | 184 GL_APICALL GLboolean GL_APIENTRY glCommandBufferEnable (const char* feature); |
| 185 GL_APICALL void* GL_APIENTRY glMapBufferSubData (GLuint target, GLintptr
offset, GLsizeiptr size, GLenum access); |
| 186 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); |
| 188 GL_APICALL void GL_APIENTRY glUnmapTexSubImage2D (const void* mem); |
185 """ | 189 """ |
186 | 190 |
187 # This is the list of all commmands that will be generated and their Id. | 191 # This is the list of all commmands that will be generated and their Id. |
188 # If a command is not listed in this table it is an error. | 192 # If a command is not listed in this table it is an error. |
189 # This lets us make sure that command ids do not change as the generator | 193 # This lets us make sure that command ids do not change as the generator |
190 # generates new variations of commands. | 194 # generates new variations of commands. |
191 | 195 |
192 _CMD_ID_TABLE = { | 196 _CMD_ID_TABLE = { |
193 'ActiveTexture': 256, | 197 'ActiveTexture': 256, |
194 'AttachShader': 257, | 198 'AttachShader': 257, |
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
964 # cmd_comment: A comment added to the cmd format. | 968 # cmd_comment: A comment added to the cmd format. |
965 # type: defines which handler will be used to generate code. | 969 # type: defines which handler will be used to generate code. |
966 # decoder_func: defines which function to call in the decoder to execute the | 970 # decoder_func: defines which function to call in the decoder to execute the |
967 # corresponding GL command. If not specified the GL command will | 971 # corresponding GL command. If not specified the GL command will |
968 # be called directly. | 972 # be called directly. |
969 # gl_test_func: GL function that is expected to be called when testing. | 973 # gl_test_func: GL function that is expected to be called when testing. |
970 # cmd_args: The arguments to use for the command. This overrides generating | 974 # cmd_args: The arguments to use for the command. This overrides generating |
971 # them based on the GL function arguments. | 975 # them based on the GL function arguments. |
972 # a NonImmediate type is a type that stays a pointer even in | 976 # a NonImmediate type is a type that stays a pointer even in |
973 # and immediate version of acommand. | 977 # and immediate version of acommand. |
| 978 # gen_cmd: Whether or not this function geneates a command. Default = True. |
974 # immediate: Whether or not to generate an immediate command for the GL | 979 # immediate: Whether or not to generate an immediate command for the GL |
975 # function. The default is if there is exactly 1 pointer argument | 980 # function. The default is if there is exactly 1 pointer argument |
976 # in the GL function an immediate command is generated. | 981 # in the GL function an immediate command is generated. |
977 # bucket: True to generate a bucket version of the command. | 982 # bucket: True to generate a bucket version of the command. |
978 # impl_func: Whether or not to generate the GLES2Implementation part of this | 983 # impl_func: Whether or not to generate the GLES2Implementation part of this |
979 # command. | 984 # command. |
980 # impl_decl: Whether or not to generate the GLES2Implementation declaration | 985 # impl_decl: Whether or not to generate the GLES2Implementation declaration |
981 # for this command. | 986 # for this command. |
982 # needs_size: If true a data_size field is added to the command. | 987 # needs_size: If true a data_size field is added to the command. |
983 # data_type: The type of data the command uses. For PUTn or PUT types. | 988 # data_type: The type of data the command uses. For PUTn or PUT types. |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1303 'type': 'Is', | 1308 'type': 'Is', |
1304 'decoder_func': 'DoIsShader', | 1309 'decoder_func': 'DoIsShader', |
1305 'expectation': False, | 1310 'expectation': False, |
1306 }, | 1311 }, |
1307 'IsTexture': { | 1312 'IsTexture': { |
1308 'type': 'Is', | 1313 'type': 'Is', |
1309 'decoder_func': 'DoIsTexture', | 1314 'decoder_func': 'DoIsTexture', |
1310 'expectation': False, | 1315 'expectation': False, |
1311 }, | 1316 }, |
1312 'LinkProgram': {'decoder_func': 'DoLinkProgram'}, | 1317 'LinkProgram': {'decoder_func': 'DoLinkProgram'}, |
| 1318 'MapBufferSubData': {'gen_cmd': False}, |
| 1319 'MapTexSubImage2D': {'gen_cmd': False}, |
1313 'PixelStorei': {'type': 'Manual'}, | 1320 'PixelStorei': {'type': 'Manual'}, |
1314 'RenderbufferStorage': { | 1321 'RenderbufferStorage': { |
1315 'decoder_func': 'DoRenderbufferStorage', | 1322 'decoder_func': 'DoRenderbufferStorage', |
1316 'gl_test_func': 'glRenderbufferStorageEXT', | 1323 'gl_test_func': 'glRenderbufferStorageEXT', |
1317 'expectation': False, | 1324 'expectation': False, |
1318 }, | 1325 }, |
1319 'ReadPixels': { | 1326 'ReadPixels': { |
1320 'cmd_comment': | 1327 'cmd_comment': |
1321 '// ReadPixels has the result separated from the pixel buffer so that\n' | 1328 '// ReadPixels has the result separated from the pixel buffer so that\n' |
1322 '// it is easier to specify the result going to some specific place\n' | 1329 '// it is easier to specify the result going to some specific place\n' |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1408 'Uniform4fv': { | 1415 'Uniform4fv': { |
1409 'type': 'PUTn', | 1416 'type': 'PUTn', |
1410 'data_type': 'GLfloat', | 1417 'data_type': 'GLfloat', |
1411 'count': 4, | 1418 'count': 4, |
1412 'decoder_func': 'DoUniform4fv', | 1419 'decoder_func': 'DoUniform4fv', |
1413 }, | 1420 }, |
1414 'Uniform4iv': {'type': 'PUTn', 'data_type': 'GLint', 'count': 4}, | 1421 'Uniform4iv': {'type': 'PUTn', 'data_type': 'GLint', 'count': 4}, |
1415 'UniformMatrix2fv': {'type': 'PUTn', 'data_type': 'GLfloat', 'count': 4}, | 1422 'UniformMatrix2fv': {'type': 'PUTn', 'data_type': 'GLfloat', 'count': 4}, |
1416 'UniformMatrix3fv': {'type': 'PUTn', 'data_type': 'GLfloat', 'count': 9}, | 1423 'UniformMatrix3fv': {'type': 'PUTn', 'data_type': 'GLfloat', 'count': 9}, |
1417 'UniformMatrix4fv': {'type': 'PUTn', 'data_type': 'GLfloat', 'count': 16}, | 1424 'UniformMatrix4fv': {'type': 'PUTn', 'data_type': 'GLfloat', 'count': 16}, |
| 1425 'UnmapBufferSubData': {'gen_cmd': False}, |
| 1426 'UnmapTexSubImage2D': {'gen_cmd': False}, |
1418 'UseProgram': {'decoder_func': 'DoUseProgram', 'unit_test': False}, | 1427 'UseProgram': {'decoder_func': 'DoUseProgram', 'unit_test': False}, |
1419 'ValidateProgram': {'decoder_func': 'DoValidateProgram'}, | 1428 'ValidateProgram': {'decoder_func': 'DoValidateProgram'}, |
1420 'VertexAttrib1f': {'decoder_func': 'DoVertexAttrib1f'}, | 1429 'VertexAttrib1f': {'decoder_func': 'DoVertexAttrib1f'}, |
1421 'VertexAttrib1fv': { | 1430 'VertexAttrib1fv': { |
1422 'type': 'PUT', | 1431 'type': 'PUT', |
1423 'data_type': 'GLfloat', | 1432 'data_type': 'GLfloat', |
1424 'count': 1, | 1433 'count': 1, |
1425 'decoder_func': 'DoVertexAttrib1fv', | 1434 'decoder_func': 'DoVertexAttrib1fv', |
1426 }, | 1435 }, |
1427 'VertexAttrib2f': {'decoder_func': 'DoVertexAttrib2f'}, | 1436 'VertexAttrib2f': {'decoder_func': 'DoVertexAttrib2f'}, |
(...skipping 3340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4768 arg.AddCmdArgs(cmd_args) | 4777 arg.AddCmdArgs(cmd_args) |
4769 init_args = [] | 4778 init_args = [] |
4770 for arg in args_for_cmds: | 4779 for arg in args_for_cmds: |
4771 arg.AddInitArgs(init_args) | 4780 arg.AddInitArgs(init_args) |
4772 return_arg = CreateArg(return_type + " result") | 4781 return_arg = CreateArg(return_type + " result") |
4773 if return_arg: | 4782 if return_arg: |
4774 init_args.append(return_arg) | 4783 init_args.append(return_arg) |
4775 f = Function(func_name, func_name, func_info, return_type, args, | 4784 f = Function(func_name, func_name, func_info, return_type, args, |
4776 args_for_cmds, cmd_args, init_args, num_pointer_args) | 4785 args_for_cmds, cmd_args, init_args, num_pointer_args) |
4777 self.original_functions.append(f) | 4786 self.original_functions.append(f) |
4778 self.AddFunction(f) | 4787 gen_cmd = f.GetInfo('gen_cmd') |
4779 f.type_handler.AddImmediateFunction(self, f) | 4788 if gen_cmd == True or gen_cmd == None: |
4780 f.type_handler.AddBucketFunction(self, f) | 4789 self.AddFunction(f) |
| 4790 f.type_handler.AddImmediateFunction(self, f) |
| 4791 f.type_handler.AddBucketFunction(self, f) |
4781 | 4792 |
4782 self.Log("Auto Generated Functions : %d" % | 4793 self.Log("Auto Generated Functions : %d" % |
4783 len([f for f in self.functions if f.can_auto_generate or | 4794 len([f for f in self.functions if f.can_auto_generate or |
4784 (not f.IsType('') and not f.IsType('Custom') and | 4795 (not f.IsType('') and not f.IsType('Custom') and |
4785 not f.IsType('Todo'))])) | 4796 not f.IsType('Todo'))])) |
4786 | 4797 |
4787 funcs = [f for f in self.functions if not f.can_auto_generate and | 4798 funcs = [f for f in self.functions if not f.can_auto_generate and |
4788 (f.IsType('') or f.IsType('Custom') or f.IsType('Todo'))] | 4799 (f.IsType('') or f.IsType('Custom') or f.IsType('Todo'))] |
4789 self.Log("Non Auto Generated Functions: %d" % len(funcs)) | 4800 self.Log("Non Auto Generated Functions: %d" % len(funcs)) |
4790 | 4801 |
4791 for f in funcs: | 4802 for f in funcs: |
4792 self.Log(" %-10s %-20s gl%s" % (f.info.type, f.return_type, f.name)) | 4803 self.Log(" %-10s %-20s gl%s" % (f.info.type, f.return_type, f.name)) |
4793 | 4804 |
4794 def WriteCommandIds(self, filename): | 4805 def WriteCommandIds(self, filename): |
4795 """Writes the command buffer format""" | 4806 """Writes the command buffer format""" |
4796 file = CHeaderWriter(filename) | 4807 file = CHeaderWriter(filename) |
4797 file.Write("#define GLES2_COMMAND_LIST(OP) \\\n") | 4808 file.Write("#define GLES2_COMMAND_LIST(OP) \\\n") |
4798 by_id = {} | 4809 by_id = {} |
4799 for func in self.functions: | 4810 for func in self.functions: |
4800 if not func.name in _CMD_ID_TABLE: | 4811 if True: |
4801 self.Error("Command %s not in _CMD_ID_TABLE" % func.name) | 4812 #gen_cmd = func.GetInfo('gen_cmd') |
4802 by_id[_CMD_ID_TABLE[func.name]] = func | 4813 #if gen_cmd == True or gen_cmd == None: |
| 4814 if not func.name in _CMD_ID_TABLE: |
| 4815 self.Error("Command %s not in _CMD_ID_TABLE" % func.name) |
| 4816 by_id[_CMD_ID_TABLE[func.name]] = func |
4803 for id in sorted(by_id.keys()): | 4817 for id in sorted(by_id.keys()): |
4804 file.Write(" %-60s /* %d */ \\\n" % | 4818 file.Write(" %-60s /* %d */ \\\n" % |
4805 ("OP(%s)" % by_id[id].name, id)) | 4819 ("OP(%s)" % by_id[id].name, id)) |
4806 file.Write("\n") | 4820 file.Write("\n") |
4807 | 4821 |
4808 file.Write("enum CommandId {\n") | 4822 file.Write("enum CommandId {\n") |
4809 file.Write(" kStartPoint = cmd::kLastCommonId, " | 4823 file.Write(" kStartPoint = cmd::kLastCommonId, " |
4810 "// All GLES2 commands start after this.\n") | 4824 "// All GLES2 commands start after this.\n") |
4811 file.Write("#define GLES2_CMD_OP(name) k ## name,\n") | 4825 file.Write("#define GLES2_CMD_OP(name) k ## name,\n") |
4812 file.Write(" GLES2_COMMAND_LIST(GLES2_CMD_OP)\n") | 4826 file.Write(" GLES2_COMMAND_LIST(GLES2_CMD_OP)\n") |
4813 file.Write("#undef GLES2_CMD_OP\n") | 4827 file.Write("#undef GLES2_CMD_OP\n") |
4814 file.Write(" kNumCommands\n") | 4828 file.Write(" kNumCommands\n") |
4815 file.Write("};\n") | 4829 file.Write("};\n") |
4816 file.Write("\n") | 4830 file.Write("\n") |
4817 file.Close() | 4831 file.Close() |
4818 | 4832 |
4819 def WriteFormat(self, filename): | 4833 def WriteFormat(self, filename): |
4820 """Writes the command buffer format""" | 4834 """Writes the command buffer format""" |
4821 file = CHeaderWriter(filename) | 4835 file = CHeaderWriter(filename) |
4822 for func in self.functions: | 4836 for func in self.functions: |
4823 func.WriteStruct(file) | 4837 if True: |
| 4838 #gen_cmd = func.GetInfo('gen_cmd') |
| 4839 #if gen_cmd == True or gen_cmd == None: |
| 4840 func.WriteStruct(file) |
4824 file.Write("\n") | 4841 file.Write("\n") |
4825 file.Close() | 4842 file.Close() |
4826 | 4843 |
4827 def WriteDocs(self, filename): | 4844 def WriteDocs(self, filename): |
4828 """Writes the command buffer doc version of the commands""" | 4845 """Writes the command buffer doc version of the commands""" |
4829 file = CWriter(filename) | 4846 file = CWriter(filename) |
4830 for func in self.functions: | 4847 for func in self.functions: |
4831 func.WriteDocs(file) | 4848 if True: |
| 4849 #gen_cmd = func.GetInfo('gen_cmd') |
| 4850 #if gen_cmd == True or gen_cmd == None: |
| 4851 func.WriteDocs(file) |
4832 file.Write("\n") | 4852 file.Write("\n") |
4833 file.Close() | 4853 file.Close() |
4834 | 4854 |
4835 def WriteFormatTest(self, filename): | 4855 def WriteFormatTest(self, filename): |
4836 """Writes the command buffer format test.""" | 4856 """Writes the command buffer format test.""" |
4837 file = CHeaderWriter( | 4857 file = CHeaderWriter( |
4838 filename, | 4858 filename, |
4839 "// This file contains unit tests for gles2 commmands\n" | 4859 "// This file contains unit tests for gles2 commmands\n" |
4840 "// It is included by gles2_cmd_format_test.cc\n" | 4860 "// It is included by gles2_cmd_format_test.cc\n" |
4841 "\n") | 4861 "\n") |
4842 | 4862 |
4843 for func in self.functions: | 4863 for func in self.functions: |
4844 func.WriteFormatTest(file) | 4864 if True: |
| 4865 #gen_cmd = func.GetInfo('gen_cmd') |
| 4866 #if gen_cmd == True or gen_cmd == None: |
| 4867 func.WriteFormatTest(file) |
4845 | 4868 |
4846 file.Close() | 4869 file.Close() |
4847 | 4870 |
4848 def WriteCommandIdTest(self, filename): | 4871 def WriteCommandIdTest(self, filename): |
4849 """Writes the command id test.""" | 4872 """Writes the command id test.""" |
4850 file = CHeaderWriter( | 4873 file = CHeaderWriter( |
4851 filename, | 4874 filename, |
4852 "// This file contains unit tests for gles2 commmand ids\n") | 4875 "// This file contains unit tests for gles2 commmand ids\n") |
4853 | 4876 |
4854 file.Write("// *** These IDs MUST NOT CHANGE!!! ***\n") | 4877 file.Write("// *** These IDs MUST NOT CHANGE!!! ***\n") |
4855 file.Write("// Changing them will break all client programs.\n") | 4878 file.Write("// Changing them will break all client programs.\n") |
4856 file.Write("TEST(GLES2CommandIdTest, CommandIdsMatch) {\n") | 4879 file.Write("TEST(GLES2CommandIdTest, CommandIdsMatch) {\n") |
4857 for func in self.functions: | 4880 for func in self.functions: |
4858 if not func.name in _CMD_ID_TABLE: | 4881 if True: |
4859 self.Error("Command %s not in _CMD_ID_TABLE" % func.name) | 4882 #gen_cmd = func.GetInfo('gen_cmd') |
4860 file.Write(" COMPILE_ASSERT(%s::kCmdId == %d,\n" % | 4883 #if gen_cmd == True or gen_cmd == None: |
4861 (func.name, _CMD_ID_TABLE[func.name])) | 4884 if not func.name in _CMD_ID_TABLE: |
4862 file.Write(" GLES2_%s_kCmdId_mismatch);\n" % func.name) | 4885 self.Error("Command %s not in _CMD_ID_TABLE" % func.name) |
| 4886 file.Write(" COMPILE_ASSERT(%s::kCmdId == %d,\n" % |
| 4887 (func.name, _CMD_ID_TABLE[func.name])) |
| 4888 file.Write(" GLES2_%s_kCmdId_mismatch);\n" % func.name) |
4863 | 4889 |
4864 file.Write("}\n") | 4890 file.Write("}\n") |
4865 file.Write("\n") | 4891 file.Write("\n") |
4866 file.Close() | 4892 file.Close() |
4867 | 4893 |
4868 def WriteCmdHelperHeader(self, filename): | 4894 def WriteCmdHelperHeader(self, filename): |
4869 """Writes the gles2 command helper.""" | 4895 """Writes the gles2 command helper.""" |
4870 file = CHeaderWriter(filename) | 4896 file = CHeaderWriter(filename) |
4871 | 4897 |
4872 for func in self.functions: | 4898 for func in self.functions: |
4873 func.WriteCmdHelper(file) | 4899 if True: |
| 4900 #gen_cmd = func.GetInfo('gen_cmd') |
| 4901 #if gen_cmd == True or gen_cmd == None: |
| 4902 func.WriteCmdHelper(file) |
4874 | 4903 |
4875 file.Close() | 4904 file.Close() |
4876 | 4905 |
4877 def WriteServiceImplementation(self, filename): | 4906 def WriteServiceImplementation(self, filename): |
4878 """Writes the service decorder implementation.""" | 4907 """Writes the service decorder implementation.""" |
4879 file = CHeaderWriter( | 4908 file = CHeaderWriter( |
4880 filename, | 4909 filename, |
4881 "// It is included by gles2_cmd_decoder.cc\n") | 4910 "// It is included by gles2_cmd_decoder.cc\n") |
4882 | 4911 |
4883 for func in self.functions: | 4912 for func in self.functions: |
4884 func.WriteServiceImplementation(file) | 4913 if True: |
| 4914 #gen_cmd = func.GetInfo('gen_cmd') |
| 4915 #if gen_cmd == True or gen_cmd == None: |
| 4916 func.WriteServiceImplementation(file) |
4885 | 4917 |
4886 file.Close() | 4918 file.Close() |
4887 | 4919 |
4888 def WriteServiceUnitTests(self, filename): | 4920 def WriteServiceUnitTests(self, filename): |
4889 """Writes the service decorder unit tests.""" | 4921 """Writes the service decorder unit tests.""" |
4890 num_tests = len(self.functions) | 4922 num_tests = len(self.functions) |
4891 step = (num_tests + 1) / 2 | 4923 step = (num_tests + 1) / 2 |
4892 count = 0 | 4924 count = 0 |
4893 for test_num in range(0, num_tests, step): | 4925 for test_num in range(0, num_tests, step): |
4894 count += 1 | 4926 count += 1 |
4895 name = filename % count | 4927 name = filename % count |
4896 file = CHeaderWriter( | 4928 file = CHeaderWriter( |
4897 name, | 4929 name, |
4898 "// It is included by gles2_cmd_decoder_unittest_%d.cc\n" % count) | 4930 "// It is included by gles2_cmd_decoder_unittest_%d.cc\n" % count) |
4899 file.SetFileNum(count) | 4931 file.SetFileNum(count) |
4900 end = test_num + step | 4932 end = test_num + step |
4901 if end > num_tests: | 4933 if end > num_tests: |
4902 end = num_tests | 4934 end = num_tests |
4903 for idx in range(test_num, end): | 4935 for idx in range(test_num, end): |
4904 func = self.functions[idx] | 4936 func = self.functions[idx] |
4905 if func.GetInfo('unit_test') == False: | 4937 if True: |
4906 file.Write("// TODO(gman): %s\n" % func.name) | 4938 #gen_cmd = func.GetInfo('gen_cmd') |
4907 else: | 4939 #if gen_cmd == True or gen_cmd == None: |
4908 func.WriteServiceUnitTest(file) | 4940 if func.GetInfo('unit_test') == False: |
| 4941 file.Write("// TODO(gman): %s\n" % func.name) |
| 4942 else: |
| 4943 func.WriteServiceUnitTest(file) |
4909 | 4944 |
4910 file.Close() | 4945 file.Close() |
4911 | 4946 |
4912 | 4947 |
4913 def WriteGLES2CLibImplementation(self, filename): | 4948 def WriteGLES2CLibImplementation(self, filename): |
4914 """Writes the GLES2 c lib implementation.""" | 4949 """Writes the GLES2 c lib implementation.""" |
4915 file = CHeaderWriter( | 4950 file = CHeaderWriter( |
4916 filename, | 4951 filename, |
4917 "// These functions emluate GLES2 over command buffers.\n") | 4952 "// These functions emluate GLES2 over command buffers.\n") |
4918 | 4953 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5020 | 5055 |
5021 if options.generate_docs: | 5056 if options.generate_docs: |
5022 gen.WriteDocs("docs/gles2_cmd_format_docs_autogen.h") | 5057 gen.WriteDocs("docs/gles2_cmd_format_docs_autogen.h") |
5023 | 5058 |
5024 if gen.errors > 0: | 5059 if gen.errors > 0: |
5025 print "%d errors" % gen.errors | 5060 print "%d errors" % gen.errors |
5026 sys.exit(1) | 5061 sys.exit(1) |
5027 | 5062 |
5028 if __name__ == '__main__': | 5063 if __name__ == '__main__': |
5029 main(sys.argv[1:]) | 5064 main(sys.argv[1:]) |
OLD | NEW |