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

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

Issue 7633060: Add option to not generate resources on bind in OpenGL ES (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nacl fix Created 9 years, 4 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 | « content/renderer/gpu/renderer_gl_context.cc ('k') | gpu/command_buffer/client/gles2_demo.cc » ('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/python 1 #!/usr/bin/python
2 # 2 #
3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """code generator for GLES2 command buffers.""" 7 """code generator for GLES2 command buffers."""
8 8
9 import os 9 import os
10 import os.path 10 import os.path
(...skipping 3071 matching lines...) Expand 10 before | Expand all | Expand 10 after
3082 """Overrriden from TypeHandler.""" 3082 """Overrriden from TypeHandler."""
3083 file.Write("%s %s(%s) {\n" % 3083 file.Write("%s %s(%s) {\n" %
3084 (func.return_type, func.original_name, 3084 (func.return_type, func.original_name,
3085 func.MakeTypedOriginalArgString(""))) 3085 func.MakeTypedOriginalArgString("")))
3086 func.WriteDestinationInitalizationValidation(file) 3086 func.WriteDestinationInitalizationValidation(file)
3087 self.WriteClientGLCallLog(func, file) 3087 self.WriteClientGLCallLog(func, file)
3088 for arg in func.GetOriginalArgs(): 3088 for arg in func.GetOriginalArgs():
3089 arg.WriteClientSideValidationCode(file, func) 3089 arg.WriteClientSideValidationCode(file, func)
3090 file.Write( 3090 file.Write(
3091 " GPU_CLIENT_DCHECK(%s != 0);\n" % func.GetOriginalArgs()[-1].name) 3091 " GPU_CLIENT_DCHECK(%s != 0);\n" % func.GetOriginalArgs()[-1].name)
3092 file.Write(" DeleteProgramOrShaderHelper(%s);\n" % 3092 file.Write(" %sHelper(%s);\n" %
3093 func.GetOriginalArgs()[-1].name) 3093 (func.original_name, func.GetOriginalArgs()[-1].name))
3094 file.Write(" helper_->%s(%s);\n" %
3095 (func.name, func.MakeCmdArgString("")))
3096 file.Write(" Flush();\n")
3097 file.Write("}\n") 3094 file.Write("}\n")
3098 file.Write("\n") 3095 file.Write("\n")
3099 3096
3100 3097
3101 class DELnHandler(TypeHandler): 3098 class DELnHandler(TypeHandler):
3102 """Handler for glDelete___ type functions.""" 3099 """Handler for glDelete___ type functions."""
3103 3100
3104 def __init__(self): 3101 def __init__(self):
3105 TypeHandler.__init__(self) 3102 TypeHandler.__init__(self)
3106 3103
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
3215 """ % func.GetOriginalArgs()[1].name) 3212 """ % func.GetOriginalArgs()[1].name)
3216 file.Write(""" GPU_CLIENT_DCHECK_CODE_BLOCK({ 3213 file.Write(""" GPU_CLIENT_DCHECK_CODE_BLOCK({
3217 for (GLsizei i = 0; i < n; ++i) { 3214 for (GLsizei i = 0; i < n; ++i) {
3218 GPU_DCHECK(%s[i] != 0); 3215 GPU_DCHECK(%s[i] != 0);
3219 } 3216 }
3220 }); 3217 });
3221 """ % func.GetOriginalArgs()[1].name) 3218 """ % func.GetOriginalArgs()[1].name)
3222 for arg in func.GetOriginalArgs(): 3219 for arg in func.GetOriginalArgs():
3223 arg.WriteClientSideValidationCode(file, func) 3220 arg.WriteClientSideValidationCode(file, func)
3224 code = """ %(name)sHelper(%(args)s); 3221 code = """ %(name)sHelper(%(args)s);
3225 helper_->%(name)sImmediate(%(args)s);
3226 Flush();
3227 } 3222 }
3228 3223
3229 """ 3224 """
3230 file.Write(code % args) 3225 file.Write(code % args)
3231 3226
3232 def WriteImmediateCmdComputeSize(self, func, file): 3227 def WriteImmediateCmdComputeSize(self, func, file):
3233 """Overrriden from TypeHandler.""" 3228 """Overrriden from TypeHandler."""
3234 file.Write(" static uint32 ComputeDataSize(GLsizei n) {\n") 3229 file.Write(" static uint32 ComputeDataSize(GLsizei n) {\n")
3235 file.Write( 3230 file.Write(
3236 " return static_cast<uint32>(sizeof(GLuint) * n); // NOLINT\n") 3231 " return static_cast<uint32>(sizeof(GLuint) * n); // NOLINT\n")
(...skipping 2760 matching lines...) Expand 10 before | Expand all | Expand 10 after
5997 5992
5998 if options.generate_docs: 5993 if options.generate_docs:
5999 gen.WriteDocs("docs/gles2_cmd_format_docs_autogen.h") 5994 gen.WriteDocs("docs/gles2_cmd_format_docs_autogen.h")
6000 5995
6001 if gen.errors > 0: 5996 if gen.errors > 0:
6002 print "%d errors" % gen.errors 5997 print "%d errors" % gen.errors
6003 sys.exit(1) 5998 sys.exit(1)
6004 5999
6005 if __name__ == '__main__': 6000 if __name__ == '__main__':
6006 main(sys.argv[1:]) 6001 main(sys.argv[1:])
OLDNEW
« no previous file with comments | « content/renderer/gpu/renderer_gl_context.cc ('k') | gpu/command_buffer/client/gles2_demo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698