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

Unified Diff: gpu/command_buffer/build_gles2_cmd_buffer.py

Issue 2354713004: Implement WEBGL_compressed_texture_es3_0 extension for WebGL 1/2 (Closed)
Patch Set: refactor ETC2/EAC support in command buffer (plus rebase) Created 4 years, 3 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 670cee33f248ae9aa7d11ccd91f41898faad57ff..47ade8d74a7881ea5d6de99b954c06d0d220cf16 100755
--- a/gpu/command_buffer/build_gles2_cmd_buffer.py
+++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -811,16 +811,6 @@ _NAMED_TYPE_INFO = {
'valid': [
],
'valid_es3': [
- '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',
],
},
'GLState': {
@@ -2121,16 +2111,6 @@ _NAMED_TYPE_INFO = {
'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',
@@ -2308,6 +2288,19 @@ _NAMED_TYPE_INFO = {
},
}
+_ES30_COMPRESSED_TEXTURE_FORMATS = [
+ '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',
+]
+
# This table specifies the different pepper interfaces that are supported for
# GL commands. 'dev' is true if it's a dev interface.
_PEPPER_INTERFACES = [
@@ -10939,6 +10932,18 @@ extern const NameToFunc g_gles2_function_table[] = {
f.write(code % {
'name': ToUnderscore(name),
})
+ f.write("UpdateES30CompressedTextureFormats();");
+ f.write("}\n\n");
+
+ f.write("void Validators::UpdateES30CompressedTextureFormats() {\n")
+ for name in ['CompressedTextureFormat', 'TextureInternalFormatStorage']:
+ for fmt in _ES30_COMPRESSED_TEXTURE_FORMATS:
+ code = """ %(name)s.AddValue(%(format)s);
+"""
+ f.write(code % {
+ 'name': ToUnderscore(name),
+ 'format': fmt,
+ })
f.write("}\n\n");
self.generated_cpp_filenames.append(filename)

Powered by Google App Engine
This is Rietveld 408576698