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

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

Issue 916083002: Add support for compressed GPU memory buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix ozone Created 5 years, 10 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
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),
135 ext_texture_format_bgra8888(false), 136 ext_texture_format_bgra8888(false),
137 ext_texture_format_dxt1(false),
138 ext_texture_format_dxt5(false),
136 enable_shader_name_hashing(false), 139 enable_shader_name_hashing(false),
137 enable_samplers(false), 140 enable_samplers(false),
138 ext_draw_buffers(false), 141 ext_draw_buffers(false),
139 nv_draw_buffers(false), 142 nv_draw_buffers(false),
140 ext_frag_depth(false), 143 ext_frag_depth(false),
141 ext_shader_texture_lod(false), 144 ext_shader_texture_lod(false),
142 use_async_readpixels(false), 145 use_async_readpixels(false),
143 map_buffer_range(false), 146 map_buffer_range(false),
144 ext_discard_framebuffer(false), 147 ext_discard_framebuffer(false),
145 angle_depth_texture(false), 148 angle_depth_texture(false),
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 enable_dxt1 = true; 329 enable_dxt1 = true;
327 } 330 }
328 if (have_dxt3) { 331 if (have_dxt3) {
329 enable_dxt3 = true; 332 enable_dxt3 = true;
330 } 333 }
331 if (have_dxt5) { 334 if (have_dxt5) {
332 enable_dxt5 = true; 335 enable_dxt5 = true;
333 } 336 }
334 337
335 if (enable_dxt1) { 338 if (enable_dxt1) {
339 feature_flags_.ext_texture_format_dxt1 = true;
340
336 AddExtensionString("GL_EXT_texture_compression_dxt1"); 341 AddExtensionString("GL_EXT_texture_compression_dxt1");
337 validators_.compressed_texture_format.AddValue( 342 validators_.compressed_texture_format.AddValue(
338 GL_COMPRESSED_RGB_S3TC_DXT1_EXT); 343 GL_COMPRESSED_RGB_S3TC_DXT1_EXT);
339 validators_.compressed_texture_format.AddValue( 344 validators_.compressed_texture_format.AddValue(
340 GL_COMPRESSED_RGBA_S3TC_DXT1_EXT); 345 GL_COMPRESSED_RGBA_S3TC_DXT1_EXT);
341 } 346 }
342 347
343 if (enable_dxt3) { 348 if (enable_dxt3) {
344 // The difference between GL_EXT_texture_compression_s3tc and 349 // The difference between GL_EXT_texture_compression_s3tc and
345 // GL_CHROMIUM_texture_compression_dxt3 is that the former 350 // GL_CHROMIUM_texture_compression_dxt3 is that the former
346 // requires on the fly compression. The latter does not. 351 // requires on the fly compression. The latter does not.
347 AddExtensionString("GL_CHROMIUM_texture_compression_dxt3"); 352 AddExtensionString("GL_CHROMIUM_texture_compression_dxt3");
348 validators_.compressed_texture_format.AddValue( 353 validators_.compressed_texture_format.AddValue(
349 GL_COMPRESSED_RGBA_S3TC_DXT3_EXT); 354 GL_COMPRESSED_RGBA_S3TC_DXT3_EXT);
350 } 355 }
351 356
352 if (enable_dxt5) { 357 if (enable_dxt5) {
358 feature_flags_.ext_texture_format_dxt5 = true;
359
353 // The difference between GL_EXT_texture_compression_s3tc and 360 // The difference between GL_EXT_texture_compression_s3tc and
354 // GL_CHROMIUM_texture_compression_dxt5 is that the former 361 // GL_CHROMIUM_texture_compression_dxt5 is that the former
355 // requires on the fly compression. The latter does not. 362 // requires on the fly compression. The latter does not.
356 AddExtensionString("GL_CHROMIUM_texture_compression_dxt5"); 363 AddExtensionString("GL_CHROMIUM_texture_compression_dxt5");
357 validators_.compressed_texture_format.AddValue( 364 validators_.compressed_texture_format.AddValue(
358 GL_COMPRESSED_RGBA_S3TC_DXT5_EXT); 365 GL_COMPRESSED_RGBA_S3TC_DXT5_EXT);
359 } 366 }
360 367
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
361 // Check if we should enable GL_EXT_texture_filter_anisotropic. 379 // Check if we should enable GL_EXT_texture_filter_anisotropic.
362 if (extensions.Contains("GL_EXT_texture_filter_anisotropic")) { 380 if (extensions.Contains("GL_EXT_texture_filter_anisotropic")) {
363 AddExtensionString("GL_EXT_texture_filter_anisotropic"); 381 AddExtensionString("GL_EXT_texture_filter_anisotropic");
364 validators_.texture_parameter.AddValue( 382 validators_.texture_parameter.AddValue(
365 GL_TEXTURE_MAX_ANISOTROPY_EXT); 383 GL_TEXTURE_MAX_ANISOTROPY_EXT);
366 validators_.g_l_state.AddValue( 384 validators_.g_l_state.AddValue(
367 GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT); 385 GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT);
368 } 386 }
369 387
370 // Check if we should support GL_OES_packed_depth_stencil and/or 388 // Check if we should support GL_OES_packed_depth_stencil and/or
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
1044 if (pos == std::string::npos) { 1062 if (pos == std::string::npos) {
1045 extensions_ += (extensions_.empty() ? "" : " ") + str; 1063 extensions_ += (extensions_.empty() ? "" : " ") + str;
1046 } 1064 }
1047 } 1065 }
1048 1066
1049 FeatureInfo::~FeatureInfo() { 1067 FeatureInfo::~FeatureInfo() {
1050 } 1068 }
1051 1069
1052 } // namespace gles2 1070 } // namespace gles2
1053 } // namespace gpu 1071 } // 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