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 ad541891f1a5be31f5a68b0d5565deb80f877d4b..1561be27399f6d91e54e1f274c7d6de8673369f1 100644 |
| --- a/gpu/command_buffer/service/feature_info.cc |
| +++ b/gpu/command_buffer/service/feature_info.cc |
| @@ -145,6 +145,7 @@ FeatureInfo::FeatureFlags::FeatureFlags() |
| use_arb_occlusion_query2_for_occlusion_query_boolean(false), |
| use_arb_occlusion_query_for_occlusion_query_boolean(false), |
| native_vertex_array_object(false), |
| + ext_texture_format_astc(false), |
| ext_texture_format_atc(false), |
| ext_texture_format_bgra8888(false), |
| ext_texture_format_dxt1(false), |
| @@ -384,6 +385,31 @@ void FeatureInfo::InitializeFeatures() { |
| GL_COMPRESSED_RGBA_S3TC_DXT5_EXT); |
| } |
| + bool have_astc = extensions.Contains("GL_OES_texture_compression_astc") || |
|
Ken Russell (switch to Gerrit)
2015/08/07 22:32:33
I don't think we should reference the GL_OES_textu
|
| + extensions.Contains("GL_KHR_texture_compression_astc_ldr"); |
| + if (have_astc) { |
| + feature_flags_.ext_texture_format_astc = true; |
| + AddExtensionString("GL_KHR_texture_compression_astc_ldr"); |
| + |
| + GLint astc_rgba_type_max = |
| + (GL_COMPRESSED_RGBA_ASTC_12x12_KHR - |
| + GL_COMPRESSED_RGBA_ASTC_4x4_KHR); |
| + GLint astc_srgba_type_max = |
| + (GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR - |
| + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR); |
| + |
| + // GL_COMPRESSED_RGBA_ASTC |
| + for (GLint i = 0; i <= astc_rgba_type_max; i++) { |
|
Ken Russell (switch to Gerrit)
2015/08/07 22:32:33
Why not just iterate from COMPRESSED_RGBA_ASTC_4x4
|
| + GLint format = GL_COMPRESSED_RGBA_ASTC_4x4_KHR + i; |
| + validators_.compressed_texture_format.AddValue(format); |
| + } |
| + // GL_COMPRESSED_SRGB8_ALPHA8_ASTC |
| + for (GLint i = 0; i <= astc_srgba_type_max; i++) { |
| + GLint format = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR + i; |
| + validators_.compressed_texture_format.AddValue(format); |
| + } |
| + } |
| + |
| bool have_atc = extensions.Contains("GL_AMD_compressed_ATC_texture") || |
| extensions.Contains("GL_ATI_texture_compression_atitc"); |
| if (have_atc) { |