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

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

Issue 2639293002: gpu: Add ARB_occlusion_query support. (Closed)
Patch Set: pass max_result to callback Created 3 years, 11 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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 oes_depth24(false), 122 oes_depth24(false),
123 oes_compressed_etc1_rgb8_texture(false), 123 oes_compressed_etc1_rgb8_texture(false),
124 packed_depth24_stencil8(false), 124 packed_depth24_stencil8(false),
125 npot_ok(false), 125 npot_ok(false),
126 enable_texture_float_linear(false), 126 enable_texture_float_linear(false),
127 enable_texture_half_float_linear(false), 127 enable_texture_half_float_linear(false),
128 angle_translated_shader_source(false), 128 angle_translated_shader_source(false),
129 angle_pack_reverse_row_order(false), 129 angle_pack_reverse_row_order(false),
130 arb_texture_rectangle(false), 130 arb_texture_rectangle(false),
131 angle_instanced_arrays(false), 131 angle_instanced_arrays(false),
132 occlusion_query(false),
132 occlusion_query_boolean(false), 133 occlusion_query_boolean(false),
133 use_arb_occlusion_query2_for_occlusion_query_boolean(false), 134 use_arb_occlusion_query2_for_occlusion_query_boolean(false),
134 use_arb_occlusion_query_for_occlusion_query_boolean(false), 135 use_arb_occlusion_query_for_occlusion_query_boolean(false),
135 native_vertex_array_object(false), 136 native_vertex_array_object(false),
136 ext_texture_format_astc(false), 137 ext_texture_format_astc(false),
137 ext_texture_format_atc(false), 138 ext_texture_format_atc(false),
138 ext_texture_format_bgra8888(false), 139 ext_texture_format_bgra8888(false),
139 ext_texture_format_dxt1(false), 140 ext_texture_format_dxt1(false),
140 ext_texture_format_dxt5(false), 141 ext_texture_format_dxt5(false),
141 enable_shader_name_hashing(false), 142 enable_shader_name_hashing(false),
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1172 extensions.Contains("GL_EXT_occlusion_query_boolean"); 1173 extensions.Contains("GL_EXT_occlusion_query_boolean");
1173 bool have_arb_occlusion_query2 = 1174 bool have_arb_occlusion_query2 =
1174 extensions.Contains("GL_ARB_occlusion_query2"); 1175 extensions.Contains("GL_ARB_occlusion_query2");
1175 bool have_arb_occlusion_query = 1176 bool have_arb_occlusion_query =
1176 extensions.Contains("GL_ARB_occlusion_query"); 1177 extensions.Contains("GL_ARB_occlusion_query");
1177 1178
1178 if (have_occlusion_query || 1179 if (have_occlusion_query ||
1179 have_ext_occlusion_query_boolean || 1180 have_ext_occlusion_query_boolean ||
1180 have_arb_occlusion_query2 || 1181 have_arb_occlusion_query2 ||
1181 have_arb_occlusion_query) { 1182 have_arb_occlusion_query) {
1183 feature_flags_.occlusion_query = have_arb_occlusion_query;
jbauman 2017/01/19 01:33:43 I think this was promoted to core in OpenGL 1.5 (d
reveman 2017/01/19 04:44:34 Good call. Added it to the have_arb_occlusion_quer
1182 if (context_type_ == CONTEXT_TYPE_OPENGLES2) { 1184 if (context_type_ == CONTEXT_TYPE_OPENGLES2) {
1183 AddExtensionString("GL_EXT_occlusion_query_boolean"); 1185 AddExtensionString("GL_EXT_occlusion_query_boolean");
1184 } 1186 }
1185 feature_flags_.occlusion_query_boolean = true; 1187 feature_flags_.occlusion_query_boolean = true;
1186 feature_flags_.use_arb_occlusion_query2_for_occlusion_query_boolean = 1188 feature_flags_.use_arb_occlusion_query2_for_occlusion_query_boolean =
1187 !have_ext_occlusion_query_boolean && (have_arb_occlusion_query2 || 1189 !have_ext_occlusion_query_boolean && (have_arb_occlusion_query2 ||
1188 (gl_version_info_->IsAtLeastGL(3, 3) && 1190 (gl_version_info_->IsAtLeastGL(3, 3) &&
1189 gl_version_info_->IsLowerThanGL(4, 3))); 1191 gl_version_info_->IsLowerThanGL(4, 3)));
1190 feature_flags_.use_arb_occlusion_query_for_occlusion_query_boolean = 1192 feature_flags_.use_arb_occlusion_query_for_occlusion_query_boolean =
1191 !have_ext_occlusion_query_boolean && have_arb_occlusion_query && 1193 !have_ext_occlusion_query_boolean && have_arb_occlusion_query &&
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
1588 if (pos == std::string::npos) { 1590 if (pos == std::string::npos) {
1589 extensions_ += (extensions_.empty() ? "" : " ") + str; 1591 extensions_ += (extensions_.empty() ? "" : " ") + str;
1590 } 1592 }
1591 } 1593 }
1592 1594
1593 FeatureInfo::~FeatureInfo() { 1595 FeatureInfo::~FeatureInfo() {
1594 } 1596 }
1595 1597
1596 } // namespace gles2 1598 } // namespace gles2
1597 } // namespace gpu 1599 } // 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