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

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

Issue 2103773002: Occlusion query feature is already in GL ES3.0 spec, not an extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address ken's commments, and add a unit test 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 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after
1037 validators_.texture_internal_format_storage.AddValue(GL_RGBA16F_EXT); 1037 validators_.texture_internal_format_storage.AddValue(GL_RGBA16F_EXT);
1038 validators_.texture_internal_format_storage.AddValue(GL_RGB16F_EXT); 1038 validators_.texture_internal_format_storage.AddValue(GL_RGB16F_EXT);
1039 validators_.texture_internal_format_storage.AddValue(GL_ALPHA16F_EXT); 1039 validators_.texture_internal_format_storage.AddValue(GL_ALPHA16F_EXT);
1040 validators_.texture_internal_format_storage.AddValue( 1040 validators_.texture_internal_format_storage.AddValue(
1041 GL_LUMINANCE16F_EXT); 1041 GL_LUMINANCE16F_EXT);
1042 validators_.texture_internal_format_storage.AddValue( 1042 validators_.texture_internal_format_storage.AddValue(
1043 GL_LUMINANCE_ALPHA16F_EXT); 1043 GL_LUMINANCE_ALPHA16F_EXT);
1044 } 1044 }
1045 } 1045 }
1046 1046
1047 bool have_es3_occlusion_query =
1048 gl_version_info_->IsAtLeastGLES(3, 0);
1047 bool have_ext_occlusion_query_boolean = 1049 bool have_ext_occlusion_query_boolean =
1048 extensions.Contains("GL_EXT_occlusion_query_boolean"); 1050 extensions.Contains("GL_EXT_occlusion_query_boolean");
1049 bool have_arb_occlusion_query2 = 1051 bool have_arb_occlusion_query2 =
1050 extensions.Contains("GL_ARB_occlusion_query2"); 1052 extensions.Contains("GL_ARB_occlusion_query2");
1051 bool have_arb_occlusion_query = 1053 bool have_arb_occlusion_query =
1052 extensions.Contains("GL_ARB_occlusion_query"); 1054 extensions.Contains("GL_ARB_occlusion_query");
1053 1055
1054 if (have_ext_occlusion_query_boolean || 1056 if (have_es3_occlusion_query ||
1057 have_ext_occlusion_query_boolean ||
1055 have_arb_occlusion_query2 || 1058 have_arb_occlusion_query2 ||
1056 have_arb_occlusion_query) { 1059 have_arb_occlusion_query) {
1057 AddExtensionString("GL_EXT_occlusion_query_boolean"); 1060 if (have_ext_occlusion_query_boolean ||
Zhenyao Mo 2016/07/04 16:06:05 You should use context_type_ is ES3 or WEBGL2 here
xinghua.cao 2016/07/05 14:21:23 Zhenyao, sorry, I don't understand you clearly. I
Zhenyao Mo 2016/07/05 21:32:06 The outside if conditions make sure we actually ha
1061 have_arb_occlusion_query2 ||
1062 have_arb_occlusion_query) {
1063 AddExtensionString("GL_EXT_occlusion_query_boolean");
1064 }
1058 feature_flags_.occlusion_query_boolean = true; 1065 feature_flags_.occlusion_query_boolean = true;
1059 feature_flags_.use_arb_occlusion_query2_for_occlusion_query_boolean = 1066 feature_flags_.use_arb_occlusion_query2_for_occlusion_query_boolean =
1060 !have_ext_occlusion_query_boolean && have_arb_occlusion_query2; 1067 !have_ext_occlusion_query_boolean && have_arb_occlusion_query2;
1061 feature_flags_.use_arb_occlusion_query_for_occlusion_query_boolean = 1068 feature_flags_.use_arb_occlusion_query_for_occlusion_query_boolean =
1062 !have_ext_occlusion_query_boolean && have_arb_occlusion_query && 1069 !have_ext_occlusion_query_boolean && have_arb_occlusion_query &&
1063 !have_arb_occlusion_query2; 1070 !have_arb_occlusion_query2;
1064 } 1071 }
1065 1072
1066 if (!workarounds_.disable_angle_instanced_arrays && 1073 if (!workarounds_.disable_angle_instanced_arrays &&
1067 (extensions.Contains("GL_ANGLE_instanced_arrays") || 1074 (extensions.Contains("GL_ANGLE_instanced_arrays") ||
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
1412 if (pos == std::string::npos) { 1419 if (pos == std::string::npos) {
1413 extensions_ += (extensions_.empty() ? "" : " ") + str; 1420 extensions_ += (extensions_.empty() ? "" : " ") + str;
1414 } 1421 }
1415 } 1422 }
1416 1423
1417 FeatureInfo::~FeatureInfo() { 1424 FeatureInfo::~FeatureInfo() {
1418 } 1425 }
1419 1426
1420 } // namespace gles2 1427 } // namespace gles2
1421 } // namespace gpu 1428 } // 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