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

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

Issue 1949303003: Improve indexed gl state related GL commands. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tex
Patch Set: fix a DCHECK failure Created 4 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_implementation_impl_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 976 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 'valid_es3': [ 987 'valid_es3': [
988 'GL_TEXTURE_2D_ARRAY', 988 'GL_TEXTURE_2D_ARRAY',
989 'GL_TEXTURE_3D', 989 'GL_TEXTURE_3D',
990 ], 990 ],
991 'invalid': [ 991 'invalid': [
992 'GL_PROXY_TEXTURE_CUBE_MAP', 992 'GL_PROXY_TEXTURE_CUBE_MAP',
993 ] 993 ]
994 }, 994 },
995 'ReadBuffer': { 995 'ReadBuffer': {
996 'type': 'GLenum', 996 'type': 'GLenum',
997 'is_complete': True,
998 'valid': [ 997 'valid': [
999 'GL_NONE', 998 'GL_NONE',
1000 'GL_BACK', 999 'GL_BACK',
1001 'GL_COLOR_ATTACHMENT0', 1000 'GL_COLOR_ATTACHMENT0',
1002 'GL_COLOR_ATTACHMENT1', 1001 'GL_COLOR_ATTACHMENT1',
1003 'GL_COLOR_ATTACHMENT2', 1002 'GL_COLOR_ATTACHMENT2',
1004 'GL_COLOR_ATTACHMENT3', 1003 'GL_COLOR_ATTACHMENT3',
1005 'GL_COLOR_ATTACHMENT4', 1004 'GL_COLOR_ATTACHMENT4',
1006 'GL_COLOR_ATTACHMENT5', 1005 'GL_COLOR_ATTACHMENT5',
1007 'GL_COLOR_ATTACHMENT6', 1006 'GL_COLOR_ATTACHMENT6',
(...skipping 1876 matching lines...) Expand 10 before | Expand all | Expand 10 after
2884 'gl_test_func': 'glFramebufferTexture2DMultisampleEXT', 2883 'gl_test_func': 'glFramebufferTexture2DMultisampleEXT',
2885 'expectation': False, 2884 'expectation': False,
2886 'unit_test': False, 2885 'unit_test': False,
2887 'extension': 'EXT_multisampled_render_to_texture', 2886 'extension': 'EXT_multisampled_render_to_texture',
2888 'extension_flag': 'multisampled_render_to_texture', 2887 'extension_flag': 'multisampled_render_to_texture',
2889 'trace_level': 1, 2888 'trace_level': 1,
2890 }, 2889 },
2891 'FramebufferTextureLayer': { 2890 'FramebufferTextureLayer': {
2892 'decoder_func': 'DoFramebufferTextureLayer', 2891 'decoder_func': 'DoFramebufferTextureLayer',
2893 'unsafe': True, 2892 'unsafe': True,
2893 'unit_test': False,
2894 'trace_level': 1, 2894 'trace_level': 1,
2895 }, 2895 },
2896 'GenerateMipmap': { 2896 'GenerateMipmap': {
2897 'decoder_func': 'DoGenerateMipmap', 2897 'decoder_func': 'DoGenerateMipmap',
2898 'gl_test_func': 'glGenerateMipmapEXT', 2898 'gl_test_func': 'glGenerateMipmapEXT',
2899 'trace_level': 1, 2899 'trace_level': 1,
2900 }, 2900 },
2901 'GenBuffers': { 2901 'GenBuffers': {
2902 'type': 'GENn', 2902 'type': 'GENn',
2903 'gl_test_func': 'glGenBuffersARB', 2903 'gl_test_func': 'glGenBuffersARB',
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
3080 }, 3080 },
3081 'GetIntegerv': { 3081 'GetIntegerv': {
3082 'type': 'GETn', 3082 'type': 'GETn',
3083 'result': ['SizedResult<GLint>'], 3083 'result': ['SizedResult<GLint>'],
3084 'decoder_func': 'DoGetIntegerv', 3084 'decoder_func': 'DoGetIntegerv',
3085 'client_test': False, 3085 'client_test': False,
3086 }, 3086 },
3087 'GetInteger64i_v': { 3087 'GetInteger64i_v': {
3088 'type': 'GETn', 3088 'type': 'GETn',
3089 'result': ['SizedResult<GLint64>'], 3089 'result': ['SizedResult<GLint64>'],
3090 'decoder_func': 'DoGetInteger64i_v',
3091 'shadowed': True,
3090 'client_test': False, 3092 'client_test': False,
3093 'unit_test': False,
3091 'unsafe': True 3094 'unsafe': True
3092 }, 3095 },
3093 'GetIntegeri_v': { 3096 'GetIntegeri_v': {
3094 'type': 'GETn', 3097 'type': 'GETn',
3095 'result': ['SizedResult<GLint>'], 3098 'result': ['SizedResult<GLint>'],
3099 'decoder_func': 'DoGetIntegeri_v',
3100 'shadowed': True,
3096 'client_test': False, 3101 'client_test': False,
3102 'unit_test': False,
3097 'unsafe': True 3103 'unsafe': True
3098 }, 3104 },
3099 'GetInternalformativ': { 3105 'GetInternalformativ': {
3100 'type': 'Custom', 3106 'type': 'Custom',
3101 'data_transfer_methods': ['shm'], 3107 'data_transfer_methods': ['shm'],
3102 'result': ['SizedResult<GLint>'], 3108 'result': ['SizedResult<GLint>'],
3103 'cmd_args': 3109 'cmd_args':
3104 'GLenumRenderBufferTarget target, GLenumRenderBufferFormat format, ' 3110 'GLenumRenderBufferTarget target, GLenumRenderBufferFormat format, '
3105 'GLenumInternalFormatParameter pname, GLint* params', 3111 'GLenumInternalFormatParameter pname, GLint* params',
3106 'unsafe': True, 3112 'unsafe': True,
(...skipping 5880 matching lines...) Expand 10 before | Expand all | Expand 10 after
8987 self.type_name = name 8993 self.type_name = name
8988 self.named_type = NamedType(_NAMED_TYPE_INFO[name]) 8994 self.named_type = NamedType(_NAMED_TYPE_INFO[name])
8989 8995
8990 def IsConstant(self): 8996 def IsConstant(self):
8991 return self.named_type.IsConstant() 8997 return self.named_type.IsConstant()
8992 8998
8993 def GetConstantValue(self): 8999 def GetConstantValue(self):
8994 return self.named_type.GetConstantValue() 9000 return self.named_type.GetConstantValue()
8995 9001
8996 def WriteValidationCode(self, f, func): 9002 def WriteValidationCode(self, f, func):
8997 if func.IsUnsafe():
8998 return
8999 if self.named_type.IsConstant(): 9003 if self.named_type.IsConstant():
9000 return 9004 return
9001 f.write(" if (!validators_->%s.IsValid(%s)) {\n" % 9005 f.write(" if (!validators_->%s.IsValid(%s)) {\n" %
9002 (ToUnderscore(self.type_name), self.name)) 9006 (ToUnderscore(self.type_name), self.name))
9003 if self.gl_error == "GL_INVALID_ENUM": 9007 if self.gl_error == "GL_INVALID_ENUM":
9004 f.write( 9008 f.write(
9005 " LOCAL_SET_GL_ERROR_INVALID_ENUM(\"gl%s\", %s, \"%s\");\n" % 9009 " LOCAL_SET_GL_ERROR_INVALID_ENUM(\"gl%s\", %s, \"%s\");\n" %
9006 (func.original_name, self.name, self.name)) 9010 (func.original_name, self.name, self.name))
9007 else: 9011 else:
9008 f.write( 9012 f.write(
(...skipping 2523 matching lines...) Expand 10 before | Expand all | Expand 10 after
11532 Format(gen.generated_cpp_filenames) 11536 Format(gen.generated_cpp_filenames)
11533 11537
11534 if gen.errors > 0: 11538 if gen.errors > 0:
11535 print "%d errors" % gen.errors 11539 print "%d errors" % gen.errors
11536 return 1 11540 return 1
11537 return 0 11541 return 0
11538 11542
11539 11543
11540 if __name__ == '__main__': 11544 if __name__ == '__main__':
11541 sys.exit(main(sys.argv[1:])) 11545 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/client/gles2_implementation_impl_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698