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

Unified Diff: gpu/command_buffer/service/feature_info.cc

Issue 2337833002: Implement WEBGL_compressed_texture_s3tc_srgb (Closed)
Patch Set: add test and fix feature detection (enabled on webgl2, android/tegra) 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
« no previous file with comments | « no previous file | gpu/command_buffer/service/feature_info_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/feature_info.cc
diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc
index f52374aa71631f9e352b8bde72937a022a18bd94..cf483ab1e562f2a7391b79c40762244610d13141 100644
--- a/gpu/command_buffer/service/feature_info.cc
+++ b/gpu/command_buffer/service/feature_info.cc
@@ -608,6 +608,34 @@ void FeatureInfo::InitializeFeatures() {
validators_.texture_unsized_internal_format.AddValue(GL_SRGB_ALPHA_EXT);
}
+ // On desktop, GL_EXT_texture_sRGB is required regardless of GL version,
+ // since the sRGB formats in OpenGL 3.0 Core do not support S3TC.
+ // TODO(kainino): Support GL_EXT_texture_compression_s3tc_srgb once ratified.
+ if ((gl_version_info_->is_es && extensions.Contains("GL_NV_sRGB_formats")) ||
+ (!gl_version_info_->is_es &&
+ extensions.Contains("GL_EXT_texture_sRGB") &&
+ extensions.Contains("GL_EXT_texture_compression_s3tc"))) {
+ AddExtensionString("GL_EXT_texture_compression_s3tc_srgb");
+
+ validators_.compressed_texture_format.AddValue(
+ GL_COMPRESSED_SRGB_S3TC_DXT1_EXT);
+ validators_.compressed_texture_format.AddValue(
+ GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT);
+ validators_.compressed_texture_format.AddValue(
+ GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT);
+ validators_.compressed_texture_format.AddValue(
+ GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT);
+
+ validators_.texture_internal_format_storage.AddValue(
+ GL_COMPRESSED_SRGB_S3TC_DXT1_EXT);
+ validators_.texture_internal_format_storage.AddValue(
+ GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT);
+ validators_.texture_internal_format_storage.AddValue(
+ GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT);
+ validators_.texture_internal_format_storage.AddValue(
+ GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT);
+ }
+
// Note: Only APPLE_texture_format_BGRA8888 extension allows BGRA8_EXT in
// ES3's glTexStorage2D, whereas EXT_texture_format_BGRA8888 doesn't provide
// that compatibility. So if EXT_texture_format_BGRA8888 (but not
« no previous file with comments | « no previous file | gpu/command_buffer/service/feature_info_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698