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

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

Issue 9694025: Add support for GL_COMMANDS_ISSUED_CHROMIUM fence like query. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add cast for std::min Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « gpu/command_buffer/service/feature_info.h ('k') | gpu/command_buffer/service/gl_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "gpu/command_buffer/service/gl_utils.h" 10 #include "gpu/command_buffer/service/gl_utils.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 111
112 bool npot_ok = false; 112 bool npot_ok = false;
113 113
114 AddExtensionString("GL_CHROMIUM_resource_safe"); 114 AddExtensionString("GL_CHROMIUM_resource_safe");
115 AddExtensionString("GL_CHROMIUM_resize"); 115 AddExtensionString("GL_CHROMIUM_resize");
116 AddExtensionString("GL_CHROMIUM_strict_attribs"); 116 AddExtensionString("GL_CHROMIUM_strict_attribs");
117 AddExtensionString("GL_CHROMIUM_swapbuffers_complete_callback"); 117 AddExtensionString("GL_CHROMIUM_swapbuffers_complete_callback");
118 AddExtensionString("GL_CHROMIUM_rate_limit_offscreen_context"); 118 AddExtensionString("GL_CHROMIUM_rate_limit_offscreen_context");
119 AddExtensionString("GL_CHROMIUM_set_visibility"); 119 AddExtensionString("GL_CHROMIUM_set_visibility");
120 AddExtensionString("GL_CHROMIUM_gpu_memory_manager"); 120 AddExtensionString("GL_CHROMIUM_gpu_memory_manager");
121 AddExtensionString("GL_CHROMIUM_command_buffer_query");
121 AddExtensionString("GL_ANGLE_translated_shader_source"); 122 AddExtensionString("GL_ANGLE_translated_shader_source");
122 123
123 if (ext.Have("GL_ANGLE_translated_shader_source")) { 124 if (ext.Have("GL_ANGLE_translated_shader_source")) {
124 feature_flags_.angle_translated_shader_source = true; 125 feature_flags_.angle_translated_shader_source = true;
125 } 126 }
126 127
127 // Only turn this feature on if it is requested. Not by default. 128 // Only turn this feature on if it is requested. Not by default.
128 if (desired_features && ext.Desire("GL_CHROMIUM_webglsl")) { 129 if (desired_features && ext.Desire("GL_CHROMIUM_webglsl")) {
129 AddExtensionString("GL_CHROMIUM_webglsl"); 130 AddExtensionString("GL_CHROMIUM_webglsl");
130 feature_flags_.chromium_webglsl = true; 131 feature_flags_.chromium_webglsl = true;
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 validators_.texture_internal_format_storage.AddValue(GL_RGBA16F_EXT); 433 validators_.texture_internal_format_storage.AddValue(GL_RGBA16F_EXT);
433 validators_.texture_internal_format_storage.AddValue(GL_RGB16F_EXT); 434 validators_.texture_internal_format_storage.AddValue(GL_RGB16F_EXT);
434 validators_.texture_internal_format_storage.AddValue(GL_ALPHA16F_EXT); 435 validators_.texture_internal_format_storage.AddValue(GL_ALPHA16F_EXT);
435 validators_.texture_internal_format_storage.AddValue( 436 validators_.texture_internal_format_storage.AddValue(
436 GL_LUMINANCE16F_EXT); 437 GL_LUMINANCE16F_EXT);
437 validators_.texture_internal_format_storage.AddValue( 438 validators_.texture_internal_format_storage.AddValue(
438 GL_LUMINANCE_ALPHA16F_EXT); 439 GL_LUMINANCE_ALPHA16F_EXT);
439 } 440 }
440 } 441 }
441 442
443 bool have_ext_occlusion_query_boolean =
444 ext.Have("GL_EXT_occlusion_query_boolean");
445 bool have_arb_occlusion_query2 = ext.Have("GL_ARB_occlusion_query2");
442 if (ext.Desire("GL_EXT_occlusion_query_boolean") && 446 if (ext.Desire("GL_EXT_occlusion_query_boolean") &&
443 (ext.Have("GL_EXT_occlusion_query_boolean") || 447 (have_ext_occlusion_query_boolean || have_arb_occlusion_query2)) {
444 ext.Have("GL_ARB_occlusion_query2"))) { 448 AddExtensionString("GL_EXT_occlusion_query_boolean");
445 // TODO(gman): Comment in the next line once this really works.
446 // AddExtensionString("GL_EXT_occlusion_query_boolean");
447 feature_flags_.occlusion_query_boolean = true; 449 feature_flags_.occlusion_query_boolean = true;
450 feature_flags_.use_arb_occlusion_query2_for_occlusion_query_boolean =
451 !have_ext_occlusion_query_boolean;
448 } 452 }
449 453
450 if (ext.Desire("GL_ANGLE_instanced_arrays") && 454 if (ext.Desire("GL_ANGLE_instanced_arrays") &&
451 (ext.Have("GL_ANGLE_instanced_arrays") || 455 (ext.Have("GL_ANGLE_instanced_arrays") ||
452 (ext.Have("GL_ARB_instanced_arrays") && 456 (ext.Have("GL_ARB_instanced_arrays") &&
453 ext.Have("GL_ARB_draw_instanced")))) { 457 ext.Have("GL_ARB_draw_instanced")))) {
454 AddExtensionString("GL_ANGLE_instanced_arrays"); 458 AddExtensionString("GL_ANGLE_instanced_arrays");
455 feature_flags_.angle_instanced_arrays = true; 459 feature_flags_.angle_instanced_arrays = true;
456 validators_.vertex_attribute.AddValue(GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE); 460 validators_.vertex_attribute.AddValue(GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE);
457 } 461 }
458 462
459 } 463 }
460 464
461 void FeatureInfo::AddExtensionString(const std::string& str) { 465 void FeatureInfo::AddExtensionString(const std::string& str) {
462 if (extensions_.find(str) == std::string::npos) { 466 if (extensions_.find(str) == std::string::npos) {
463 extensions_ += (extensions_.empty() ? "" : " ") + str; 467 extensions_ += (extensions_.empty() ? "" : " ") + str;
464 } 468 }
465 } 469 }
466 470
467 } // namespace gles2 471 } // namespace gles2
468 } // namespace gpu 472 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/feature_info.h ('k') | gpu/command_buffer/service/gl_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698