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

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

Issue 5626008: Exposed support for dynamically enabling extensions in command buffer... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <set> 5 #include <set>
6 #include <string> 6 #include <string>
7 #include "app/gfx/gl/gl_implementation.h" 7 #include "app/gfx/gl/gl_implementation.h"
8 #include "gpu/command_buffer/service/feature_info.h" 8 #include "gpu/command_buffer/service/feature_info.h"
9 #include "gpu/command_buffer/service/gl_utils.h" 9 #include "gpu/command_buffer/service/gl_utils.h"
10 #include "gpu/GLES2/gles2_command_buffer.h" 10 #include "gpu/GLES2/gles2_command_buffer.h"
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 AddExtensionString("GL_OES_texture_npot"); 208 AddExtensionString("GL_OES_texture_npot");
209 npot_ok = true; 209 npot_ok = true;
210 } 210 }
211 211
212 // Check if we should allow GL_OES_texture_float, GL_OES_texture_half_float, 212 // Check if we should allow GL_OES_texture_float, GL_OES_texture_half_float,
213 // GL_OES_texture_float_linear, GL_OES_texture_half_float_linear 213 // GL_OES_texture_float_linear, GL_OES_texture_half_float_linear
214 bool enable_texture_float = false; 214 bool enable_texture_float = false;
215 bool enable_texture_float_linear = false; 215 bool enable_texture_float_linear = false;
216 bool enable_texture_half_float = false; 216 bool enable_texture_half_float = false;
217 bool enable_texture_half_float_linear = false; 217 bool enable_texture_half_float_linear = false;
218 if (ext.HaveAndDesire("GL_ARB_texture_float")) { 218
219 bool have_arb_texture_float = ext.Have("GL_ARB_texture_float");
220
221 if (have_arb_texture_float && ext.Desire("GL_ARB_texture_float")) {
219 enable_texture_float = true; 222 enable_texture_float = true;
220 enable_texture_float_linear = true; 223 enable_texture_float_linear = true;
221 enable_texture_half_float = true; 224 enable_texture_half_float = true;
222 enable_texture_half_float_linear = true; 225 enable_texture_half_float_linear = true;
223 } else { 226 } else {
224 if (ext.HaveAndDesire("GL_OES_texture_float")) { 227 if (ext.HaveAndDesire("GL_OES_texture_float") ||
228 (have_arb_texture_float &&
229 ext.Desire("GL_OES_texture_float"))) {
225 enable_texture_float = true; 230 enable_texture_float = true;
226 if (ext.HaveAndDesire("GL_OES_texture_float_linear")) { 231 if (ext.HaveAndDesire("GL_OES_texture_float_linear") ||
232 (have_arb_texture_float &&
233 ext.Desire("GL_OES_texture_float_linear"))) {
227 enable_texture_float_linear = true; 234 enable_texture_float_linear = true;
228 } 235 }
229 } 236 }
230 if (ext.HaveAndDesire("GL_OES_texture_half_float")) { 237 if (ext.HaveAndDesire("GL_OES_texture_half_float") ||
238 (have_arb_texture_float &&
239 ext.Desire("GL_OES_texture_half_float"))) {
231 enable_texture_half_float = true; 240 enable_texture_half_float = true;
232 if (ext.HaveAndDesire("GL_OES_texture_half_float_linear")) { 241 if (ext.HaveAndDesire("GL_OES_texture_half_float_linear") ||
242 (have_arb_texture_float &&
243 ext.Desire("GL_OES_texture_half_float_linear"))) {
233 enable_texture_half_float_linear = true; 244 enable_texture_half_float_linear = true;
234 } 245 }
235 } 246 }
236 } 247 }
237 248
238 if (enable_texture_float) { 249 if (enable_texture_float) {
239 validators_.pixel_type.AddValue(GL_FLOAT); 250 validators_.pixel_type.AddValue(GL_FLOAT);
240 AddExtensionString("GL_OES_texture_float"); 251 AddExtensionString("GL_OES_texture_float");
241 if (enable_texture_float_linear) { 252 if (enable_texture_float_linear) {
242 AddExtensionString("GL_OES_texture_float_linear"); 253 AddExtensionString("GL_OES_texture_float_linear");
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 if (extensions_.find(str) == std::string::npos) { 304 if (extensions_.find(str) == std::string::npos) {
294 extensions_ += (extensions_.empty() ? "" : " ") + str; 305 extensions_ += (extensions_.empty() ? "" : " ") + str;
295 } 306 }
296 } 307 }
297 308
298 } // namespace gles2 309 } // namespace gles2
299 } // namespace gpu 310 } // namespace gpu
300 311
301 312
302 313
OLDNEW
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_ids_autogen.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