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

Side by Side Diff: gpu/command_buffer/service/feature_info.cc

Issue 1263043006: Implement the texture uploading of ASTC compression for WebGL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup and Remove unnecessary enum/OES extensions. Created 5 years, 4 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 unified diff | Download patch
OLDNEW
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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 enable_texture_float_linear(false), 138 enable_texture_float_linear(false),
139 enable_texture_half_float_linear(false), 139 enable_texture_half_float_linear(false),
140 angle_translated_shader_source(false), 140 angle_translated_shader_source(false),
141 angle_pack_reverse_row_order(false), 141 angle_pack_reverse_row_order(false),
142 arb_texture_rectangle(false), 142 arb_texture_rectangle(false),
143 angle_instanced_arrays(false), 143 angle_instanced_arrays(false),
144 occlusion_query_boolean(false), 144 occlusion_query_boolean(false),
145 use_arb_occlusion_query2_for_occlusion_query_boolean(false), 145 use_arb_occlusion_query2_for_occlusion_query_boolean(false),
146 use_arb_occlusion_query_for_occlusion_query_boolean(false), 146 use_arb_occlusion_query_for_occlusion_query_boolean(false),
147 native_vertex_array_object(false), 147 native_vertex_array_object(false),
148 ext_texture_format_astc(false),
148 ext_texture_format_atc(false), 149 ext_texture_format_atc(false),
149 ext_texture_format_bgra8888(false), 150 ext_texture_format_bgra8888(false),
150 ext_texture_format_dxt1(false), 151 ext_texture_format_dxt1(false),
151 ext_texture_format_dxt5(false), 152 ext_texture_format_dxt5(false),
152 enable_shader_name_hashing(false), 153 enable_shader_name_hashing(false),
153 enable_samplers(false), 154 enable_samplers(false),
154 ext_draw_buffers(false), 155 ext_draw_buffers(false),
155 nv_draw_buffers(false), 156 nv_draw_buffers(false),
156 ext_frag_depth(false), 157 ext_frag_depth(false),
157 ext_shader_texture_lod(false), 158 ext_shader_texture_lod(false),
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 // The difference between GL_EXT_texture_compression_s3tc and 378 // The difference between GL_EXT_texture_compression_s3tc and
378 // GL_CHROMIUM_texture_compression_dxt5 is that the former 379 // GL_CHROMIUM_texture_compression_dxt5 is that the former
379 // requires on the fly compression. The latter does not. 380 // requires on the fly compression. The latter does not.
380 AddExtensionString("GL_CHROMIUM_texture_compression_dxt5"); 381 AddExtensionString("GL_CHROMIUM_texture_compression_dxt5");
381 validators_.compressed_texture_format.AddValue( 382 validators_.compressed_texture_format.AddValue(
382 GL_COMPRESSED_RGBA_S3TC_DXT5_EXT); 383 GL_COMPRESSED_RGBA_S3TC_DXT5_EXT);
383 validators_.texture_internal_format_storage.AddValue( 384 validators_.texture_internal_format_storage.AddValue(
384 GL_COMPRESSED_RGBA_S3TC_DXT5_EXT); 385 GL_COMPRESSED_RGBA_S3TC_DXT5_EXT);
385 } 386 }
386 387
388 bool have_astc = extensions.Contains("GL_KHR_texture_compression_astc_ldr");
389 if (have_astc) {
390 feature_flags_.ext_texture_format_astc = true;
391 AddExtensionString("GL_KHR_texture_compression_astc_ldr");
392
393 // GL_COMPRESSED_RGBA_ASTC(0x93B0 ~ 0x93BD)
394 GLint astc_format_it = GL_COMPRESSED_RGBA_ASTC_4x4_KHR;
395 GLint astc_format_max = GL_COMPRESSED_RGBA_ASTC_12x12_KHR;
396 for (; astc_format_it <= astc_format_max; astc_format_it++)
397 validators_.compressed_texture_format.AddValue(astc_format_it);
398
399 // GL_COMPRESSED_SRGB8_ALPHA8_ASTC(0x93D0 ~ 0x93DD)
400 astc_format_it = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;
401 astc_format_max = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR;
402 for (; astc_format_it <= astc_format_max; astc_format_it++)
403 validators_.compressed_texture_format.AddValue(astc_format_it);
404 }
405
387 bool have_atc = extensions.Contains("GL_AMD_compressed_ATC_texture") || 406 bool have_atc = extensions.Contains("GL_AMD_compressed_ATC_texture") ||
388 extensions.Contains("GL_ATI_texture_compression_atitc"); 407 extensions.Contains("GL_ATI_texture_compression_atitc");
389 if (have_atc) { 408 if (have_atc) {
390 feature_flags_.ext_texture_format_atc = true; 409 feature_flags_.ext_texture_format_atc = true;
391 410
392 AddExtensionString("GL_AMD_compressed_ATC_texture"); 411 AddExtensionString("GL_AMD_compressed_ATC_texture");
393 validators_.compressed_texture_format.AddValue(GL_ATC_RGB_AMD); 412 validators_.compressed_texture_format.AddValue(GL_ATC_RGB_AMD);
394 validators_.compressed_texture_format.AddValue( 413 validators_.compressed_texture_format.AddValue(
395 GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD); 414 GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD);
396 415
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after
1169 if (pos == std::string::npos) { 1188 if (pos == std::string::npos) {
1170 extensions_ += (extensions_.empty() ? "" : " ") + str; 1189 extensions_ += (extensions_.empty() ? "" : " ") + str;
1171 } 1190 }
1172 } 1191 }
1173 1192
1174 FeatureInfo::~FeatureInfo() { 1193 FeatureInfo::~FeatureInfo() {
1175 } 1194 }
1176 1195
1177 } // namespace gles2 1196 } // namespace gles2
1178 } // namespace gpu 1197 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698