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

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

Issue 10893034: Add ENUM value to synthesized GL_INVALID_ENUM errors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 | gpu/command_buffer/client/gles2_implementation.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 os 8 import os
9 import os.path 9 import os.path
10 import sys 10 import sys
(...skipping 4828 matching lines...) Expand 10 before | Expand all | Expand 10 after
4839 4839
4840 self.local_type = type 4840 self.local_type = type
4841 self.gl_error = gl_error 4841 self.gl_error = gl_error
4842 name = type[len(gl_type):] 4842 name = type[len(gl_type):]
4843 self.type_name = name 4843 self.type_name = name
4844 self.enum_info = _ENUM_LISTS[name] 4844 self.enum_info = _ENUM_LISTS[name]
4845 4845
4846 def WriteValidationCode(self, file, func): 4846 def WriteValidationCode(self, file, func):
4847 file.Write(" if (!validators_->%s.IsValid(%s)) {\n" % 4847 file.Write(" if (!validators_->%s.IsValid(%s)) {\n" %
4848 (ToUnderscore(self.type_name), self.name)) 4848 (ToUnderscore(self.type_name), self.name))
4849 file.Write(" SetGLError(%s, \"gl%s\", \"%s %s\");\n" % 4849 if self.gl_error == "GL_INVALID_ENUM":
4850 (self.gl_error, func.original_name, self.name, self.gl_error)) 4850 file.Write(
4851 " SetGLErrorInvalidEnum(\"gl%s\", %s, \"%s\");\n" %
4852 (func.original_name, self.name, self.name))
4853 else:
4854 file.Write(
4855 " SetGLError(%s, \"gl%s\", \"%s %s\");\n" %
4856 (self.gl_error, func.original_name, self.name, self.gl_error))
4851 file.Write(" return error::kNoError;\n") 4857 file.Write(" return error::kNoError;\n")
4852 file.Write(" }\n") 4858 file.Write(" }\n")
4853 4859
4854 def GetValidArg(self, func, offset, index): 4860 def GetValidArg(self, func, offset, index):
4855 valid_arg = func.GetValidArg(offset) 4861 valid_arg = func.GetValidArg(offset)
4856 if valid_arg != None: 4862 if valid_arg != None:
4857 return valid_arg 4863 return valid_arg
4858 if 'valid' in self.enum_info: 4864 if 'valid' in self.enum_info:
4859 valid = self.enum_info['valid'] 4865 valid = self.enum_info['valid']
4860 num_valid = len(valid) 4866 num_valid = len(valid)
(...skipping 1481 matching lines...) Expand 10 before | Expand all | Expand 10 after
6342 gen.WriteCommonUtilsImpl("common/gles2_cmd_utils_implementation_autogen.h") 6348 gen.WriteCommonUtilsImpl("common/gles2_cmd_utils_implementation_autogen.h")
6343 6349
6344 if gen.errors > 0: 6350 if gen.errors > 0:
6345 print "%d errors" % gen.errors 6351 print "%d errors" % gen.errors
6346 return 1 6352 return 1
6347 return 0 6353 return 0
6348 6354
6349 6355
6350 if __name__ == '__main__': 6356 if __name__ == '__main__':
6351 sys.exit(main(sys.argv[1:])) 6357 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/client/gles2_implementation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698