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

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

Issue 2145363002: Enable occlusion query feature on OpenGL3.3 and later (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add parentheses for CQ dry run failed Created 4 years, 5 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
« no previous file with comments | « no previous file | gpu/command_buffer/service/feature_info_unittest.cc » ('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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after
1045 validators_.texture_internal_format_storage.AddValue(GL_RGBA16F_EXT); 1045 validators_.texture_internal_format_storage.AddValue(GL_RGBA16F_EXT);
1046 validators_.texture_internal_format_storage.AddValue(GL_RGB16F_EXT); 1046 validators_.texture_internal_format_storage.AddValue(GL_RGB16F_EXT);
1047 validators_.texture_internal_format_storage.AddValue(GL_ALPHA16F_EXT); 1047 validators_.texture_internal_format_storage.AddValue(GL_ALPHA16F_EXT);
1048 validators_.texture_internal_format_storage.AddValue( 1048 validators_.texture_internal_format_storage.AddValue(
1049 GL_LUMINANCE16F_EXT); 1049 GL_LUMINANCE16F_EXT);
1050 validators_.texture_internal_format_storage.AddValue( 1050 validators_.texture_internal_format_storage.AddValue(
1051 GL_LUMINANCE_ALPHA16F_EXT); 1051 GL_LUMINANCE_ALPHA16F_EXT);
1052 } 1052 }
1053 } 1053 }
1054 1054
1055 bool have_es3_occlusion_query = 1055 bool have_occlusion_query =
1056 gl_version_info_->IsAtLeastGLES(3, 0); 1056 gl_version_info_->IsAtLeastGLES(3, 0) ||
1057 gl_version_info_->IsAtLeastGL(3, 3);
1057 bool have_ext_occlusion_query_boolean = 1058 bool have_ext_occlusion_query_boolean =
1058 extensions.Contains("GL_EXT_occlusion_query_boolean"); 1059 extensions.Contains("GL_EXT_occlusion_query_boolean");
1059 bool have_arb_occlusion_query2 = 1060 bool have_arb_occlusion_query2 =
1060 extensions.Contains("GL_ARB_occlusion_query2"); 1061 extensions.Contains("GL_ARB_occlusion_query2");
1061 bool have_arb_occlusion_query = 1062 bool have_arb_occlusion_query =
1062 extensions.Contains("GL_ARB_occlusion_query"); 1063 extensions.Contains("GL_ARB_occlusion_query");
1063 1064
1064 if (have_es3_occlusion_query || 1065 if (have_occlusion_query ||
1065 have_ext_occlusion_query_boolean || 1066 have_ext_occlusion_query_boolean ||
1066 have_arb_occlusion_query2 || 1067 have_arb_occlusion_query2 ||
1067 have_arb_occlusion_query) { 1068 have_arb_occlusion_query) {
1068 if (context_type_ == CONTEXT_TYPE_OPENGLES2) { 1069 if (context_type_ == CONTEXT_TYPE_OPENGLES2) {
1069 AddExtensionString("GL_EXT_occlusion_query_boolean"); 1070 AddExtensionString("GL_EXT_occlusion_query_boolean");
1070 } 1071 }
1071 feature_flags_.occlusion_query_boolean = true; 1072 feature_flags_.occlusion_query_boolean = true;
1072 feature_flags_.use_arb_occlusion_query2_for_occlusion_query_boolean = 1073 feature_flags_.use_arb_occlusion_query2_for_occlusion_query_boolean =
1073 !have_ext_occlusion_query_boolean && have_arb_occlusion_query2; 1074 !have_ext_occlusion_query_boolean && (have_arb_occlusion_query2 ||
1075 (gl_version_info_->IsAtLeastGL(3, 3) &&
1076 gl_version_info_->IsLowerThanGL(4, 3)));
1074 feature_flags_.use_arb_occlusion_query_for_occlusion_query_boolean = 1077 feature_flags_.use_arb_occlusion_query_for_occlusion_query_boolean =
1075 !have_ext_occlusion_query_boolean && have_arb_occlusion_query && 1078 !have_ext_occlusion_query_boolean && have_arb_occlusion_query &&
1076 !have_arb_occlusion_query2; 1079 !have_arb_occlusion_query2;
1077 } 1080 }
1078 1081
1079 if (!workarounds_.disable_angle_instanced_arrays && 1082 if (!workarounds_.disable_angle_instanced_arrays &&
1080 (extensions.Contains("GL_ANGLE_instanced_arrays") || 1083 (extensions.Contains("GL_ANGLE_instanced_arrays") ||
1081 (extensions.Contains("GL_ARB_instanced_arrays") && 1084 (extensions.Contains("GL_ARB_instanced_arrays") &&
1082 extensions.Contains("GL_ARB_draw_instanced")) || 1085 extensions.Contains("GL_ARB_draw_instanced")) ||
1083 gl_version_info_->is_es3 || 1086 gl_version_info_->is_es3 ||
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
1429 if (pos == std::string::npos) { 1432 if (pos == std::string::npos) {
1430 extensions_ += (extensions_.empty() ? "" : " ") + str; 1433 extensions_ += (extensions_.empty() ? "" : " ") + str;
1431 } 1434 }
1432 } 1435 }
1433 1436
1434 FeatureInfo::~FeatureInfo() { 1437 FeatureInfo::~FeatureInfo() {
1435 } 1438 }
1436 1439
1437 } // namespace gles2 1440 } // namespace gles2
1438 } // namespace gpu 1441 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/feature_info_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698