diff options
author | zmo <zmo@chromium.org> | 2015-03-13 17:15:34 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-14 00:16:50 +0000 |
commit | 47e01c44489b0c7e498df6e09987c401d7592b2c (patch) | |
tree | df263bdee033b4db58b4bde8236163d1cda33379 /gpu | |
parent | 587f72ea58fbba857b907eeff2468a9b58536215 (diff) | |
download | chromium_src-47e01c44489b0c7e498df6e09987c401d7592b2c.zip chromium_src-47e01c44489b0c7e498df6e09987c401d7592b2c.tar.gz chromium_src-47e01c44489b0c7e498df6e09987c401d7592b2c.tar.bz2 |
Update ES3 enums for texture parameters.
This affetcs TexImage*D, TexStorage*D, CopyTexImage2D.
Note that this is working progress to allow these ES3 enums. More validation
code needs to be modified to make them work.
BUG=429053
TEST=gpu_unittests
R=sievers@chromium.org
Review URL: https://codereview.chromium.org/1007523002
Cr-Commit-Position: refs/heads/master@{#320612}
Diffstat (limited to 'gpu')
-rwxr-xr-x | gpu/command_buffer/build_gles2_cmd_buffer.py | 184 | ||||
-rw-r--r-- | gpu/command_buffer/cmd_buffer_functions.txt | 2 | ||||
-rw-r--r-- | gpu/command_buffer/common/gles2_cmd_utils.cc | 41 | ||||
-rw-r--r-- | gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h | 138 | ||||
-rw-r--r-- | gpu/command_buffer/service/feature_info.cc | 2 | ||||
-rw-r--r-- | gpu/command_buffer/service/gles2_cmd_validation.h | 13 | ||||
-rw-r--r-- | gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h | 179 |
7 files changed, 553 insertions, 6 deletions
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py index bf5b19e..d5b799e 100755 --- a/gpu/command_buffer/build_gles2_cmd_buffer.py +++ b/gpu/command_buffer/build_gles2_cmd_buffer.py @@ -547,6 +547,8 @@ _STATES = { # valid_es3: The list of values that are valid in OpenGL ES 3, but not ES 2. # invalid: Examples of invalid values for the type. At least these values # should be tested to be invalid. +# deprecated_es3: The list of values that are valid in OpenGL ES 2, but +# deprecated in ES 3. # is_complete: The list of valid values of type are final and will not be # modified during runtime. _NAMED_TYPE_INFO = { @@ -776,6 +778,10 @@ _NAMED_TYPE_INFO = { 'GL_TEXTURE_2D', 'GL_TEXTURE_CUBE_MAP', ], + 'valid_es3': [ + 'GL_TEXTURE_3D', + 'GL_TEXTURE_2D_ARRAY', + ], 'invalid': [ 'GL_TEXTURE_1D', 'GL_TEXTURE_3D', @@ -1223,9 +1229,22 @@ _NAMED_TYPE_INFO = { 'GL_UNSIGNED_SHORT_4_4_4_4', 'GL_UNSIGNED_SHORT_5_5_5_1', ], - 'invalid': [ + 'valid_es3': [ + 'GL_BYTE', + 'GL_UNSIGNED_SHORT', 'GL_SHORT', + 'GL_UNSIGNED_INT', 'GL_INT', + 'GL_HALF_FLOAT', + 'GL_FLOAT', + 'GL_UNSIGNED_INT_2_10_10_10_REV', + 'GL_UNSIGNED_INT_10F_11F_11F_REV', + 'GL_UNSIGNED_INT_5_9_9_9_REV', + 'GL_UNSIGNED_INT_24_8', + 'GL_FLOAT_32_UNSIGNED_INT_24_8_REV', + ], + 'invalid': [ + 'GL_UNSIGNED_BYTE_3_3_2', ], }, 'ReadPixelType': { @@ -1278,6 +1297,16 @@ _NAMED_TYPE_INFO = { 'GL_RGB', 'GL_RGBA', ], + 'valid_es3': [ + 'GL_RED', + 'GL_RED_INTEGER', + 'GL_RG', + 'GL_RG_INTEGER', + 'GL_RGB_INTEGER', + 'GL_RGBA_INTEGER', + 'GL_DEPTH_COMPONENT', + 'GL_DEPTH_STENCIL', + ], 'invalid': [ 'GL_BGRA', 'GL_BGR', @@ -1292,6 +1321,64 @@ _NAMED_TYPE_INFO = { 'GL_RGB', 'GL_RGBA', ], + 'valid_es3': [ + 'GL_R8', + 'GL_R8_SNORM', + 'GL_R16F', + 'GL_R32F', + 'GL_R8UI', + 'GL_R8I', + 'GL_R16UI', + 'GL_R16I', + 'GL_R32UI', + 'GL_R32I', + 'GL_RG8', + 'GL_RG8_SNORM', + 'GL_RG16F', + 'GL_RG32F', + 'GL_RG8UI', + 'GL_RG8I', + 'GL_RG16UI', + 'GL_RG16I', + 'GL_RG32UI', + 'GL_RG32I', + 'GL_RGB8', + 'GL_SRGB8', + 'GL_RGB565', + 'GL_RGB8_SNORM', + 'GL_R11F_G11F_B10F', + 'GL_RGB9_E5', + 'GL_RGB16F', + 'GL_RGB32F', + 'GL_RGB8UI', + 'GL_RGB8I', + 'GL_RGB16UI', + 'GL_RGB16I', + 'GL_RGB32UI', + 'GL_RGB32I', + 'GL_RGBA8', + 'GL_SRGB8_ALPHA8', + 'GL_RGBA8_SNORM', + 'GL_RGB5_A1', + 'GL_RGBA4', + 'GL_RGB10_A2', + 'GL_RGBA16F', + 'GL_RGBA32F', + 'GL_RGBA8UI', + 'GL_RGBA8I', + 'GL_RGB10_A2UI', + 'GL_RGBA16UI', + 'GL_RGBA16I', + 'GL_RGBA32UI', + 'GL_RGBA32I', + # The DEPTH/STENCIL formats are not supported in CopyTexImage2D. + # We will reject them dynamically in GPU command buffer. + 'GL_DEPTH_COMPONENT16', + 'GL_DEPTH_COMPONENT24', + 'GL_DEPTH_COMPONENT32F', + 'GL_DEPTH24_STENCIL8', + 'GL_DEPTH32F_STENCIL8', + ], 'invalid': [ 'GL_BGRA', 'GL_BGR', @@ -1309,6 +1396,78 @@ _NAMED_TYPE_INFO = { 'GL_RGB8_OES', 'GL_RGBA8_OES', ], + 'valid_es3': [ + 'GL_R8', + 'GL_R8_SNORM', + 'GL_R16F', + 'GL_R32F', + 'GL_R8UI', + 'GL_R8I', + 'GL_R16UI', + 'GL_R16I', + 'GL_R32UI', + 'GL_R32I', + 'GL_RG8', + 'GL_RG8_SNORM', + 'GL_RG16F', + 'GL_RG32F', + 'GL_RG8UI', + 'GL_RG8I', + 'GL_RG16UI', + 'GL_RG16I', + 'GL_RG32UI', + 'GL_RG32I', + 'GL_SRGB8', + 'GL_RGB8_SNORM', + 'GL_R11F_G11F_B10F', + 'GL_RGB9_E5', + 'GL_RGB16F', + 'GL_RGB32F', + 'GL_RGB8UI', + 'GL_RGB8I', + 'GL_RGB16UI', + 'GL_RGB16I', + 'GL_RGB32UI', + 'GL_RGB32I', + 'GL_SRGB8_ALPHA8', + 'GL_RGBA8_SNORM', + 'GL_RGB10_A2', + 'GL_RGBA16F', + 'GL_RGBA32F', + 'GL_RGBA8UI', + 'GL_RGBA8I', + 'GL_RGB10_A2UI', + 'GL_RGBA16UI', + 'GL_RGBA16I', + 'GL_RGBA32UI', + 'GL_RGBA32I', + 'GL_DEPTH_COMPONENT16', + 'GL_DEPTH_COMPONENT24', + 'GL_DEPTH_COMPONENT32F', + 'GL_DEPTH24_STENCIL8', + 'GL_DEPTH32F_STENCIL8', + 'GL_COMPRESSED_R11_EAC', + 'GL_COMPRESSED_SIGNED_R11_EAC', + 'GL_COMPRESSED_RG11_EAC', + 'GL_COMPRESSED_SIGNED_RG11_EAC', + 'GL_COMPRESSED_RGB8_ETC2', + 'GL_COMPRESSED_SRGB8_ETC2', + 'GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2', + 'GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2', + 'GL_COMPRESSED_RGBA8_ETC2_EAC', + 'GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC', + ], + 'deprecated_es3': [ + 'GL_ALPHA8_EXT', + 'GL_LUMINANCE8_EXT', + 'GL_LUMINANCE8_ALPHA8_EXT', + 'GL_ALPHA16F_EXT', + 'GL_LUMINANCE16F_EXT', + 'GL_LUMINANCE_ALPHA16F_EXT', + 'GL_ALPHA32F_EXT', + 'GL_LUMINANCE32F_EXT', + 'GL_LUMINANCE_ALPHA32F_EXT', + ], }, 'ImageInternalFormat': { 'type': 'GLenum', @@ -7553,6 +7712,10 @@ class NamedType(object): self.valid_es3 = info['valid_es3'] else: self.valid_es3 = [] + if 'deprecated_es3' in info: + self.deprecated_es3 = info['deprecated_es3'] + else: + self.deprecated_es3 = [] def GetType(self): return self.info['type'] @@ -7566,6 +7729,9 @@ class NamedType(object): def GetValidValuesES3(self): return self.valid_es3 + def GetDeprecatedValuesES3(self): + return self.deprecated_es3 + def IsConstant(self): if not 'is_complete' in self.info: return False @@ -9872,6 +10038,13 @@ extern const NameToFunc g_gles2_function_table[] = { file.Write(" %s,\n" % value) file.Write("};\n") file.Write("\n") + if named_type.GetDeprecatedValuesES3(): + file.Write("static const %s deprecated_%s_table_es3[] = {\n" % + (named_type.GetType(), ToUnderscore(name))) + for value in named_type.GetDeprecatedValuesES3(): + file.Write(" %s,\n" % value) + file.Write("};\n") + file.Write("\n") file.Write("Validators::Validators()") pre = ' : ' for count, name in enumerate(names): @@ -9891,9 +10064,16 @@ extern const NameToFunc g_gles2_function_table[] = { file.Write(" {\n"); file.Write("}\n\n"); - file.Write("void Validators::AddES3Values() {\n") + file.Write("void Validators::UpdateValuesES3() {\n") for name in names: named_type = NamedType(_NAMED_TYPE_INFO[name]) + if named_type.GetDeprecatedValuesES3(): + code = """ %(name)s.RemoveValues( + deprecated_%(name)s_table_es3, arraysize(deprecated_%(name)s_table_es3)); +""" + file.Write(code % { + 'name': ToUnderscore(name), + }) if named_type.GetValidValuesES3(): code = """ %(name)s.AddValues( valid_%(name)s_table_es3, arraysize(valid_%(name)s_table_es3)); diff --git a/gpu/command_buffer/cmd_buffer_functions.txt b/gpu/command_buffer/cmd_buffer_functions.txt index 1dd35fd..87eed68 100644 --- a/gpu/command_buffer/cmd_buffer_functions.txt +++ b/gpu/command_buffer/cmd_buffer_functions.txt @@ -133,7 +133,7 @@ GL_APICALL void GL_APIENTRY glPauseTransformFeedback (void); GL_APICALL void GL_APIENTRY glPixelStorei (GLenumPixelStore pname, GLintPixelStoreAlignment param); GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units); GL_APICALL void GL_APIENTRY glReadBuffer (GLenum src); -GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenumReadPixelFormat format, GLenumPixelType type, void* pixels); +GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenumReadPixelFormat format, GLenumReadPixelType type, void* pixels); GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void); GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenumRenderBufferTarget target, GLenumRenderBufferFormat internalformat, GLsizei width, GLsizei height); GL_APICALL void GL_APIENTRY glResumeTransformFeedback (void); diff --git a/gpu/command_buffer/common/gles2_cmd_utils.cc b/gpu/command_buffer/common/gles2_cmd_utils.cc index 14d6a21..22f826f 100644 --- a/gpu/command_buffer/common/gles2_cmd_utils.cc +++ b/gpu/command_buffer/common/gles2_cmd_utils.cc @@ -711,6 +711,16 @@ uint32 GLES2Util::GetChannelsForFormat(int format) { case GL_RGB16F_EXT: case GL_RGB32F_EXT: case GL_SRGB_EXT: + case GL_SRGB8: + case GL_RGB8_SNORM: + case GL_R11F_G11F_B10F: + case GL_RGB9_E5: + case GL_RGB8UI: + case GL_RGB8I: + case GL_RGB16UI: + case GL_RGB16I: + case GL_RGB32UI: + case GL_RGB32I: return kRGB; case GL_BGRA_EXT: case GL_BGRA8_EXT: @@ -722,20 +732,51 @@ uint32 GLES2Util::GetChannelsForFormat(int format) { case GL_RGB5_A1: case GL_SRGB_ALPHA_EXT: case GL_SRGB8_ALPHA8_EXT: + case GL_RGBA8_SNORM: + case GL_RGB10_A2: + case GL_RGBA8UI: + case GL_RGBA8I: + case GL_RGB10_A2UI: + case GL_RGBA16UI: + case GL_RGBA16I: + case GL_RGBA32UI: + case GL_RGBA32I: return kRGBA; case GL_DEPTH_COMPONENT32_OES: case GL_DEPTH_COMPONENT24_OES: case GL_DEPTH_COMPONENT16: case GL_DEPTH_COMPONENT: + case GL_DEPTH_COMPONENT32F: return kDepth; case GL_STENCIL_INDEX8: return kStencil; case GL_DEPTH_STENCIL_OES: case GL_DEPTH24_STENCIL8_OES: + case GL_DEPTH32F_STENCIL8: return kDepth | kStencil; case GL_RED_EXT: + case GL_R8: + case GL_R8_SNORM: + case GL_R16F: + case GL_R32F: + case GL_R8UI: + case GL_R8I: + case GL_R16UI: + case GL_R16I: + case GL_R32UI: + case GL_R32I: return kRed; case GL_RG_EXT: + case GL_RG8: + case GL_RG8_SNORM: + case GL_RG16F: + case GL_RG32F: + case GL_RG8UI: + case GL_RG8I: + case GL_RG16UI: + case GL_RG16I: + case GL_RG32UI: + case GL_RG32I: return kRed | kGreen; default: return 0x0000; diff --git a/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h b/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h index 52511ed..fade8fa 100644 --- a/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h @@ -4887,6 +4887,18 @@ std::string GLES2Util::GetStringPixelType(uint32_t value) { {GL_UNSIGNED_SHORT_5_6_5, "GL_UNSIGNED_SHORT_5_6_5"}, {GL_UNSIGNED_SHORT_4_4_4_4, "GL_UNSIGNED_SHORT_4_4_4_4"}, {GL_UNSIGNED_SHORT_5_5_5_1, "GL_UNSIGNED_SHORT_5_5_5_1"}, + {GL_BYTE, "GL_BYTE"}, + {GL_UNSIGNED_SHORT, "GL_UNSIGNED_SHORT"}, + {GL_SHORT, "GL_SHORT"}, + {GL_UNSIGNED_INT, "GL_UNSIGNED_INT"}, + {GL_INT, "GL_INT"}, + {GL_HALF_FLOAT, "GL_HALF_FLOAT"}, + {GL_FLOAT, "GL_FLOAT"}, + {GL_UNSIGNED_INT_2_10_10_10_REV, "GL_UNSIGNED_INT_2_10_10_10_REV"}, + {GL_UNSIGNED_INT_10F_11F_11F_REV, "GL_UNSIGNED_INT_10F_11F_11F_REV"}, + {GL_UNSIGNED_INT_5_9_9_9_REV, "GL_UNSIGNED_INT_5_9_9_9_REV"}, + {GL_UNSIGNED_INT_24_8, "GL_UNSIGNED_INT_24_8"}, + {GL_FLOAT_32_UNSIGNED_INT_24_8_REV, "GL_FLOAT_32_UNSIGNED_INT_24_8_REV"}, }; return GLES2Util::GetQualifiedEnumString(string_table, arraysize(string_table), value); @@ -5152,6 +5164,8 @@ std::string GLES2Util::GetStringTextureBindTarget(uint32_t value) { static const EnumToString string_table[] = { {GL_TEXTURE_2D, "GL_TEXTURE_2D"}, {GL_TEXTURE_CUBE_MAP, "GL_TEXTURE_CUBE_MAP"}, + {GL_TEXTURE_3D, "GL_TEXTURE_3D"}, + {GL_TEXTURE_2D_ARRAY, "GL_TEXTURE_2D_ARRAY"}, }; return GLES2Util::GetQualifiedEnumString(string_table, arraysize(string_table), value); @@ -5164,6 +5178,14 @@ std::string GLES2Util::GetStringTextureFormat(uint32_t value) { {GL_LUMINANCE_ALPHA, "GL_LUMINANCE_ALPHA"}, {GL_RGB, "GL_RGB"}, {GL_RGBA, "GL_RGBA"}, + {GL_RED, "GL_RED"}, + {GL_RED_INTEGER, "GL_RED_INTEGER"}, + {GL_RG, "GL_RG"}, + {GL_RG_INTEGER, "GL_RG_INTEGER"}, + {GL_RGB_INTEGER, "GL_RGB_INTEGER"}, + {GL_RGBA_INTEGER, "GL_RGBA_INTEGER"}, + {GL_DEPTH_COMPONENT, "GL_DEPTH_COMPONENT"}, + {GL_DEPTH_STENCIL, "GL_DEPTH_STENCIL"}, }; return GLES2Util::GetQualifiedEnumString(string_table, arraysize(string_table), value); @@ -5176,6 +5198,60 @@ std::string GLES2Util::GetStringTextureInternalFormat(uint32_t value) { {GL_LUMINANCE_ALPHA, "GL_LUMINANCE_ALPHA"}, {GL_RGB, "GL_RGB"}, {GL_RGBA, "GL_RGBA"}, + {GL_R8, "GL_R8"}, + {GL_R8_SNORM, "GL_R8_SNORM"}, + {GL_R16F, "GL_R16F"}, + {GL_R32F, "GL_R32F"}, + {GL_R8UI, "GL_R8UI"}, + {GL_R8I, "GL_R8I"}, + {GL_R16UI, "GL_R16UI"}, + {GL_R16I, "GL_R16I"}, + {GL_R32UI, "GL_R32UI"}, + {GL_R32I, "GL_R32I"}, + {GL_RG8, "GL_RG8"}, + {GL_RG8_SNORM, "GL_RG8_SNORM"}, + {GL_RG16F, "GL_RG16F"}, + {GL_RG32F, "GL_RG32F"}, + {GL_RG8UI, "GL_RG8UI"}, + {GL_RG8I, "GL_RG8I"}, + {GL_RG16UI, "GL_RG16UI"}, + {GL_RG16I, "GL_RG16I"}, + {GL_RG32UI, "GL_RG32UI"}, + {GL_RG32I, "GL_RG32I"}, + {GL_RGB8, "GL_RGB8"}, + {GL_SRGB8, "GL_SRGB8"}, + {GL_RGB565, "GL_RGB565"}, + {GL_RGB8_SNORM, "GL_RGB8_SNORM"}, + {GL_R11F_G11F_B10F, "GL_R11F_G11F_B10F"}, + {GL_RGB9_E5, "GL_RGB9_E5"}, + {GL_RGB16F, "GL_RGB16F"}, + {GL_RGB32F, "GL_RGB32F"}, + {GL_RGB8UI, "GL_RGB8UI"}, + {GL_RGB8I, "GL_RGB8I"}, + {GL_RGB16UI, "GL_RGB16UI"}, + {GL_RGB16I, "GL_RGB16I"}, + {GL_RGB32UI, "GL_RGB32UI"}, + {GL_RGB32I, "GL_RGB32I"}, + {GL_RGBA8, "GL_RGBA8"}, + {GL_SRGB8_ALPHA8, "GL_SRGB8_ALPHA8"}, + {GL_RGBA8_SNORM, "GL_RGBA8_SNORM"}, + {GL_RGB5_A1, "GL_RGB5_A1"}, + {GL_RGBA4, "GL_RGBA4"}, + {GL_RGB10_A2, "GL_RGB10_A2"}, + {GL_RGBA16F, "GL_RGBA16F"}, + {GL_RGBA32F, "GL_RGBA32F"}, + {GL_RGBA8UI, "GL_RGBA8UI"}, + {GL_RGBA8I, "GL_RGBA8I"}, + {GL_RGB10_A2UI, "GL_RGB10_A2UI"}, + {GL_RGBA16UI, "GL_RGBA16UI"}, + {GL_RGBA16I, "GL_RGBA16I"}, + {GL_RGBA32UI, "GL_RGBA32UI"}, + {GL_RGBA32I, "GL_RGBA32I"}, + {GL_DEPTH_COMPONENT16, "GL_DEPTH_COMPONENT16"}, + {GL_DEPTH_COMPONENT24, "GL_DEPTH_COMPONENT24"}, + {GL_DEPTH_COMPONENT32F, "GL_DEPTH_COMPONENT32F"}, + {GL_DEPTH24_STENCIL8, "GL_DEPTH24_STENCIL8"}, + {GL_DEPTH32F_STENCIL8, "GL_DEPTH32F_STENCIL8"}, }; return GLES2Util::GetQualifiedEnumString(string_table, arraysize(string_table), value); @@ -5191,6 +5267,68 @@ std::string GLES2Util::GetStringTextureInternalFormatStorage(uint32_t value) { {GL_LUMINANCE8_ALPHA8_EXT, "GL_LUMINANCE8_ALPHA8_EXT"}, {GL_RGB8_OES, "GL_RGB8_OES"}, {GL_RGBA8_OES, "GL_RGBA8_OES"}, + {GL_R8, "GL_R8"}, + {GL_R8_SNORM, "GL_R8_SNORM"}, + {GL_R16F, "GL_R16F"}, + {GL_R32F, "GL_R32F"}, + {GL_R8UI, "GL_R8UI"}, + {GL_R8I, "GL_R8I"}, + {GL_R16UI, "GL_R16UI"}, + {GL_R16I, "GL_R16I"}, + {GL_R32UI, "GL_R32UI"}, + {GL_R32I, "GL_R32I"}, + {GL_RG8, "GL_RG8"}, + {GL_RG8_SNORM, "GL_RG8_SNORM"}, + {GL_RG16F, "GL_RG16F"}, + {GL_RG32F, "GL_RG32F"}, + {GL_RG8UI, "GL_RG8UI"}, + {GL_RG8I, "GL_RG8I"}, + {GL_RG16UI, "GL_RG16UI"}, + {GL_RG16I, "GL_RG16I"}, + {GL_RG32UI, "GL_RG32UI"}, + {GL_RG32I, "GL_RG32I"}, + {GL_SRGB8, "GL_SRGB8"}, + {GL_RGB8_SNORM, "GL_RGB8_SNORM"}, + {GL_R11F_G11F_B10F, "GL_R11F_G11F_B10F"}, + {GL_RGB9_E5, "GL_RGB9_E5"}, + {GL_RGB16F, "GL_RGB16F"}, + {GL_RGB32F, "GL_RGB32F"}, + {GL_RGB8UI, "GL_RGB8UI"}, + {GL_RGB8I, "GL_RGB8I"}, + {GL_RGB16UI, "GL_RGB16UI"}, + {GL_RGB16I, "GL_RGB16I"}, + {GL_RGB32UI, "GL_RGB32UI"}, + {GL_RGB32I, "GL_RGB32I"}, + {GL_SRGB8_ALPHA8, "GL_SRGB8_ALPHA8"}, + {GL_RGBA8_SNORM, "GL_RGBA8_SNORM"}, + {GL_RGB10_A2, "GL_RGB10_A2"}, + {GL_RGBA16F, "GL_RGBA16F"}, + {GL_RGBA32F, "GL_RGBA32F"}, + {GL_RGBA8UI, "GL_RGBA8UI"}, + {GL_RGBA8I, "GL_RGBA8I"}, + {GL_RGB10_A2UI, "GL_RGB10_A2UI"}, + {GL_RGBA16UI, "GL_RGBA16UI"}, + {GL_RGBA16I, "GL_RGBA16I"}, + {GL_RGBA32UI, "GL_RGBA32UI"}, + {GL_RGBA32I, "GL_RGBA32I"}, + {GL_DEPTH_COMPONENT16, "GL_DEPTH_COMPONENT16"}, + {GL_DEPTH_COMPONENT24, "GL_DEPTH_COMPONENT24"}, + {GL_DEPTH_COMPONENT32F, "GL_DEPTH_COMPONENT32F"}, + {GL_DEPTH24_STENCIL8, "GL_DEPTH24_STENCIL8"}, + {GL_DEPTH32F_STENCIL8, "GL_DEPTH32F_STENCIL8"}, + {GL_COMPRESSED_R11_EAC, "GL_COMPRESSED_R11_EAC"}, + {GL_COMPRESSED_SIGNED_R11_EAC, "GL_COMPRESSED_SIGNED_R11_EAC"}, + {GL_COMPRESSED_RG11_EAC, "GL_COMPRESSED_RG11_EAC"}, + {GL_COMPRESSED_SIGNED_RG11_EAC, "GL_COMPRESSED_SIGNED_RG11_EAC"}, + {GL_COMPRESSED_RGB8_ETC2, "GL_COMPRESSED_RGB8_ETC2"}, + {GL_COMPRESSED_SRGB8_ETC2, "GL_COMPRESSED_SRGB8_ETC2"}, + {GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, + "GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2"}, + {GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, + "GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2"}, + {GL_COMPRESSED_RGBA8_ETC2_EAC, "GL_COMPRESSED_RGBA8_ETC2_EAC"}, + {GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, + "GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"}, }; return GLES2Util::GetQualifiedEnumString(string_table, arraysize(string_table), value); diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc index 2452954..6675ba7 100644 --- a/gpu/command_buffer/service/feature_info.cc +++ b/gpu/command_buffer/service/feature_info.cc @@ -1070,7 +1070,7 @@ bool FeatureInfo::IsES3Capable() const { void FeatureInfo::EnableES3Validators() { DCHECK(IsES3Capable()); - validators_.AddES3Values(); + validators_.UpdateValuesES3(); } void FeatureInfo::AddExtensionString(const char* s) { diff --git a/gpu/command_buffer/service/gles2_cmd_validation.h b/gpu/command_buffer/service/gles2_cmd_validation.h index 8ca9861..f4059ed 100644 --- a/gpu/command_buffer/service/gles2_cmd_validation.h +++ b/gpu/command_buffer/service/gles2_cmd_validation.h @@ -37,6 +37,17 @@ class ValueValidator { } } + void RemoveValues(const T* invalid_values, int num_values) { + for (int ii = 0; ii < num_values; ++ii) { + auto iter = std::find( + valid_values_.begin(), valid_values_.end(), invalid_values[ii]); + if (iter != valid_values_.end()) { + valid_values_.erase(iter); + DCHECK(!IsValid(invalid_values[ii])); + } + } + } + bool IsValid(const T value) const { return std::find(valid_values_.begin(), valid_values_.end(), value) != valid_values_.end(); @@ -53,7 +64,7 @@ class ValueValidator { struct Validators { Validators(); - void AddES3Values(); + void UpdateValuesES3(); #include "gpu/command_buffer/service/gles2_cmd_validation_autogen.h" }; diff --git a/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h b/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h index 2f83240..ee63b3a 100644 --- a/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h +++ b/gpu/command_buffer/service/gles2_cmd_validation_implementation_autogen.h @@ -325,6 +325,21 @@ static const GLenum valid_pixel_type_table[] = { GL_UNSIGNED_SHORT_5_5_5_1, }; +static const GLenum valid_pixel_type_table_es3[] = { + GL_BYTE, + GL_UNSIGNED_SHORT, + GL_SHORT, + GL_UNSIGNED_INT, + GL_INT, + GL_HALF_FLOAT, + GL_FLOAT, + GL_UNSIGNED_INT_2_10_10_10_REV, + GL_UNSIGNED_INT_10F_11F_11F_REV, + GL_UNSIGNED_INT_5_9_9_9_REV, + GL_UNSIGNED_INT_24_8, + GL_FLOAT_32_UNSIGNED_INT_24_8_REV, +}; + static const GLenum valid_program_parameter_table[] = { GL_DELETE_STATUS, GL_LINK_STATUS, @@ -497,6 +512,11 @@ static const GLenum valid_texture_bind_target_table[] = { GL_TEXTURE_CUBE_MAP, }; +static const GLenum valid_texture_bind_target_table_es3[] = { + GL_TEXTURE_3D, + GL_TEXTURE_2D_ARRAY, +}; + static const GLenum valid_texture_format_table[] = { GL_ALPHA, GL_LUMINANCE, @@ -505,6 +525,17 @@ static const GLenum valid_texture_format_table[] = { GL_RGBA, }; +static const GLenum valid_texture_format_table_es3[] = { + GL_RED, + GL_RED_INTEGER, + GL_RG, + GL_RG_INTEGER, + GL_RGB_INTEGER, + GL_RGBA_INTEGER, + GL_DEPTH_COMPONENT, + GL_DEPTH_STENCIL, +}; + static const GLenum valid_texture_internal_format_table[] = { GL_ALPHA, GL_LUMINANCE, @@ -513,6 +544,63 @@ static const GLenum valid_texture_internal_format_table[] = { GL_RGBA, }; +static const GLenum valid_texture_internal_format_table_es3[] = { + GL_R8, + GL_R8_SNORM, + GL_R16F, + GL_R32F, + GL_R8UI, + GL_R8I, + GL_R16UI, + GL_R16I, + GL_R32UI, + GL_R32I, + GL_RG8, + GL_RG8_SNORM, + GL_RG16F, + GL_RG32F, + GL_RG8UI, + GL_RG8I, + GL_RG16UI, + GL_RG16I, + GL_RG32UI, + GL_RG32I, + GL_RGB8, + GL_SRGB8, + GL_RGB565, + GL_RGB8_SNORM, + GL_R11F_G11F_B10F, + GL_RGB9_E5, + GL_RGB16F, + GL_RGB32F, + GL_RGB8UI, + GL_RGB8I, + GL_RGB16UI, + GL_RGB16I, + GL_RGB32UI, + GL_RGB32I, + GL_RGBA8, + GL_SRGB8_ALPHA8, + GL_RGBA8_SNORM, + GL_RGB5_A1, + GL_RGBA4, + GL_RGB10_A2, + GL_RGBA16F, + GL_RGBA32F, + GL_RGBA8UI, + GL_RGBA8I, + GL_RGB10_A2UI, + GL_RGBA16UI, + GL_RGBA16I, + GL_RGBA32UI, + GL_RGBA32I, + GL_DEPTH_COMPONENT16, + GL_DEPTH_COMPONENT24, + GL_DEPTH_COMPONENT32F, + GL_DEPTH24_STENCIL8, + GL_DEPTH32F_STENCIL8, +}; + static const GLenum valid_texture_internal_format_storage_table[] = { GL_RGB565, GL_RGBA4, @@ -524,6 +612,80 @@ static const GLenum valid_texture_internal_format_storage_table[] = { GL_RGBA8_OES, }; +static const GLenum valid_texture_internal_format_storage_table_es3[] = { + GL_R8, + GL_R8_SNORM, + GL_R16F, + GL_R32F, + GL_R8UI, + GL_R8I, + GL_R16UI, + GL_R16I, + GL_R32UI, + GL_R32I, + GL_RG8, + GL_RG8_SNORM, + GL_RG16F, + GL_RG32F, + GL_RG8UI, + GL_RG8I, + GL_RG16UI, + GL_RG16I, + GL_RG32UI, + GL_RG32I, + GL_SRGB8, + GL_RGB8_SNORM, + GL_R11F_G11F_B10F, + GL_RGB9_E5, + GL_RGB16F, + GL_RGB32F, + GL_RGB8UI, + GL_RGB8I, + GL_RGB16UI, + GL_RGB16I, + GL_RGB32UI, + GL_RGB32I, + GL_SRGB8_ALPHA8, + GL_RGBA8_SNORM, + GL_RGB10_A2, + GL_RGBA16F, + GL_RGBA32F, + GL_RGBA8UI, + GL_RGBA8I, + GL_RGB10_A2UI, + GL_RGBA16UI, + GL_RGBA16I, + GL_RGBA32UI, + GL_RGBA32I, + GL_DEPTH_COMPONENT16, + GL_DEPTH_COMPONENT24, + GL_DEPTH_COMPONENT32F, + GL_DEPTH24_STENCIL8, + GL_DEPTH32F_STENCIL8, + GL_COMPRESSED_R11_EAC, + GL_COMPRESSED_SIGNED_R11_EAC, + GL_COMPRESSED_RG11_EAC, + GL_COMPRESSED_SIGNED_RG11_EAC, + GL_COMPRESSED_RGB8_ETC2, + GL_COMPRESSED_SRGB8_ETC2, + GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, + GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, + GL_COMPRESSED_RGBA8_ETC2_EAC, + GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, +}; + +static const GLenum deprecated_texture_internal_format_storage_table_es3[] = { + GL_ALPHA8_EXT, + GL_LUMINANCE8_EXT, + GL_LUMINANCE8_ALPHA8_EXT, + GL_ALPHA16F_EXT, + GL_LUMINANCE16F_EXT, + GL_LUMINANCE_ALPHA16F_EXT, + GL_ALPHA32F_EXT, + GL_LUMINANCE32F_EXT, + GL_LUMINANCE_ALPHA32F_EXT, +}; + static const GLenum valid_texture_mag_filter_mode_table[] = { GL_NEAREST, GL_LINEAR, @@ -771,9 +933,24 @@ Validators::Validators() arraysize(valid_vertex_pointer_table)) { } -void Validators::AddES3Values() { +void Validators::UpdateValuesES3() { buffer_target.AddValues(valid_buffer_target_table_es3, arraysize(valid_buffer_target_table_es3)); + pixel_type.AddValues(valid_pixel_type_table_es3, + arraysize(valid_pixel_type_table_es3)); + texture_bind_target.AddValues(valid_texture_bind_target_table_es3, + arraysize(valid_texture_bind_target_table_es3)); + texture_format.AddValues(valid_texture_format_table_es3, + arraysize(valid_texture_format_table_es3)); + texture_internal_format.AddValues( + valid_texture_internal_format_table_es3, + arraysize(valid_texture_internal_format_table_es3)); + texture_internal_format_storage.RemoveValues( + deprecated_texture_internal_format_storage_table_es3, + arraysize(deprecated_texture_internal_format_storage_table_es3)); + texture_internal_format_storage.AddValues( + valid_texture_internal_format_storage_table_es3, + arraysize(valid_texture_internal_format_storage_table_es3)); } #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_VALIDATION_IMPLEMENTATION_AUTOGEN_H_ |