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

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: Fix 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 a47a84639489dde0a4f3e6aadbb6869f90f7e06c..5b72844a747901e394fba0ca6cd4781add6d4f28 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 = {
@@ -1380,14 +1381,17 @@ _NAMED_TYPE_INFO = {
'GL_BGR',
],
},
- 'CopyTextureInternalFormat': {
+ 'TextureInternalFormatStorage': {
'type': 'GLenum',
'valid': [
- 'GL_ALPHA',
- 'GL_LUMINANCE',
- 'GL_LUMINANCE_ALPHA',
- 'GL_RGB',
- 'GL_RGBA',
+ 'GL_RGB565',
+ 'GL_RGBA4',
+ 'GL_RGB5_A1',
+ 'GL_ALPHA8_EXT',
+ 'GL_LUMINANCE8_EXT',
+ 'GL_LUMINANCE8_ALPHA8_EXT',
+ 'GL_RGB8_OES',
+ 'GL_RGBA8_OES',
],
'valid_es3': [
'GL_R8',
@@ -1410,9 +1414,7 @@ _NAMED_TYPE_INFO = {
'GL_RG16I',
'GL_RG32UI',
'GL_RG32I',
- 'GL_RGB8',
'GL_SRGB8',
- 'GL_RGB565',
'GL_RGB8_SNORM',
'GL_R11F_G11F_B10F',
'GL_RGB9_E5',
@@ -1424,11 +1426,8 @@ _NAMED_TYPE_INFO = {
'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',
@@ -1439,23 +1438,32 @@ _NAMED_TYPE_INFO = {
'GL_RGBA16I',
'GL_RGBA32UI',
'GL_RGBA32I',
- ],
- 'invalid': [
- 'GL_BGRA',
- 'GL_BGR',
- ],
- },
- 'TextureInternalFormatStorage': {
- 'type': 'GLenum',
- 'valid': [
- 'GL_RGB565',
- 'GL_RGBA4',
- 'GL_RGB5_A1',
+ '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': [
'GL_ALPHA8_EXT',
'GL_LUMINANCE8_EXT',
'GL_LUMINANCE8_ALPHA8_EXT',
- 'GL_RGB8_OES',
- 'GL_RGBA8_OES',
+ 'GL_ALPHA16F_EXT',
+ 'GL_LUMINANCE16F_EXT',
+ 'GL_LUMINANCE_ALPHA16F_EXT',
+ 'GL_ALPHA32F_EXT',
+ 'GL_LUMINANCE32F_EXT',
+ 'GL_LUMINANCE_ALPHA32F_EXT',
],
},
'ImageInternalFormat': {
@@ -7701,6 +7709,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']
@@ -7714,6 +7726,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
@@ -10020,6 +10035,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):
@@ -10039,9 +10061,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/service/gles2_cmd_decoder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698