Chromium Code Reviews| 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 ed641a619a9bea6e5f85e8a99b9a9cd62604585a..36d86e16411d54bed1c7beec880607421138c9a9 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,32 @@ void FeatureInfo::InitializeFeatures() { |
| validators_.texture_unsized_internal_format.AddValue(GL_SRGB_ALPHA_EXT); |
| } |
| + if ((have_s3tc || (enable_dxt1 && enable_dxt3 && enable_dxt5)) && have_srgb) { |
|
jbauman
2016/09/15 00:14:25
Will this actually guarantee that these SRGB forma
Kai Ninomiya
2016/09/15 20:45:35
You're right. It should be enabled if the desktop
|
| + AddExtensionString("GL_NV_sRGB_formats"); |
| + |
| + 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); |
|
jbauman
2016/09/15 00:14:25
I guess we're not going to bother with GL_SLUMINAN
Ken Russell (switch to Gerrit)
2016/09/15 00:50:35
Agreed.
Should we consider exposing the extension
Kai Ninomiya
2016/09/15 20:45:35
I have tried replacing GL_NV_sRGB_formats with GL_
Kai Ninomiya
2016/09/15 21:54:08
Never mind, it actually works fine.
We decided of
|
| + |
| + //validators_.texture_internal_format.AddValue(_); |
| + //validators_.texture_format.AddValue(_); |
| + //validators_.texture_unsized_internal_format.AddValue(_); |
|
jbauman
2016/09/15 00:14:25
Unneeded?
Kai Ninomiya
2016/09/15 20:45:35
Done.
|
| + } |
| + |
| // 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 |