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

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

Issue 289993002: Remove shm versions of immediate commands from command buffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@functions-with-extension-flag
Patch Set: try to avoid compiler warning on buffer overflow and template specialization linker problem with tw… Created 6 years, 7 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
« no previous file with comments | « no previous file | gpu/command_buffer/client/gles2_cmd_helper_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 2694 matching lines...) Expand 10 before | Expand all | Expand 10 after
2705 if func.GetInfo('needs_size') and not func.name.endswith('Bucket'): 2705 if func.GetInfo('needs_size') and not func.name.endswith('Bucket'):
2706 func.AddCmdArg(DataSizeArgument('data_size')) 2706 func.AddCmdArg(DataSizeArgument('data_size'))
2707 2707
2708 def AddImmediateFunction(self, generator, func): 2708 def AddImmediateFunction(self, generator, func):
2709 """Adds an immediate version of a function.""" 2709 """Adds an immediate version of a function."""
2710 # Generate an immediate command if there is only 1 pointer arg. 2710 # Generate an immediate command if there is only 1 pointer arg.
2711 immediate = func.GetInfo('immediate') # can be True, False or None 2711 immediate = func.GetInfo('immediate') # can be True, False or None
2712 if immediate == True or immediate == None: 2712 if immediate == True or immediate == None:
2713 if func.num_pointer_args == 1 or immediate: 2713 if func.num_pointer_args == 1 or immediate:
2714 generator.AddFunction(ImmediateFunction(func)) 2714 generator.AddFunction(ImmediateFunction(func))
2715 return True
2715 2716
2716 def AddBucketFunction(self, generator, func): 2717 def AddBucketFunction(self, generator, func):
2717 """Adds a bucket version of a function.""" 2718 """Adds a bucket version of a function."""
2718 # Generate an immediate command if there is only 1 pointer arg. 2719 # Generate an immediate command if there is only 1 pointer arg.
2719 bucket = func.GetInfo('bucket') # can be True, False or None 2720 bucket = func.GetInfo('bucket') # can be True, False or None
2720 if bucket: 2721 if bucket:
2721 generator.AddFunction(BucketFunction(func)) 2722 generator.AddFunction(BucketFunction(func))
2722 2723
2723 def WriteStruct(self, func, file): 2724 def WriteStruct(self, func, file):
2724 """Writes a structure that matches the arguments to a function.""" 2725 """Writes a structure that matches the arguments to a function."""
(...skipping 4580 matching lines...) Expand 10 before | Expand all | Expand 10 after
7305 7306
7306 f = Function(func_name, func_info) 7307 f = Function(func_name, func_info)
7307 self.original_functions.append(f) 7308 self.original_functions.append(f)
7308 7309
7309 #for arg in f.GetOriginalArgs(): 7310 #for arg in f.GetOriginalArgs():
7310 # if not isinstance(arg, EnumArgument) and arg.type == 'GLenum': 7311 # if not isinstance(arg, EnumArgument) and arg.type == 'GLenum':
7311 # self.Log("%s uses bare GLenum %s." % (func_name, arg.name)) 7312 # self.Log("%s uses bare GLenum %s." % (func_name, arg.name))
7312 7313
7313 gen_cmd = f.GetInfo('gen_cmd') 7314 gen_cmd = f.GetInfo('gen_cmd')
7314 if gen_cmd == True or gen_cmd == None: 7315 if gen_cmd == True or gen_cmd == None:
7315 self.AddFunction(f) 7316 if not f.type_handler.AddImmediateFunction(self, f):
7316 f.type_handler.AddImmediateFunction(self, f) 7317 self.AddFunction(f)
7317 f.type_handler.AddBucketFunction(self, f) 7318 f.type_handler.AddBucketFunction(self, f)
7318 7319
7319 self.Log("Auto Generated Functions : %d" % 7320 self.Log("Auto Generated Functions : %d" %
7320 len([f for f in self.functions if f.can_auto_generate or 7321 len([f for f in self.functions if f.can_auto_generate or
7321 (not f.IsType('') and not f.IsType('Custom') and 7322 (not f.IsType('') and not f.IsType('Custom') and
7322 not f.IsType('Todo'))])) 7323 not f.IsType('Todo'))]))
7323 7324
7324 funcs = [f for f in self.functions if not f.can_auto_generate and 7325 funcs = [f for f in self.functions if not f.can_auto_generate and
7325 (f.IsType('') or f.IsType('Custom') or f.IsType('Todo'))] 7326 (f.IsType('') or f.IsType('Custom') or f.IsType('Todo'))]
7326 self.Log("Non Auto Generated Functions: %d" % len(funcs)) 7327 self.Log("Non Auto Generated Functions: %d" % len(funcs))
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after
8337 "ppapi/shared_impl/ppb_opengles2_shared.cc"]) 8338 "ppapi/shared_impl/ppb_opengles2_shared.cc"])
8338 8339
8339 if gen.errors > 0: 8340 if gen.errors > 0:
8340 print "%d errors" % gen.errors 8341 print "%d errors" % gen.errors
8341 return 1 8342 return 1
8342 return 0 8343 return 0
8343 8344
8344 8345
8345 if __name__ == '__main__': 8346 if __name__ == '__main__':
8346 sys.exit(main(sys.argv[1:])) 8347 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/client/gles2_cmd_helper_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698