| 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 4d8d9247349fe88c45934098f749424c3e3f65c2..5e00aa057715260fc6e52d1f501f8f38893eaaa8 100755
|
| --- a/gpu/command_buffer/build_gles2_cmd_buffer.py
|
| +++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
|
| @@ -1134,7 +1134,7 @@ _FUNCTION_INFO = {
|
| 'decoder_func': 'DoClearDepthf',
|
| 'gl_test_func': 'glClearDepth',
|
| },
|
| - 'ColorMask': {'decoder_func': 'DoColorMask'},
|
| + 'ColorMask': {'decoder_func': 'DoColorMask', 'expectation': False},
|
| 'ClearStencil': {'decoder_func': 'DoClearStencil'},
|
| 'CommandBufferEnableCHROMIUM': {
|
| 'type': 'Custom',
|
| @@ -1192,7 +1192,7 @@ _FUNCTION_INFO = {
|
| },
|
| 'DeleteTextures': {'type': 'DELn'},
|
| 'DepthRangef': {'decoder_func': 'glDepthRange'},
|
| - 'DepthMask': {'decoder_func': 'DoDepthMask'},
|
| + 'DepthMask': {'decoder_func': 'DoDepthMask', 'expectation': False},
|
| 'DetachShader': {'decoder_func': 'DoDetachShader'},
|
| 'Disable': {
|
| 'decoder_func': 'DoDisable',
|
| @@ -1507,8 +1507,11 @@ _FUNCTION_INFO = {
|
| 'cmd_args':
|
| 'GLuint shader, const char* data',
|
| },
|
| - 'StencilMask': {'decoder_func': 'DoStencilMask'},
|
| - 'StencilMaskSeparate': {'decoder_func': 'DoStencilMaskSeparate'},
|
| + 'StencilMask': {'decoder_func': 'DoStencilMask', 'expectation': False},
|
| + 'StencilMaskSeparate': {
|
| + 'decoder_func': 'DoStencilMaskSeparate',
|
| + 'expectation': False,
|
| + },
|
| 'SwapBuffers': {
|
| 'type': 'Custom',
|
| 'impl_func': False,
|
| @@ -4271,6 +4274,22 @@ class Argument(object):
|
| """Gets the bucket version of this argument."""
|
| return self
|
|
|
| +
|
| +class BoolArgument(Argument):
|
| + """class for GLboolean"""
|
| +
|
| + def __init__(self, name, type):
|
| + Argument.__init__(self, name, 'GLboolean')
|
| +
|
| + def GetValidArg(self, func, offset, index):
|
| + """Gets a valid value for this argument."""
|
| + return 'true'
|
| +
|
| + def GetValidGLArg(self, func, offset, index):
|
| + """Gets a valid GL value for this argument."""
|
| + return 'true'
|
| +
|
| +
|
| class DataSizeArgument(Argument):
|
| """class for data_size which Bucket commands do not need."""
|
|
|
| @@ -4335,7 +4354,7 @@ class SizeNotNegativeArgument(SizeArgument):
|
|
|
|
|
| class EnumBaseArgument(Argument):
|
| - """Base class for EnumArgument, IntArgument and BoolArgument"""
|
| + """Base class for EnumArgument, IntArgument and ValidatedBoolArgument"""
|
|
|
| def __init__(self, name, gl_type, type, gl_error):
|
| Argument.__init__(self, name, gl_type)
|
| @@ -4405,7 +4424,7 @@ class IntArgument(EnumBaseArgument):
|
| EnumBaseArgument.__init__(self, name, "GLint", type, "GL_INVALID_VALUE")
|
|
|
|
|
| -class BoolArgument(EnumBaseArgument):
|
| +class ValidatedBoolArgument(EnumBaseArgument):
|
| """A class for a GLboolean argument that can only except specific values.
|
|
|
| For example glUniformMatrix takes a GLboolean for it's transpose but it
|
| @@ -5059,6 +5078,8 @@ def CreateArg(arg_string):
|
| elif arg_parts[0].startswith('GLenum') and len(arg_parts[0]) > 6:
|
| return EnumArgument(arg_parts[-1], " ".join(arg_parts[0:-1]))
|
| elif arg_parts[0].startswith('GLboolean') and len(arg_parts[0]) > 9:
|
| + return ValidatedBoolArgument(arg_parts[-1], " ".join(arg_parts[0:-1]))
|
| + elif arg_parts[0].startswith('GLboolean'):
|
| return BoolArgument(arg_parts[-1], " ".join(arg_parts[0:-1]))
|
| elif (arg_parts[0].startswith('GLint') and len(arg_parts[0]) > 5 and
|
| not arg_parts[0].startswith('GLintptr')):
|
|
|