| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "gpu/command_buffer/service/feature_info.h" | 5 #include "gpu/command_buffer/service/feature_info.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 enable_texture_float_linear(false), | 125 enable_texture_float_linear(false), |
| 126 enable_texture_half_float_linear(false), | 126 enable_texture_half_float_linear(false), |
| 127 angle_translated_shader_source(false), | 127 angle_translated_shader_source(false), |
| 128 angle_pack_reverse_row_order(false), | 128 angle_pack_reverse_row_order(false), |
| 129 arb_texture_rectangle(false), | 129 arb_texture_rectangle(false), |
| 130 angle_instanced_arrays(false), | 130 angle_instanced_arrays(false), |
| 131 occlusion_query_boolean(false), | 131 occlusion_query_boolean(false), |
| 132 use_arb_occlusion_query2_for_occlusion_query_boolean(false), | 132 use_arb_occlusion_query2_for_occlusion_query_boolean(false), |
| 133 use_arb_occlusion_query_for_occlusion_query_boolean(false), | 133 use_arb_occlusion_query_for_occlusion_query_boolean(false), |
| 134 native_vertex_array_object(false), | 134 native_vertex_array_object(false), |
| 135 ext_texture_format_atc(false), | |
| 136 ext_texture_format_bgra8888(false), | 135 ext_texture_format_bgra8888(false), |
| 137 ext_texture_format_dxt1(false), | |
| 138 ext_texture_format_dxt5(false), | |
| 139 enable_shader_name_hashing(false), | 136 enable_shader_name_hashing(false), |
| 140 enable_samplers(false), | 137 enable_samplers(false), |
| 141 ext_draw_buffers(false), | 138 ext_draw_buffers(false), |
| 142 nv_draw_buffers(false), | 139 nv_draw_buffers(false), |
| 143 ext_frag_depth(false), | 140 ext_frag_depth(false), |
| 144 ext_shader_texture_lod(false), | 141 ext_shader_texture_lod(false), |
| 145 use_async_readpixels(false), | 142 use_async_readpixels(false), |
| 146 map_buffer_range(false), | 143 map_buffer_range(false), |
| 147 ext_discard_framebuffer(false), | 144 ext_discard_framebuffer(false), |
| 148 angle_depth_texture(false), | 145 angle_depth_texture(false), |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 enable_dxt1 = true; | 326 enable_dxt1 = true; |
| 330 } | 327 } |
| 331 if (have_dxt3) { | 328 if (have_dxt3) { |
| 332 enable_dxt3 = true; | 329 enable_dxt3 = true; |
| 333 } | 330 } |
| 334 if (have_dxt5) { | 331 if (have_dxt5) { |
| 335 enable_dxt5 = true; | 332 enable_dxt5 = true; |
| 336 } | 333 } |
| 337 | 334 |
| 338 if (enable_dxt1) { | 335 if (enable_dxt1) { |
| 339 feature_flags_.ext_texture_format_dxt1 = true; | |
| 340 | |
| 341 AddExtensionString("GL_EXT_texture_compression_dxt1"); | 336 AddExtensionString("GL_EXT_texture_compression_dxt1"); |
| 342 validators_.compressed_texture_format.AddValue( | 337 validators_.compressed_texture_format.AddValue( |
| 343 GL_COMPRESSED_RGB_S3TC_DXT1_EXT); | 338 GL_COMPRESSED_RGB_S3TC_DXT1_EXT); |
| 344 validators_.compressed_texture_format.AddValue( | 339 validators_.compressed_texture_format.AddValue( |
| 345 GL_COMPRESSED_RGBA_S3TC_DXT1_EXT); | 340 GL_COMPRESSED_RGBA_S3TC_DXT1_EXT); |
| 346 } | 341 } |
| 347 | 342 |
| 348 if (enable_dxt3) { | 343 if (enable_dxt3) { |
| 349 // The difference between GL_EXT_texture_compression_s3tc and | 344 // The difference between GL_EXT_texture_compression_s3tc and |
| 350 // GL_CHROMIUM_texture_compression_dxt3 is that the former | 345 // GL_CHROMIUM_texture_compression_dxt3 is that the former |
| 351 // requires on the fly compression. The latter does not. | 346 // requires on the fly compression. The latter does not. |
| 352 AddExtensionString("GL_CHROMIUM_texture_compression_dxt3"); | 347 AddExtensionString("GL_CHROMIUM_texture_compression_dxt3"); |
| 353 validators_.compressed_texture_format.AddValue( | 348 validators_.compressed_texture_format.AddValue( |
| 354 GL_COMPRESSED_RGBA_S3TC_DXT3_EXT); | 349 GL_COMPRESSED_RGBA_S3TC_DXT3_EXT); |
| 355 } | 350 } |
| 356 | 351 |
| 357 if (enable_dxt5) { | 352 if (enable_dxt5) { |
| 358 feature_flags_.ext_texture_format_dxt5 = true; | |
| 359 | |
| 360 // The difference between GL_EXT_texture_compression_s3tc and | 353 // The difference between GL_EXT_texture_compression_s3tc and |
| 361 // GL_CHROMIUM_texture_compression_dxt5 is that the former | 354 // GL_CHROMIUM_texture_compression_dxt5 is that the former |
| 362 // requires on the fly compression. The latter does not. | 355 // requires on the fly compression. The latter does not. |
| 363 AddExtensionString("GL_CHROMIUM_texture_compression_dxt5"); | 356 AddExtensionString("GL_CHROMIUM_texture_compression_dxt5"); |
| 364 validators_.compressed_texture_format.AddValue( | 357 validators_.compressed_texture_format.AddValue( |
| 365 GL_COMPRESSED_RGBA_S3TC_DXT5_EXT); | 358 GL_COMPRESSED_RGBA_S3TC_DXT5_EXT); |
| 366 } | 359 } |
| 367 | 360 |
| 368 bool have_atc = extensions.Contains("GL_AMD_compressed_ATC_texture") || | |
| 369 extensions.Contains("GL_ATI_texture_compression_atitc"); | |
| 370 if (have_atc) { | |
| 371 feature_flags_.ext_texture_format_atc = true; | |
| 372 | |
| 373 AddExtensionString("GL_AMD_compressed_ATC_texture"); | |
| 374 validators_.compressed_texture_format.AddValue(GL_ATC_RGB_AMD); | |
| 375 validators_.compressed_texture_format.AddValue( | |
| 376 GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD); | |
| 377 } | |
| 378 | |
| 379 // Check if we should enable GL_EXT_texture_filter_anisotropic. | 361 // Check if we should enable GL_EXT_texture_filter_anisotropic. |
| 380 if (extensions.Contains("GL_EXT_texture_filter_anisotropic")) { | 362 if (extensions.Contains("GL_EXT_texture_filter_anisotropic")) { |
| 381 AddExtensionString("GL_EXT_texture_filter_anisotropic"); | 363 AddExtensionString("GL_EXT_texture_filter_anisotropic"); |
| 382 validators_.texture_parameter.AddValue( | 364 validators_.texture_parameter.AddValue( |
| 383 GL_TEXTURE_MAX_ANISOTROPY_EXT); | 365 GL_TEXTURE_MAX_ANISOTROPY_EXT); |
| 384 validators_.g_l_state.AddValue( | 366 validators_.g_l_state.AddValue( |
| 385 GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT); | 367 GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT); |
| 386 } | 368 } |
| 387 | 369 |
| 388 // Check if we should support GL_OES_packed_depth_stencil and/or | 370 // Check if we should support GL_OES_packed_depth_stencil and/or |
| (...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1062 if (pos == std::string::npos) { | 1044 if (pos == std::string::npos) { |
| 1063 extensions_ += (extensions_.empty() ? "" : " ") + str; | 1045 extensions_ += (extensions_.empty() ? "" : " ") + str; |
| 1064 } | 1046 } |
| 1065 } | 1047 } |
| 1066 | 1048 |
| 1067 FeatureInfo::~FeatureInfo() { | 1049 FeatureInfo::~FeatureInfo() { |
| 1068 } | 1050 } |
| 1069 | 1051 |
| 1070 } // namespace gles2 | 1052 } // namespace gles2 |
| 1071 } // namespace gpu | 1053 } // namespace gpu |
| OLD | NEW |