| 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 GLES2 command buffers.""" | 6 """code generator for GLES2 command buffers.""" |
| 7 | 7 |
| 8 import os | 8 import os |
| 9 import os.path | 9 import os.path |
| 10 import sys | 10 import sys |
| (...skipping 4614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4625 'GLintptr': 'int32', | 4625 'GLintptr': 'int32', |
| 4626 'GLsizei': 'int32', | 4626 'GLsizei': 'int32', |
| 4627 'GLsizeiptr': 'int32', | 4627 'GLsizeiptr': 'int32', |
| 4628 'GLfloat': 'float', | 4628 'GLfloat': 'float', |
| 4629 'GLclampf': 'float', | 4629 'GLclampf': 'float', |
| 4630 } | 4630 } |
| 4631 need_validation_ = ['GLsizei*', 'GLboolean*', 'GLenum*', 'GLint*'] | 4631 need_validation_ = ['GLsizei*', 'GLboolean*', 'GLenum*', 'GLint*'] |
| 4632 | 4632 |
| 4633 def __init__(self, name, type): | 4633 def __init__(self, name, type): |
| 4634 self.name = name | 4634 self.name = name |
| 4635 self.optional = type.endswith("Optional*") |
| 4636 if self.optional: |
| 4637 type = type[:-9] + "*" |
| 4638 print name, type |
| 4635 self.type = type | 4639 self.type = type |
| 4636 | 4640 |
| 4637 if type in self.cmd_type_map_: | 4641 if type in self.cmd_type_map_: |
| 4638 self.cmd_type = self.cmd_type_map_[type] | 4642 self.cmd_type = self.cmd_type_map_[type] |
| 4639 else: | 4643 else: |
| 4640 self.cmd_type = 'uint32' | 4644 self.cmd_type = 'uint32' |
| 4641 | 4645 |
| 4642 def IsPointer(self): | 4646 def IsPointer(self): |
| 4643 """Returns true if argument is a pointer.""" | 4647 """Returns true if argument is a pointer.""" |
| 4644 return False | 4648 return False |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4705 def WriteDestinationInitalizationValidation(self, file, func): | 4709 def WriteDestinationInitalizationValidation(self, file, func): |
| 4706 """Writes the client side destintion initialization validation.""" | 4710 """Writes the client side destintion initialization validation.""" |
| 4707 pass | 4711 pass |
| 4708 | 4712 |
| 4709 def WriteDestinationInitalizationValidatationIfNeeded(self, file, func): | 4713 def WriteDestinationInitalizationValidatationIfNeeded(self, file, func): |
| 4710 """Writes the client side destintion initialization validation if needed.""" | 4714 """Writes the client side destintion initialization validation if needed.""" |
| 4711 parts = self.type.split(" ") | 4715 parts = self.type.split(" ") |
| 4712 if len(parts) > 1: | 4716 if len(parts) > 1: |
| 4713 return | 4717 return |
| 4714 if parts[0] in self.need_validation_: | 4718 if parts[0] in self.need_validation_: |
| 4715 file.Write(" GPU_CLIENT_VALIDATE_DESTINATION_INITALIZATION(%s, %s);\n" % | 4719 file.Write( |
| 4716 (self.type[:-1], self.name)) | 4720 " GPU_CLIENT_VALIDATE_DESTINATION_%sINITALIZATION(%s, %s);\n" % |
| 4721 ("OPTIONAL_" if self.optional else "", self.type[:-1], self.name)) |
| 4717 | 4722 |
| 4718 | 4723 |
| 4719 def WriteGetAddress(self, file): | 4724 def WriteGetAddress(self, file): |
| 4720 """Writes the code to get the address this argument refers to.""" | 4725 """Writes the code to get the address this argument refers to.""" |
| 4721 pass | 4726 pass |
| 4722 | 4727 |
| 4723 def GetImmediateVersion(self): | 4728 def GetImmediateVersion(self): |
| 4724 """Gets the immediate version of this argument.""" | 4729 """Gets the immediate version of this argument.""" |
| 4725 return self | 4730 return self |
| 4726 | 4731 |
| (...skipping 1611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6338 gen.WriteCommonUtilsImpl("common/gles2_cmd_utils_implementation_autogen.h") | 6343 gen.WriteCommonUtilsImpl("common/gles2_cmd_utils_implementation_autogen.h") |
| 6339 | 6344 |
| 6340 if gen.errors > 0: | 6345 if gen.errors > 0: |
| 6341 print "%d errors" % gen.errors | 6346 print "%d errors" % gen.errors |
| 6342 return 1 | 6347 return 1 |
| 6343 return 0 | 6348 return 0 |
| 6344 | 6349 |
| 6345 | 6350 |
| 6346 if __name__ == '__main__': | 6351 if __name__ == '__main__': |
| 6347 sys.exit(main(sys.argv[1:])) | 6352 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |