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

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: Add braces and cleanup. Created 5 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 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 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 enable_texture_float_linear(false), 139 enable_texture_float_linear(false),
140 enable_texture_half_float_linear(false), 140 enable_texture_half_float_linear(false),
141 angle_translated_shader_source(false), 141 angle_translated_shader_source(false),
142 angle_pack_reverse_row_order(false), 142 angle_pack_reverse_row_order(false),
143 arb_texture_rectangle(false), 143 arb_texture_rectangle(false),
144 angle_instanced_arrays(false), 144 angle_instanced_arrays(false),
145 occlusion_query_boolean(false), 145 occlusion_query_boolean(false),
146 use_arb_occlusion_query2_for_occlusion_query_boolean(false), 146 use_arb_occlusion_query2_for_occlusion_query_boolean(false),
147 use_arb_occlusion_query_for_occlusion_query_boolean(false), 147 use_arb_occlusion_query_for_occlusion_query_boolean(false),
148 native_vertex_array_object(false), 148 native_vertex_array_object(false),
149 ext_texture_format_astc(false),
149 ext_texture_format_atc(false), 150 ext_texture_format_atc(false),
150 ext_texture_format_bgra8888(false), 151 ext_texture_format_bgra8888(false),
151 ext_texture_format_dxt1(false), 152 ext_texture_format_dxt1(false),
152 ext_texture_format_dxt5(false), 153 ext_texture_format_dxt5(false),
153 enable_shader_name_hashing(false), 154 enable_shader_name_hashing(false),
154 enable_samplers(false), 155 enable_samplers(false),
155 ext_draw_buffers(false), 156 ext_draw_buffers(false),
156 nv_draw_buffers(false), 157 nv_draw_buffers(false),
157 ext_frag_depth(false), 158 ext_frag_depth(false),
158 ext_shader_texture_lod(false), 159 ext_shader_texture_lod(false),
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 // The difference between GL_EXT_texture_compression_s3tc and 364 // The difference between GL_EXT_texture_compression_s3tc and
364 // GL_CHROMIUM_texture_compression_dxt5 is that the former 365 // GL_CHROMIUM_texture_compression_dxt5 is that the former
365 // requires on the fly compression. The latter does not. 366 // requires on the fly compression. The latter does not.
366 AddExtensionString("GL_CHROMIUM_texture_compression_dxt5"); 367 AddExtensionString("GL_CHROMIUM_texture_compression_dxt5");
367 validators_.compressed_texture_format.AddValue( 368 validators_.compressed_texture_format.AddValue(
368 GL_COMPRESSED_RGBA_S3TC_DXT5_EXT); 369 GL_COMPRESSED_RGBA_S3TC_DXT5_EXT);
369 validators_.texture_internal_format_storage.AddValue( 370 validators_.texture_internal_format_storage.AddValue(
370 GL_COMPRESSED_RGBA_S3TC_DXT5_EXT); 371 GL_COMPRESSED_RGBA_S3TC_DXT5_EXT);
371 } 372 }
372 373
374 bool have_astc = extensions.Contains("GL_KHR_texture_compression_astc_ldr");
375 if (have_astc) {
376 feature_flags_.ext_texture_format_astc = true;
377 AddExtensionString("GL_KHR_texture_compression_astc_ldr");
378
379 // GL_COMPRESSED_RGBA_ASTC(0x93B0 ~ 0x93BD)
380 GLint astc_format_it = GL_COMPRESSED_RGBA_ASTC_4x4_KHR;
381 GLint astc_format_max = GL_COMPRESSED_RGBA_ASTC_12x12_KHR;
382 for (; astc_format_it <= astc_format_max; astc_format_it++)
383 validators_.compressed_texture_format.AddValue(astc_format_it);
384
385 // GL_COMPRESSED_SRGB8_ALPHA8_ASTC(0x93D0 ~ 0x93DD)
386 astc_format_it = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;
387 astc_format_max = GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR;
388 for (; astc_format_it <= astc_format_max; astc_format_it++)
389 validators_.compressed_texture_format.AddValue(astc_format_it);
390 }
391
373 bool have_atc = extensions.Contains("GL_AMD_compressed_ATC_texture") || 392 bool have_atc = extensions.Contains("GL_AMD_compressed_ATC_texture") ||
374 extensions.Contains("GL_ATI_texture_compression_atitc"); 393 extensions.Contains("GL_ATI_texture_compression_atitc");
375 if (have_atc) { 394 if (have_atc) {
376 feature_flags_.ext_texture_format_atc = true; 395 feature_flags_.ext_texture_format_atc = true;
377 396
378 AddExtensionString("GL_AMD_compressed_ATC_texture"); 397 AddExtensionString("GL_AMD_compressed_ATC_texture");
379 validators_.compressed_texture_format.AddValue(GL_ATC_RGB_AMD); 398 validators_.compressed_texture_format.AddValue(GL_ATC_RGB_AMD);
380 validators_.compressed_texture_format.AddValue( 399 validators_.compressed_texture_format.AddValue(
381 GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD); 400 GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD);
382 401
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 if (pos == std::string::npos) { 1174 if (pos == std::string::npos) {
1156 extensions_ += (extensions_.empty() ? "" : " ") + str; 1175 extensions_ += (extensions_.empty() ? "" : " ") + str;
1157 } 1176 }
1158 } 1177 }
1159 1178
1160 FeatureInfo::~FeatureInfo() { 1179 FeatureInfo::~FeatureInfo() {
1161 } 1180 }
1162 1181
1163 } // namespace gles2 1182 } // namespace gles2
1164 } // namespace gpu 1183 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/feature_info.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698