Chromium Code Reviews| Index: gpu/command_buffer/build_gles2_cmd_buffer.py |
| diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py |
| index 0cf742407ac37a461aa49f9aa0ff58ebb0be926d..2f571f4d5707ad0b047bed9b2651998c346d0e21 100755 |
| --- a/gpu/command_buffer/build_gles2_cmd_buffer.py |
| +++ b/gpu/command_buffer/build_gles2_cmd_buffer.py |
| @@ -2008,9 +2008,9 @@ _NAMED_TYPE_INFO = { |
| '5', |
| ], |
| }, |
| - 'ZeroOnly': { |
| + 'ZeroOnlyForES2': { |
|
piman
2015/11/17 23:40:06
What is the point of GLintZeroOnlyForES2 (as oppos
yunchao
2015/11/19 10:14:10
Yeah. The code in build_gles2_cmd_buffer.py seems
zmo
2015/11/19 19:15:00
ZeroOnlyForES2 is misleading. The code generator
yunchao
2015/11/23 10:44:39
Done.
|
| 'type': 'GLint', |
| - 'is_complete': True, |
| + 'is_constant_for_es2': True, |
| 'valid': [ |
| '0', |
| ], |
| @@ -8413,6 +8413,12 @@ class NamedType(object): |
| return len(self.GetValidValues()) == 1 |
| + def IsConstantForES2(self): |
| + if not 'is_constant_for_es2' in self.info: |
| + return False |
| + |
| + return len(self.GetValidValues()) == 1 |
| + |
| def GetConstantValue(self): |
| return self.GetValidValues()[0] |
| @@ -8454,6 +8460,10 @@ class Argument(object): |
| """Returns true if the argument has only one valid value.""" |
| return False |
| + def IsConstantForES2(self): |
| + """Returns true if the argument has only one valid value for ES2.""" |
| + return False |
| + |
| def AddCmdArgs(self, args): |
| """Adds command arguments for this argument to the given list.""" |
| if not self.IsConstant(): |
| @@ -8690,6 +8700,9 @@ class EnumBaseArgument(Argument): |
| def IsConstant(self): |
| return self.named_type.IsConstant() |
| + def IsConstantForES2(self): |
| + return self.named_type.IsConstantForES2() |
| + |
| def GetConstantValue(self): |
| return self.named_type.GetConstantValue() |
| @@ -8698,6 +8711,8 @@ class EnumBaseArgument(Argument): |
| return |
| if self.named_type.IsConstant(): |
| return |
| + if self.named_type.IsConstantForES2(): |
| + return |
| f.write(" if (!validators_->%s.IsValid(%s)) {\n" % |
| (ToUnderscore(self.type_name), self.name)) |
| if self.gl_error == "GL_INVALID_ENUM": |
| @@ -10648,6 +10663,8 @@ namespace mojo { |
| named_type = NamedType(_NAMED_TYPE_INFO[name]) |
| if named_type.IsConstant(): |
| continue |
| + if named_type.IsConstantForES2(): |
| + continue |
| f.write("ValueValidator<%s> %s;\n" % |
| (named_type.GetType(), ToUnderscore(name))) |
| f.write("\n") |
| @@ -10661,6 +10678,8 @@ namespace mojo { |
| named_type = NamedType(_NAMED_TYPE_INFO[name]) |
| if named_type.IsConstant(): |
| continue |
| + if named_type.IsConstantForES2(): |
| + continue |
| if named_type.GetValidValues(): |
| f.write("static const %s valid_%s_table[] = {\n" % |
| (named_type.GetType(), ToUnderscore(name))) |
| @@ -10688,6 +10707,8 @@ namespace mojo { |
| named_type = NamedType(_NAMED_TYPE_INFO[name]) |
| if named_type.IsConstant(): |
| continue |
| + if named_type.IsConstantForES2(): |
| + continue |
| if named_type.GetValidValues(): |
| code = """%(pre)s%(name)s( |
| valid_%(name)s_table, arraysize(valid_%(name)s_table))""" |