Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: gpu/command_buffer/build_gles2_cmd_buffer.py

Issue 9601020: Add OpenGL occlusion query support to pepper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update to trunk Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ppapi/c/dev/ppb_opengles2ext_dev.h » ('j') | ppapi/c/dev/ppb_opengles2ext_dev.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 743 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 754
755 # This table specifies the different pepper interfaces that are supported for 755 # This table specifies the different pepper interfaces that are supported for
756 # GL commands. 'dev' is true if it's a dev interface. 756 # GL commands. 'dev' is true if it's a dev interface.
757 _PEPPER_INTERFACES = [ 757 _PEPPER_INTERFACES = [
758 {'name': '', 'dev': False}, 758 {'name': '', 'dev': False},
759 {'name': 'InstancedArrays', 'dev': True}, 759 {'name': 'InstancedArrays', 'dev': True},
760 {'name': 'FramebufferBlit', 'dev': True}, 760 {'name': 'FramebufferBlit', 'dev': True},
761 {'name': 'FramebufferMultisample', 'dev': True}, 761 {'name': 'FramebufferMultisample', 'dev': True},
762 {'name': 'ChromiumEnableFeature', 'dev': True}, 762 {'name': 'ChromiumEnableFeature', 'dev': True},
763 {'name': 'ChromiumMapSub', 'dev': True}, 763 {'name': 'ChromiumMapSub', 'dev': True},
764 {'name': 'Query', 'dev': True},
764 ] 765 ]
765 766
766 # This table specifies types and other special data for the commands that 767 # This table specifies types and other special data for the commands that
767 # will be generated. 768 # will be generated.
768 # 769 #
769 # cmd_comment: A comment added to the cmd format. 770 # cmd_comment: A comment added to the cmd format.
770 # type: defines which handler will be used to generate code. 771 # type: defines which handler will be used to generate code.
771 # decoder_func: defines which function to call in the decoder to execute the 772 # decoder_func: defines which function to call in the decoder to execute the
772 # corresponding GL command. If not specified the GL command will 773 # corresponding GL command. If not specified the GL command will
773 # be called directly. 774 # be called directly.
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after
1590 'extension': True, 1591 'extension': True,
1591 'unit_test': False, 1592 'unit_test': False,
1592 'pepper_interface': 'InstancedArrays', 1593 'pepper_interface': 'InstancedArrays',
1593 }, 1594 },
1594 'GenQueriesEXT': { 1595 'GenQueriesEXT': {
1595 'type': 'GENn', 1596 'type': 'GENn',
1596 'gl_test_func': 'glGenQueriesARB', 1597 'gl_test_func': 'glGenQueriesARB',
1597 'resource_type': 'Query', 1598 'resource_type': 'Query',
1598 'resource_types': 'Queries', 1599 'resource_types': 'Queries',
1599 'unit_test': False, 1600 'unit_test': False,
1601 'pepper_interface': 'Query',
1600 }, 1602 },
1601 'DeleteQueriesEXT': { 1603 'DeleteQueriesEXT': {
1602 'type': 'DELn', 1604 'type': 'DELn',
1603 'gl_test_func': 'glDeleteQueriesARB', 1605 'gl_test_func': 'glDeleteQueriesARB',
1604 'resource_type': 'Query', 1606 'resource_type': 'Query',
1605 'resource_types': 'Queries', 1607 'resource_types': 'Queries',
1606 'unit_test': False, 1608 'unit_test': False,
1609 'pepper_interface': 'Query',
1607 }, 1610 },
1608 'IsQueryEXT': { 1611 'IsQueryEXT': {
1609 'gen_cmd': False, 1612 'gen_cmd': False,
1610 'client_test': False, 1613 'client_test': False,
1614 'pepper_interface': 'Query',
1611 }, 1615 },
1612 'BeginQueryEXT': { 1616 'BeginQueryEXT': {
1613 'type': 'Manual', 1617 'type': 'Manual',
1614 'cmd_args': 'GLenumQueryTarget target, GLidQuery id, void* sync_data', 1618 'cmd_args': 'GLenumQueryTarget target, GLidQuery id, void* sync_data',
1615 'immediate': False, 1619 'immediate': False,
1616 'gl_test_func': 'glBeginQuery', 1620 'gl_test_func': 'glBeginQuery',
1621 'pepper_interface': 'Query',
1617 }, 1622 },
1618 'EndQueryEXT': { 1623 'EndQueryEXT': {
1619 'type': 'Manual', 1624 'type': 'Manual',
1620 'cmd_args': 'GLenumQueryTarget target, GLuint submit_count', 1625 'cmd_args': 'GLenumQueryTarget target, GLuint submit_count',
1621 'gl_test_func': 'glEndnQuery', 1626 'gl_test_func': 'glEndnQuery',
1622 'client_test': False, 1627 'client_test': False,
1628 'pepper_interface': 'Query',
1623 }, 1629 },
1624 'GetQueryivEXT': { 1630 'GetQueryivEXT': {
1625 'gen_cmd': False, 1631 'gen_cmd': False,
1626 'client_test': False, 1632 'client_test': False,
1627 'gl_test_func': 'glGetQueryiv', 1633 'gl_test_func': 'glGetQueryiv',
1634 'pepper_interface': 'Query',
1628 }, 1635 },
1629 'GetQueryObjectuivEXT': { 1636 'GetQueryObjectuivEXT': {
1630 'gen_cmd': False, 1637 'gen_cmd': False,
1631 'client_test': False, 1638 'client_test': False,
1632 'gl_test_func': 'glGetQueryObjectuiv', 1639 'gl_test_func': 'glGetQueryObjectuiv',
1640 'pepper_interface': 'Query',
1633 }, 1641 },
1634 } 1642 }
1635 1643
1636 1644
1637 def SplitWords(input_string): 1645 def SplitWords(input_string):
1638 """Transforms a input_string into a list of lower-case components. 1646 """Transforms a input_string into a list of lower-case components.
1639 1647
1640 Args: 1648 Args:
1641 input_string: the input string. 1649 input_string: the input string.
1642 1650
(...skipping 3451 matching lines...) Expand 10 before | Expand all | Expand 10 after
5094 valid_args = self.GetInfo('valid_args') 5102 valid_args = self.GetInfo('valid_args')
5095 if valid_args and str(index) in valid_args: 5103 if valid_args and str(index) in valid_args:
5096 return valid_args[str(index)] 5104 return valid_args[str(index)]
5097 return None 5105 return None
5098 5106
5099 def AddInfo(self, name, value): 5107 def AddInfo(self, name, value):
5100 """Adds an info.""" 5108 """Adds an info."""
5101 setattr(self.info, name, value) 5109 setattr(self.info, name, value)
5102 5110
5103 def IsCoreGLFunction(self): 5111 def IsCoreGLFunction(self):
5104 return not self.GetInfo('extension') 5112 return (not self.GetInfo('extension') and
5113 not self.GetInfo('pepper_interface'))
5105 5114
5106 def InPepperInterface(self, interface): 5115 def InPepperInterface(self, interface):
5107 ext = self.GetInfo('pepper_interface') 5116 ext = self.GetInfo('pepper_interface')
5108 if not interface.GetName(): 5117 if not interface.GetName():
5109 return self.IsCoreGLFunction() 5118 return self.IsCoreGLFunction()
5110 return ext == interface.GetName() 5119 return ext == interface.GetName()
5111 5120
5112 def InAnyPepperExtension(self): 5121 def InAnyPepperExtension(self):
5113 return self.IsCoreGLFunction() or self.GetInfo('pepper_interface') 5122 return self.IsCoreGLFunction() or self.GetInfo('pepper_interface')
5114 5123
(...skipping 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after
6196 gen.WriteCommonUtilsImpl("common/gles2_cmd_utils_implementation_autogen.h") 6205 gen.WriteCommonUtilsImpl("common/gles2_cmd_utils_implementation_autogen.h")
6197 6206
6198 if gen.errors > 0: 6207 if gen.errors > 0:
6199 print "%d errors" % gen.errors 6208 print "%d errors" % gen.errors
6200 return 1 6209 return 1
6201 return 0 6210 return 0
6202 6211
6203 6212
6204 if __name__ == '__main__': 6213 if __name__ == '__main__':
6205 sys.exit(main(sys.argv[1:])) 6214 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | ppapi/c/dev/ppb_opengles2ext_dev.h » ('j') | ppapi/c/dev/ppb_opengles2ext_dev.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698