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

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

Issue 780433006: Add framebuffer object related commands to command buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tex
Patch Set: Created 6 years 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
« no previous file with comments | « gpu/GLES2/gl2chromium_autogen.h ('k') | gpu/command_buffer/client/gles2_c_lib_autogen.h » ('j') | no next file with comments »
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 itertools 8 import itertools
9 import os 9 import os
10 import os.path 10 import os.path
(...skipping 1999 matching lines...) Expand 10 before | Expand all | Expand 10 after
2010 'decoder_func': 'DoGetVertexAttribiv', 2010 'decoder_func': 'DoGetVertexAttribiv',
2011 'expectation': False, 2011 'expectation': False,
2012 'client_test': False, 2012 'client_test': False,
2013 }, 2013 },
2014 'GetVertexAttribPointerv': { 2014 'GetVertexAttribPointerv': {
2015 'type': 'Custom', 2015 'type': 'Custom',
2016 'data_transfer_methods': ['shm'], 2016 'data_transfer_methods': ['shm'],
2017 'result': ['SizedResult<GLuint>'], 2017 'result': ['SizedResult<GLuint>'],
2018 'client_test': False, 2018 'client_test': False,
2019 }, 2019 },
2020 'InvalidateFramebuffer': {
2021 'type': 'PUTn',
2022 'count': 1,
2023 'client_test': False,
2024 'unit_test': False,
2025 'unsafe': True,
2026 },
2027 'InvalidateSubFramebuffer': {
2028 'type': 'PUTn',
2029 'count': 1,
2030 'client_test': False,
2031 'unit_test': False,
2032 'unsafe': True,
2033 },
2020 'IsBuffer': { 2034 'IsBuffer': {
2021 'type': 'Is', 2035 'type': 'Is',
2022 'decoder_func': 'DoIsBuffer', 2036 'decoder_func': 'DoIsBuffer',
2023 'expectation': False, 2037 'expectation': False,
2024 }, 2038 },
2025 'IsEnabled': { 2039 'IsEnabled': {
2026 'type': 'Is', 2040 'type': 'Is',
2027 'decoder_func': 'DoIsEnabled', 2041 'decoder_func': 'DoIsEnabled',
2028 'impl_func': False, 2042 'impl_func': False,
2029 'expectation': False, 2043 'expectation': False,
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
2126 }, 2140 },
2127 'RenderbufferStorageMultisampleEXT': { 2141 'RenderbufferStorageMultisampleEXT': {
2128 'cmd_comment': 2142 'cmd_comment':
2129 '// GL_EXT_multisampled_render_to_texture\n', 2143 '// GL_EXT_multisampled_render_to_texture\n',
2130 'decoder_func': 'DoRenderbufferStorageMultisampleEXT', 2144 'decoder_func': 'DoRenderbufferStorageMultisampleEXT',
2131 'gl_test_func': 'glRenderbufferStorageMultisampleEXT', 2145 'gl_test_func': 'glRenderbufferStorageMultisampleEXT',
2132 'expectation': False, 2146 'expectation': False,
2133 'unit_test': False, 2147 'unit_test': False,
2134 'extension_flag': 'multisampled_render_to_texture', 2148 'extension_flag': 'multisampled_render_to_texture',
2135 }, 2149 },
2150 'ReadBuffer': {
2151 'unsafe': True,
2152 },
2136 'ReadPixels': { 2153 'ReadPixels': {
2137 'cmd_comment': 2154 'cmd_comment':
2138 '// ReadPixels has the result separated from the pixel buffer so that\n' 2155 '// ReadPixels has the result separated from the pixel buffer so that\n'
2139 '// it is easier to specify the result going to some specific place\n' 2156 '// it is easier to specify the result going to some specific place\n'
2140 '// that exactly fits the rectangle of pixels.\n', 2157 '// that exactly fits the rectangle of pixels.\n',
2141 'type': 'Custom', 2158 'type': 'Custom',
2142 'data_transfer_methods': ['shm'], 2159 'data_transfer_methods': ['shm'],
2143 'impl_func': False, 2160 'impl_func': False,
2144 'client_test': False, 2161 'client_test': False,
2145 'cmd_args': 2162 'cmd_args':
(...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after
3142 func.WriteHandlerImplementation(file) 3159 func.WriteHandlerImplementation(file)
3143 file.Write(" return error::kNoError;\n") 3160 file.Write(" return error::kNoError;\n")
3144 file.Write("}\n") 3161 file.Write("}\n")
3145 file.Write("\n") 3162 file.Write("\n")
3146 3163
3147 def WriteImmediateServiceImplementation(self, func, file): 3164 def WriteImmediateServiceImplementation(self, func, file):
3148 """Writes the service implementation for an immediate version of command.""" 3165 """Writes the service implementation for an immediate version of command."""
3149 self.WriteServiceHandlerFunctionHeader(func, file) 3166 self.WriteServiceHandlerFunctionHeader(func, file)
3150 self.WriteHandlerExtensionCheck(func, file) 3167 self.WriteHandlerExtensionCheck(func, file)
3151 self.WriteHandlerDeferReadWrite(func, file); 3168 self.WriteHandlerDeferReadWrite(func, file);
3152 last_arg = func.GetLastOriginalArg() 3169 for arg in func.GetOriginalArgs():
3153 all_but_last_arg = func.GetOriginalArgs()[:-1] 3170 if arg.IsPointer():
3154 for arg in all_but_last_arg: 3171 self.WriteGetDataSizeCode(func, file)
3155 arg.WriteGetCode(file) 3172 arg.WriteGetCode(file)
3156 self.WriteGetDataSizeCode(func, file)
3157 last_arg.WriteGetCode(file)
3158 func.WriteHandlerValidation(file) 3173 func.WriteHandlerValidation(file)
3159 func.WriteHandlerImplementation(file) 3174 func.WriteHandlerImplementation(file)
3160 file.Write(" return error::kNoError;\n") 3175 file.Write(" return error::kNoError;\n")
3161 file.Write("}\n") 3176 file.Write("}\n")
3162 file.Write("\n") 3177 file.Write("\n")
3163 3178
3164 def WriteBucketServiceImplementation(self, func, file): 3179 def WriteBucketServiceImplementation(self, func, file):
3165 """Writes the service implementation for a bucket version of command.""" 3180 """Writes the service implementation for a bucket version of command."""
3166 self.WriteServiceHandlerFunctionHeader(func, file) 3181 self.WriteServiceHandlerFunctionHeader(func, file)
3167 self.WriteHandlerExtensionCheck(func, file) 3182 self.WriteHandlerExtensionCheck(func, file)
(...skipping 2402 matching lines...) Expand 10 before | Expand all | Expand 10 after
5570 cmds::%(name)sImmediate cmd; 5585 cmds::%(name)sImmediate cmd;
5571 %(type)s data[%(count_param)d][%(count)d]; 5586 %(type)s data[%(count_param)d][%(count)d];
5572 }; 5587 };
5573 5588
5574 Cmds expected; 5589 Cmds expected;
5575 for (int ii = 0; ii < %(count_param)d; ++ii) { 5590 for (int ii = 0; ii < %(count_param)d; ++ii) {
5576 for (int jj = 0; jj < %(count)d; ++jj) { 5591 for (int jj = 0; jj < %(count)d; ++jj) {
5577 data[ii][jj] = static_cast<%(type)s>(ii * %(count)d + jj); 5592 data[ii][jj] = static_cast<%(type)s>(ii * %(count)d + jj);
5578 } 5593 }
5579 } 5594 }
5580 expected.cmd.Init(%(cmd_args)s, &data[0][0]); 5595 expected.cmd.Init(%(cmd_args)s);
5581 gl_->%(name)s(%(args)s, &data[0][0]); 5596 gl_->%(name)s(%(args)s);
5582 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); 5597 EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
5583 } 5598 }
5584 """ 5599 """
5585 cmd_arg_strings = [ 5600 cmd_arg_strings = []
5586 arg.GetValidClientSideCmdArg(func) for arg in func.GetCmdArgs()[0:-2] 5601 for arg in func.GetCmdArgs():
5587 ] 5602 if arg.name.endswith("_shm_id"):
5603 cmd_arg_strings.append("&data[0][0]")
5604 elif arg.name.endswith("_shm_offset"):
5605 continue
5606 else:
5607 cmd_arg_strings.append(arg.GetValidClientSideCmdArg(func))
5588 gl_arg_strings = [] 5608 gl_arg_strings = []
5589 count_param = 0 5609 count_param = 0
5590 for arg in func.GetOriginalArgs()[0:-1]: 5610 for arg in func.GetOriginalArgs():
5591 valid_value = arg.GetValidClientSideArg(func) 5611 if arg.IsPointer():
5612 valid_value = "&data[0][0]"
Ken Russell (switch to Gerrit) 2014/12/04 01:42:56 These changes seem really over-specialized, and sc
5613 else:
5614 valid_value = arg.GetValidClientSideArg(func)
5592 gl_arg_strings.append(valid_value) 5615 gl_arg_strings.append(valid_value)
5593 if arg.name == "count": 5616 if arg.name == "count":
5594 count_param = int(valid_value) 5617 count_param = int(valid_value)
5595 file.Write(code % { 5618 file.Write(code % {
5596 'name': func.name, 5619 'name': func.name,
5597 'type': self.GetArrayType(func), 5620 'type': self.GetArrayType(func),
5598 'count': self.GetArrayCount(func), 5621 'count': self.GetArrayCount(func),
5599 'args': ", ".join(gl_arg_strings), 5622 'args': ", ".join(gl_arg_strings),
5600 'cmd_args': ", ".join(cmd_arg_strings), 5623 'cmd_args': ", ".join(cmd_arg_strings),
5601 'count_param': count_param, 5624 'count_param': count_param,
5602 }) 5625 })
5603 5626
5604 # Test constants for invalid values, as they are not tested by the 5627 # Test constants for invalid values, as they are not tested by the
5605 # service. 5628 # service.
5606 constants = [ 5629 constants = [
5607 arg for arg in func.GetOriginalArgs()[0:-1] if arg.IsConstant() 5630 arg for arg in func.GetOriginalArgs()[0:-1] if arg.IsConstant()
5608 ] 5631 ]
5609 if not constants: 5632 if not constants:
5610 return 5633 return
5611 5634
5612 code = """ 5635 code = """
5613 TEST_F(GLES2ImplementationTest, %(name)sInvalidConstantArg%(invalid_index)d) { 5636 TEST_F(GLES2ImplementationTest, %(name)sInvalidConstantArg%(invalid_index)d) {
5614 %(type)s data[%(count_param)d][%(count)d] = {{0}}; 5637 %(type)s data[%(count_param)d][%(count)d] = {{0}};
5615 for (int ii = 0; ii < %(count_param)d; ++ii) { 5638 for (int ii = 0; ii < %(count_param)d; ++ii) {
5616 for (int jj = 0; jj < %(count)d; ++jj) { 5639 for (int jj = 0; jj < %(count)d; ++jj) {
5617 data[ii][jj] = static_cast<%(type)s>(ii * %(count)d + jj); 5640 data[ii][jj] = static_cast<%(type)s>(ii * %(count)d + jj);
5618 } 5641 }
5619 } 5642 }
5620 gl_->%(name)s(%(args)s, &data[0][0]); 5643 gl_->%(name)s(%(args)s);
5621 EXPECT_TRUE(NoCommandsWritten()); 5644 EXPECT_TRUE(NoCommandsWritten());
5622 EXPECT_EQ(%(gl_error)s, CheckError()); 5645 EXPECT_EQ(%(gl_error)s, CheckError());
5623 } 5646 }
5624 """ 5647 """
5625 for invalid_arg in constants: 5648 for invalid_arg in constants:
5626 gl_arg_strings = [] 5649 gl_arg_strings = []
5627 invalid = invalid_arg.GetInvalidArg(func) 5650 invalid = invalid_arg.GetInvalidArg(func)
5628 for arg in func.GetOriginalArgs()[0:-1]: 5651 for arg in func.GetOriginalArgs():
5629 if arg is invalid_arg: 5652 if arg is invalid_arg:
5630 gl_arg_strings.append(invalid[0]) 5653 gl_arg_strings.append(invalid[0])
5654 elif arg.IsPointer():
5655 gl_arg_strings.append("&data[0][0]")
5631 else: 5656 else:
5632 valid_value = arg.GetValidClientSideArg(func) 5657 valid_value = arg.GetValidClientSideArg(func)
5633 gl_arg_strings.append(valid_value) 5658 gl_arg_strings.append(valid_value)
5634 if arg.name == "count": 5659 if arg.name == "count":
5635 count_param = int(valid_value) 5660 count_param = int(valid_value)
5636 5661
5637 file.Write(code % { 5662 file.Write(code % {
5638 'name': func.name, 5663 'name': func.name,
5639 'invalid_index': func.GetOriginalArgs().index(invalid_arg), 5664 'invalid_index': func.GetOriginalArgs().index(invalid_arg),
5640 'type': self.GetArrayType(func), 5665 'type': self.GetArrayType(func),
(...skipping 22 matching lines...) Expand all
5663 def WriteImmediateCmdSetHeader(self, func, file): 5688 def WriteImmediateCmdSetHeader(self, func, file):
5664 """Overrriden from TypeHandler.""" 5689 """Overrriden from TypeHandler."""
5665 file.Write(" void SetHeader(GLsizei count) {\n") 5690 file.Write(" void SetHeader(GLsizei count) {\n")
5666 file.Write( 5691 file.Write(
5667 " header.SetCmdByTotalSize<ValueType>(ComputeSize(count));\n") 5692 " header.SetCmdByTotalSize<ValueType>(ComputeSize(count));\n")
5668 file.Write(" }\n") 5693 file.Write(" }\n")
5669 file.Write("\n") 5694 file.Write("\n")
5670 5695
5671 def WriteImmediateCmdInit(self, func, file): 5696 def WriteImmediateCmdInit(self, func, file):
5672 """Overrriden from TypeHandler.""" 5697 """Overrriden from TypeHandler."""
5673 last_arg = func.GetLastOriginalArg() 5698 file.Write(" void Init(%s) {\n" %
5674 file.Write(" void Init(%s, %s _%s) {\n" % 5699 func.MakeTypedInitString("_"))
5675 (func.MakeTypedCmdArgString("_"),
5676 last_arg.type, last_arg.name))
5677 file.Write(" SetHeader(_count);\n") 5700 file.Write(" SetHeader(_count);\n")
5678 args = func.GetCmdArgs() 5701 args = func.GetCmdArgs()
5679 for arg in args: 5702 for arg in args:
5680 file.Write(" %s = _%s;\n" % (arg.name, arg.name)) 5703 file.Write(" %s = _%s;\n" % (arg.name, arg.name))
5681 file.Write(" memcpy(ImmediateDataAddress(this),\n") 5704 file.Write(" memcpy(ImmediateDataAddress(this),\n")
5682 file.Write(" _%s, ComputeDataSize(_count));\n" % last_arg.name) 5705 pointer_arg = None
5706 for arg in func.GetOriginalArgs():
5707 if arg.IsPointer():
5708 pointer_arg = arg
5709 break
5710 file.Write(" _%s, ComputeDataSize(_count));\n" % pointer_arg.name)
5683 file.Write(" }\n") 5711 file.Write(" }\n")
5684 file.Write("\n") 5712 file.Write("\n")
5685 5713
5686 def WriteImmediateCmdSet(self, func, file): 5714 def WriteImmediateCmdSet(self, func, file):
5687 """Overrriden from TypeHandler.""" 5715 """Overrriden from TypeHandler."""
5688 last_arg = func.GetLastOriginalArg() 5716 file.Write(" void* Set(void* cmd%s) {\n" %
5689 copy_args = func.MakeCmdArgString("_", False) 5717 func.MakeTypedInitString("_", True))
5690 file.Write(" void* Set(void* cmd%s, %s _%s) {\n" % 5718 file.Write(" static_cast<ValueType*>(cmd)->Init(%s);\n" %
5691 (func.MakeTypedCmdArgString("_", True), 5719 func.MakeInitString("_"))
5692 last_arg.type, last_arg.name))
5693 file.Write(" static_cast<ValueType*>(cmd)->Init(%s, _%s);\n" %
5694 (copy_args, last_arg.name))
5695 file.Write(" const uint32_t size = ComputeSize(_count);\n") 5720 file.Write(" const uint32_t size = ComputeSize(_count);\n")
5696 file.Write(" return NextImmediateCmdAddressTotalSize<ValueType>(" 5721 file.Write(" return NextImmediateCmdAddressTotalSize<ValueType>("
5697 "cmd, size);\n") 5722 "cmd, size);\n")
5698 file.Write(" }\n") 5723 file.Write(" }\n")
5699 file.Write("\n") 5724 file.Write("\n")
5700 5725
5701 def WriteImmediateCmdHelper(self, func, file): 5726 def WriteImmediateCmdHelper(self, func, file):
5702 """Overrriden from TypeHandler.""" 5727 """Overrriden from TypeHandler."""
5703 code = """ void %(name)s(%(typed_args)s) { 5728 code = """ void %(name)s(%(typed_args)s) {
5704 const uint32_t size = gles2::cmds::%(name)s::ComputeSize(count); 5729 const uint32_t size = gles2::cmds::%(name)s::ComputeSize(count);
5705 gles2::cmds::%(name)s* c = 5730 gles2::cmds::%(name)s* c =
5706 GetImmediateCmdSpaceTotalSize<gles2::cmds::%(name)s>(size); 5731 GetImmediateCmdSpaceTotalSize<gles2::cmds::%(name)s>(size);
5707 if (c) { 5732 if (c) {
5708 c->Init(%(args)s); 5733 c->Init(%(args)s);
5709 } 5734 }
5710 } 5735 }
5711 5736
5712 """ 5737 """
5713 file.Write(code % { 5738 file.Write(code % {
5714 "name": func.name, 5739 "name": func.name,
5715 "typed_args": func.MakeTypedInitString(""), 5740 "typed_args": func.MakeTypedInitString(""),
5716 "args": func.MakeInitString("") 5741 "args": func.MakeInitString("")
5717 }) 5742 })
5718 5743
5719 def WriteImmediateFormatTest(self, func, file): 5744 def WriteImmediateFormatTest(self, func, file):
5720 """Overrriden from TypeHandler.""" 5745 """Overrriden from TypeHandler."""
5721 args = func.GetCmdArgs() 5746 args = func.GetOriginalArgs()
5722 count_param = 0 5747 count_param = 0
5723 for arg in args: 5748 for arg in args:
5724 if arg.name == "count": 5749 if arg.name == "count":
5725 count_param = int(arg.GetValidClientSideCmdArg(func)) 5750 count_param = int(arg.GetValidClientSideCmdArg(func))
5726 file.Write("TEST_F(GLES2FormatTest, %s) {\n" % func.name) 5751 file.Write("TEST_F(GLES2FormatTest, %s) {\n" % func.name)
5727 file.Write(" const int kSomeBaseValueToTestWith = 51;\n") 5752 file.Write(" const int kSomeBaseValueToTestWith = 51;\n")
5728 file.Write(" static %s data[] = {\n" % self.GetArrayType(func)) 5753 file.Write(" static %s data[] = {\n" % self.GetArrayType(func))
5729 for v in range(0, self.GetArrayCount(func) * count_param): 5754 for v in range(0, self.GetArrayCount(func) * count_param):
5730 file.Write(" static_cast<%s>(kSomeBaseValueToTestWith + %d),\n" % 5755 file.Write(" static_cast<%s>(kSomeBaseValueToTestWith + %d),\n" %
5731 (self.GetArrayType(func), v)) 5756 (self.GetArrayType(func), v))
5732 file.Write(" };\n") 5757 file.Write(" };\n")
5733 file.Write(" cmds::%s& cmd = *GetBufferAs<cmds::%s>();\n" % 5758 file.Write(" cmds::%s& cmd = *GetBufferAs<cmds::%s>();\n" %
5734 (func.name, func.name)) 5759 (func.name, func.name))
5735 file.Write(" const GLsizei kNumElements = %d;\n" % count_param) 5760 file.Write(" const GLsizei kNumElements = %d;\n" % count_param)
5736 file.Write(" const size_t kExpectedCmdSize =\n") 5761 file.Write(" const size_t kExpectedCmdSize =\n")
5737 file.Write(" sizeof(cmd) + kNumElements * sizeof(%s) * %d;\n" % 5762 file.Write(" sizeof(cmd) + kNumElements * sizeof(%s) * %d;\n" %
5738 (self.GetArrayType(func), self.GetArrayCount(func))) 5763 (self.GetArrayType(func), self.GetArrayCount(func)))
5739 file.Write(" void* next_cmd = cmd.Set(\n") 5764 file.Write(" void* next_cmd = cmd.Set(\n")
5740 file.Write(" &cmd") 5765 file.Write(" &cmd")
5741 for value, arg in enumerate(args): 5766 for value, arg in enumerate(args):
5742 file.Write(",\n static_cast<%s>(%d)" % (arg.type, value + 1)) 5767 if arg.IsPointer():
5743 file.Write(",\n data);\n") 5768 file.Write(",\n data")
5769 elif arg.type == "GLboolean":
5770 continue
5771 else:
5772 file.Write(",\n static_cast<%s>(%d)" % (arg.type, value + 1))
5773 file.Write(");\n")
5744 file.Write(" EXPECT_EQ(static_cast<uint32_t>(cmds::%s::kCmdId),\n" % 5774 file.Write(" EXPECT_EQ(static_cast<uint32_t>(cmds::%s::kCmdId),\n" %
5745 func.name) 5775 func.name)
5746 file.Write(" cmd.header.command);\n") 5776 file.Write(" cmd.header.command);\n")
5747 file.Write(" EXPECT_EQ(kExpectedCmdSize, cmd.header.size * 4u);\n") 5777 file.Write(" EXPECT_EQ(kExpectedCmdSize, cmd.header.size * 4u);\n")
5748 for value, arg in enumerate(args): 5778 for value, arg in enumerate(args):
5779 if arg.IsPointer() or arg.type == "GLboolean":
5780 continue
5749 file.Write(" EXPECT_EQ(static_cast<%s>(%d), cmd.%s);\n" % 5781 file.Write(" EXPECT_EQ(static_cast<%s>(%d), cmd.%s);\n" %
5750 (arg.type, value + 1, arg.name)) 5782 (arg.type, value + 1, arg.name))
5751 file.Write(" CheckBytesWrittenMatchesExpectedSize(\n") 5783 file.Write(" CheckBytesWrittenMatchesExpectedSize(\n")
5752 file.Write(" next_cmd, sizeof(cmd) +\n") 5784 file.Write(" next_cmd, sizeof(cmd) +\n")
5753 file.Write(" RoundSizeToMultipleOfEntries(sizeof(data)));\n") 5785 file.Write(" RoundSizeToMultipleOfEntries(sizeof(data)));\n")
5754 file.Write(" // TODO(gman): Check that data was inserted;\n") 5786 file.Write(" // TODO(gman): Check that data was inserted;\n")
5755 file.Write("}\n") 5787 file.Write("}\n")
5756 file.Write("\n") 5788 file.Write("\n")
5757 5789
5758 5790
(...skipping 1229 matching lines...) Expand 10 before | Expand all | Expand 10 after
6988 self.args_for_cmds = self.original_args[:] 7020 self.args_for_cmds = self.original_args[:]
6989 7021
6990 self.return_type = info['return_type'] 7022 self.return_type = info['return_type']
6991 if self.return_type != 'void': 7023 if self.return_type != 'void':
6992 self.return_arg = CreateArg(info['return_type'] + " result") 7024 self.return_arg = CreateArg(info['return_type'] + " result")
6993 else: 7025 else:
6994 self.return_arg = None 7026 self.return_arg = None
6995 7027
6996 self.num_pointer_args = sum( 7028 self.num_pointer_args = sum(
6997 [1 for arg in self.args_for_cmds if arg.IsPointer()]) 7029 [1 for arg in self.args_for_cmds if arg.IsPointer()])
7030 if self.num_pointer_args > 0:
7031 for arg in reversed(self.original_args):
7032 if arg.IsPointer():
7033 self.last_original_pointer_arg = arg
7034 break
7035 else:
7036 self.last_original_pointer_arg = None
6998 self.info = info 7037 self.info = info
6999 self.type_handler = self.type_handlers[info['type']] 7038 self.type_handler = self.type_handlers[info['type']]
7000 self.can_auto_generate = (self.num_pointer_args == 0 and 7039 self.can_auto_generate = (self.num_pointer_args == 0 and
7001 info['return_type'] == "void") 7040 info['return_type'] == "void")
7002 self.InitFunction() 7041 self.InitFunction()
7003 7042
7004 def ParseArgs(self, arg_string): 7043 def ParseArgs(self, arg_string):
7005 """Parses a function arg string.""" 7044 """Parses a function arg string."""
7006 args = [] 7045 args = []
7007 parts = arg_string.split(',') 7046 parts = arg_string.split(',')
(...skipping 1885 matching lines...) Expand 10 before | Expand all | Expand 10 after
8893 Format(gen.generated_cpp_filenames) 8932 Format(gen.generated_cpp_filenames)
8894 8933
8895 if gen.errors > 0: 8934 if gen.errors > 0:
8896 print "%d errors" % gen.errors 8935 print "%d errors" % gen.errors
8897 return 1 8936 return 1
8898 return 0 8937 return 0
8899 8938
8900 8939
8901 if __name__ == '__main__': 8940 if __name__ == '__main__':
8902 sys.exit(main(sys.argv[1:])) 8941 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « gpu/GLES2/gl2chromium_autogen.h ('k') | gpu/command_buffer/client/gles2_c_lib_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698