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

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

Issue 2337833002: Implement WEBGL_compressed_texture_s3tc_srgb (Closed)
Patch Set: replace NV_sRGB_formats with (draft) EXT_texture_compression_s3tc_srgb 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/service/feature_info.cc
diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc
index f52374aa71631f9e352b8bde72937a022a18bd94..a2b94b7eab74f19b685a52f7527f32269fa6dc33 100644
--- a/gpu/command_buffer/service/feature_info.cc
+++ b/gpu/command_buffer/service/feature_info.cc
@@ -591,11 +591,13 @@ void FeatureInfo::InitializeFeatures() {
// sized formats GL_SRGB8 and GL_SRGB8_ALPHA8. Also, SRGB_EXT isn't a valid
// <format> in this case. So, even with GLES3 explicitly check for
// GL_EXT_sRGB.
+ bool have_srgb = false;
if ((((gl_version_info_->is_es3 ||
extensions.Contains("GL_OES_rgb8_rgba8")) &&
extensions.Contains("GL_EXT_sRGB")) ||
feature_flags_.desktop_srgb_support) &&
IsWebGL1OrES2Context()) {
+ have_srgb = true;
AddExtensionString("GL_EXT_sRGB");
validators_.texture_internal_format.AddValue(GL_SRGB_EXT);
validators_.texture_internal_format.AddValue(GL_SRGB_ALPHA_EXT);
@@ -608,6 +610,28 @@ void FeatureInfo::InitializeFeatures() {
validators_.texture_unsized_internal_format.AddValue(GL_SRGB_ALPHA_EXT);
}
+ if ((have_s3tc || (enable_dxt1 && enable_dxt3 && enable_dxt5)) && have_srgb) {
+ 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

Powered by Google App Engine
This is Rietveld 408576698