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

Unified Diff: gpu/command_buffer/build_gles2_cmd_buffer.py

Issue 1007523002: Update ES3 enums for texture parameters. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Two CLs combined Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
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 bf5b19ef8b4e78ae5d1a6ccabeed338e9a57f19f..a7ec5af601c6ebb8dbdd0270624bf533fefc18de 100755
--- a/gpu/command_buffer/build_gles2_cmd_buffer.py
+++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -547,6 +547,7 @@ _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.
+# invalid_es3: The list of values that are valid in OpenGL ES2, but not ES3.
# is_complete: The list of valid values of type are final and will not be
# modified during runtime.
_NAMED_TYPE_INFO = {
@@ -776,6 +777,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 +1228,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',
no sievers 2015/03/13 19:44:17 Note that GLES2DecoderTest.ReadPixelsInvalidArgs v
Zhenyao Mo 2015/03/13 20:25:13 Once we switch to MANGLE, all the command buffer u
+ '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 +1296,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 +1320,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 +1395,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',
+ ],
+ 'invalid_es3': [
no sievers 2015/03/13 19:44:18 Ok, I think now I find this slightly confusing bec
Zhenyao Mo 2015/03/13 20:25:14 Done.
+ '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 +7711,10 @@ class NamedType(object):
self.valid_es3 = info['valid_es3']
else:
self.valid_es3 = []
+ if 'invalid_es3' in info:
+ self.invalid_es3 = info['invalid_es3']
+ else:
+ self.invalid_es3 = []
def GetType(self):
return self.info['type']
@@ -7566,6 +7728,9 @@ class NamedType(object):
def GetValidValuesES3(self):
return self.valid_es3
+ def GetInvalidValuesES3(self):
+ return self.invalid_es3
+
def IsConstant(self):
if not 'is_complete' in self.info:
return False
@@ -9872,6 +10037,13 @@ extern const NameToFunc g_gles2_function_table[] = {
file.Write(" %s,\n" % value)
file.Write("};\n")
file.Write("\n")
+ if named_type.GetInvalidValuesES3():
+ file.Write("static const %s invalid_%s_table_es3[] = {\n" %
+ (named_type.GetType(), ToUnderscore(name)))
+ for value in named_type.GetInvalidValuesES3():
+ file.Write(" %s,\n" % value)
+ file.Write("};\n")
+ file.Write("\n")
file.Write("Validators::Validators()")
pre = ' : '
for count, name in enumerate(names):
@@ -9891,9 +10063,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.GetInvalidValuesES3():
+ code = """ %(name)s.RemoveValues(
+ invalid_%(name)s_table_es3, arraysize(invalid_%(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));
« no previous file with comments | « no previous file | gpu/command_buffer/cmd_buffer_functions.txt » ('j') | gpu/command_buffer/cmd_buffer_functions.txt » ('J')

Powered by Google App Engine
This is Rietveld 408576698