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

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

Issue 8772033: Adds support for the GL_ANGLE_texture_usage and GL_EXT_texture_storage (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "gpu/command_buffer/service/feature_info.h" 7 #include "gpu/command_buffer/service/feature_info.h"
8 #include "gpu/command_buffer/service/gl_utils.h" 8 #include "gpu/command_buffer/service/gl_utils.h"
9 #include "ui/gfx/gl/gl_context.h" 9 #include "ui/gfx/gl/gl_context.h"
10 #include "ui/gfx/gl/gl_implementation.h" 10 #include "ui/gfx/gl/gl_implementation.h"
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 AddExtensionString("GL_CHROMIUM_front_buffer_cached"); 398 AddExtensionString("GL_CHROMIUM_front_buffer_cached");
399 } 399 }
400 400
401 if (ext.Desire("GL_ANGLE_pack_reverse_row_order") && 401 if (ext.Desire("GL_ANGLE_pack_reverse_row_order") &&
402 ext.Have("GL_ANGLE_pack_reverse_row_order")) { 402 ext.Have("GL_ANGLE_pack_reverse_row_order")) {
403 AddExtensionString("GL_ANGLE_pack_reverse_row_order"); 403 AddExtensionString("GL_ANGLE_pack_reverse_row_order");
404 feature_flags_.angle_pack_reverse_row_order = true; 404 feature_flags_.angle_pack_reverse_row_order = true;
405 validators_.pixel_store.AddValue(GL_PACK_REVERSE_ROW_ORDER_ANGLE); 405 validators_.pixel_store.AddValue(GL_PACK_REVERSE_ROW_ORDER_ANGLE);
406 validators_.g_l_state.AddValue(GL_PACK_REVERSE_ROW_ORDER_ANGLE); 406 validators_.g_l_state.AddValue(GL_PACK_REVERSE_ROW_ORDER_ANGLE);
407 } 407 }
408
409 if (ext.HaveAndDesire("GL_ANGLE_texture_usage")) {
410 AddExtensionString("GL_ANGLE_texture_usage");
411 validators_.texture_parameter.AddValue(GL_TEXTURE_USAGE_ANGLE);
412 }
413
414 if (ext.HaveAndDesire("GL_EXT_texture_storage")) {
415 AddExtensionString("GL_EXT_texture_storage");
416 validators_.texture_parameter.AddValue(GL_TEXTURE_IMMUTABLE_FORMAT_EXT);
417 if (enable_texture_format_bgra8888)
418 validators_.texture_internal_format_storage.AddValue(GL_BGRA8_EXT);
419 if (enable_texture_float) {
420 validators_.texture_internal_format_storage.AddValue(GL_RGBA32F_EXT);
421 validators_.texture_internal_format_storage.AddValue(GL_RGB32F_EXT);
422 validators_.texture_internal_format_storage.AddValue(GL_ALPHA32F_EXT);
423 validators_.texture_internal_format_storage.AddValue(
424 GL_LUMINANCE32F_EXT);
425 validators_.texture_internal_format_storage.AddValue(
426 GL_LUMINANCE_ALPHA32F_EXT);
427 }
428 if (enable_texture_half_float) {
429 validators_.texture_internal_format_storage.AddValue(GL_RGBA16F_EXT);
430 validators_.texture_internal_format_storage.AddValue(GL_RGB16F_EXT);
431 validators_.texture_internal_format_storage.AddValue(GL_ALPHA16F_EXT);
432 validators_.texture_internal_format_storage.AddValue(
433 GL_LUMINANCE16F_EXT);
434 validators_.texture_internal_format_storage.AddValue(
435 GL_LUMINANCE_ALPHA16F_EXT);
436 }
437 }
408 } 438 }
409 439
410 void FeatureInfo::AddExtensionString(const std::string& str) { 440 void FeatureInfo::AddExtensionString(const std::string& str) {
411 if (extensions_.find(str) == std::string::npos) { 441 if (extensions_.find(str) == std::string::npos) {
412 extensions_ += (extensions_.empty() ? "" : " ") + str; 442 extensions_ += (extensions_.empty() ? "" : " ") + str;
413 } 443 }
414 } 444 }
415 445
416 } // namespace gles2 446 } // namespace gles2
417 } // namespace gpu 447 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698