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 itertools | 8 import itertools |
9 import os | 9 import os |
10 import os.path | 10 import os.path |
(...skipping 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1422 'SyncFlags': { | 1422 'SyncFlags': { |
1423 'type': 'GLbitfield', | 1423 'type': 'GLbitfield', |
1424 'is_complete': True, | 1424 'is_complete': True, |
1425 'valid': [ | 1425 'valid': [ |
1426 '0', | 1426 '0', |
1427 ], | 1427 ], |
1428 'invalid': [ | 1428 'invalid': [ |
1429 '1', | 1429 '1', |
1430 ], | 1430 ], |
1431 }, | 1431 }, |
| 1432 'SyncFlushFlags': { |
| 1433 'type': 'GLbitfield', |
| 1434 'is_complete': True, |
| 1435 'valid': [ |
| 1436 'GL_SYNC_FLUSH_COMMANDS_BIT', |
| 1437 '0', |
| 1438 ], |
| 1439 'invalid': [ |
| 1440 '0xFFFFFFFF', |
| 1441 ], |
| 1442 }, |
1432 } | 1443 } |
1433 | 1444 |
1434 # This table specifies the different pepper interfaces that are supported for | 1445 # This table specifies the different pepper interfaces that are supported for |
1435 # GL commands. 'dev' is true if it's a dev interface. | 1446 # GL commands. 'dev' is true if it's a dev interface. |
1436 _PEPPER_INTERFACES = [ | 1447 _PEPPER_INTERFACES = [ |
1437 {'name': '', 'dev': False}, | 1448 {'name': '', 'dev': False}, |
1438 {'name': 'InstancedArrays', 'dev': False}, | 1449 {'name': 'InstancedArrays', 'dev': False}, |
1439 {'name': 'FramebufferBlit', 'dev': False}, | 1450 {'name': 'FramebufferBlit', 'dev': False}, |
1440 {'name': 'FramebufferMultisample', 'dev': False}, | 1451 {'name': 'FramebufferMultisample', 'dev': False}, |
1441 {'name': 'ChromiumEnableFeature', 'dev': False}, | 1452 {'name': 'ChromiumEnableFeature', 'dev': False}, |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1635 }, | 1646 }, |
1636 'ClearDepthf': { | 1647 'ClearDepthf': { |
1637 'type': 'StateSet', | 1648 'type': 'StateSet', |
1638 'state': 'ClearDepthf', | 1649 'state': 'ClearDepthf', |
1639 'decoder_func': 'glClearDepth', | 1650 'decoder_func': 'glClearDepth', |
1640 'gl_test_func': 'glClearDepth', | 1651 'gl_test_func': 'glClearDepth', |
1641 'valid_args': { | 1652 'valid_args': { |
1642 '0': '0.5f' | 1653 '0': '0.5f' |
1643 }, | 1654 }, |
1644 }, | 1655 }, |
| 1656 'ClientWaitSync': { |
| 1657 'type': 'Custom', |
| 1658 'data_transfer_methods': ['shm'], |
| 1659 'cmd_args': 'GLuint sync, GLbitfieldSyncFlushFlags flags, ' |
| 1660 'GLuint timeout_0, GLuint timeout_1, GLenum* result', |
| 1661 'unsafe': True, |
| 1662 'result': ['GLenum'], |
| 1663 }, |
1645 'ColorMask': { | 1664 'ColorMask': { |
1646 'type': 'StateSet', | 1665 'type': 'StateSet', |
1647 'state': 'ColorMask', | 1666 'state': 'ColorMask', |
1648 'no_gl': True, | 1667 'no_gl': True, |
1649 'expectation': False, | 1668 'expectation': False, |
1650 }, | 1669 }, |
1651 'ConsumeTextureCHROMIUM': { | 1670 'ConsumeTextureCHROMIUM': { |
1652 'decoder_func': 'DoConsumeTextureCHROMIUM', | 1671 'decoder_func': 'DoConsumeTextureCHROMIUM', |
1653 'impl_func': False, | 1672 'impl_func': False, |
1654 'type': 'PUT', | 1673 'type': 'PUT', |
(...skipping 7309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8964 file.Write("\n") | 8983 file.Write("\n") |
8965 file.Close() | 8984 file.Close() |
8966 self.generated_cpp_filenames.append(file.filename) | 8985 self.generated_cpp_filenames.append(file.filename) |
8967 | 8986 |
8968 def WriteFormat(self, filename): | 8987 def WriteFormat(self, filename): |
8969 """Writes the command buffer format""" | 8988 """Writes the command buffer format""" |
8970 file = CHeaderWriter(filename) | 8989 file = CHeaderWriter(filename) |
8971 # Forward declaration of a few enums used in constant argument | 8990 # Forward declaration of a few enums used in constant argument |
8972 # to avoid including GL header files. | 8991 # to avoid including GL header files. |
8973 enum_defines = { | 8992 enum_defines = { |
8974 'GL_SYNC_GPU_COMMANDS_COMPLETE': 0x9117, | 8993 'GL_SYNC_GPU_COMMANDS_COMPLETE': '0x9117', |
| 8994 'GL_SYNC_FLUSH_COMMANDS_BIT': '0x00000001', |
8975 } | 8995 } |
8976 file.Write('\n') | 8996 file.Write('\n') |
8977 for enum in enum_defines: | 8997 for enum in enum_defines: |
8978 file.Write("#define %s 0x%x\n" % (enum, enum_defines[enum])) | 8998 file.Write("#define %s %s\n" % (enum, enum_defines[enum])) |
8979 file.Write('\n') | 8999 file.Write('\n') |
8980 for func in self.functions: | 9000 for func in self.functions: |
8981 if True: | 9001 if True: |
8982 #gen_cmd = func.GetInfo('gen_cmd') | 9002 #gen_cmd = func.GetInfo('gen_cmd') |
8983 #if gen_cmd == True or gen_cmd == None: | 9003 #if gen_cmd == True or gen_cmd == None: |
8984 func.WriteStruct(file) | 9004 func.WriteStruct(file) |
8985 file.Write("\n") | 9005 file.Write("\n") |
8986 file.Close() | 9006 file.Close() |
8987 self.generated_cpp_filenames.append(file.filename) | 9007 self.generated_cpp_filenames.append(file.filename) |
8988 | 9008 |
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10132 Format(gen.generated_cpp_filenames) | 10152 Format(gen.generated_cpp_filenames) |
10133 | 10153 |
10134 if gen.errors > 0: | 10154 if gen.errors > 0: |
10135 print "%d errors" % gen.errors | 10155 print "%d errors" % gen.errors |
10136 return 1 | 10156 return 1 |
10137 return 0 | 10157 return 0 |
10138 | 10158 |
10139 | 10159 |
10140 if __name__ == '__main__': | 10160 if __name__ == '__main__': |
10141 sys.exit(main(sys.argv[1:])) | 10161 sys.exit(main(sys.argv[1:])) |
OLD | NEW |