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

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

Issue 16831004: Perform glReadPixels with PBOs in the gpu, if PBOs are available. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: oops, did not mean to upload license.py Created 7 years, 6 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 | Annotate | Revision Log
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 <set> 7 #include <set>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 angle_pack_reverse_row_order(false), 110 angle_pack_reverse_row_order(false),
111 arb_texture_rectangle(false), 111 arb_texture_rectangle(false),
112 angle_instanced_arrays(false), 112 angle_instanced_arrays(false),
113 occlusion_query_boolean(false), 113 occlusion_query_boolean(false),
114 use_arb_occlusion_query2_for_occlusion_query_boolean(false), 114 use_arb_occlusion_query2_for_occlusion_query_boolean(false),
115 use_arb_occlusion_query_for_occlusion_query_boolean(false), 115 use_arb_occlusion_query_for_occlusion_query_boolean(false),
116 native_vertex_array_object(false), 116 native_vertex_array_object(false),
117 enable_shader_name_hashing(false), 117 enable_shader_name_hashing(false),
118 enable_samplers(false), 118 enable_samplers(false),
119 ext_draw_buffers(false), 119 ext_draw_buffers(false),
120 ext_frag_depth(false) { 120 ext_frag_depth(false),
121 use_async_readpixels(false) {
121 } 122 }
122 123
123 FeatureInfo::Workarounds::Workarounds() : 124 FeatureInfo::Workarounds::Workarounds() :
124 #define GPU_OP(type, name) name(false), 125 #define GPU_OP(type, name) name(false),
125 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) 126 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP)
126 #undef GPU_OP 127 #undef GPU_OP
127 max_texture_size(0), 128 max_texture_size(0),
128 max_cube_map_texture_size(0) { 129 max_cube_map_texture_size(0) {
129 } 130 }
130 131
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 ++i) { 617 ++i) {
617 validators_.g_l_state.AddValue(i); 618 validators_.g_l_state.AddValue(i);
618 } 619 }
619 } 620 }
620 621
621 if (extensions.Contains("GL_EXT_frag_depth") || gfx::HasDesktopGLFeatures()) { 622 if (extensions.Contains("GL_EXT_frag_depth") || gfx::HasDesktopGLFeatures()) {
622 AddExtensionString("GL_EXT_frag_depth"); 623 AddExtensionString("GL_EXT_frag_depth");
623 feature_flags_.ext_frag_depth = true; 624 feature_flags_.ext_frag_depth = true;
624 } 625 }
625 626
627 bool ui_gl_fence_works =
628 extensions.Contains("GL_NV_fence") ||
629 extensions.Contains("GL_ARB_sync");
630
631 if (ui_gl_fence_works &&
632 extensions.Contains("GL_ARB_pixel_buffer_object") &&
633 !command_line.HasSwitch(switches::kForceSynchronousGLReadPixels) &&
piman 2013/06/26 22:17:08 You don't need this any more. You have --gpu-drive
hubbe 2013/06/28 22:17:49 Removed the HasSwitch call. I'm trying to find out
hubbe 2013/06/29 00:13:56 Talked to alpha, and it seems that the workaround
634 !workarounds_.disable_async_readpixels) {
635 feature_flags_.use_async_readpixels = true;
636 }
637
626 if (!disallowed_features_.swap_buffer_complete_callback) 638 if (!disallowed_features_.swap_buffer_complete_callback)
627 AddExtensionString("GL_CHROMIUM_swapbuffers_complete_callback"); 639 AddExtensionString("GL_CHROMIUM_swapbuffers_complete_callback");
628 640
629 bool is_es3 = false; 641 bool is_es3 = false;
630 const char* str = reinterpret_cast<const char*>(glGetString(GL_VERSION)); 642 const char* str = reinterpret_cast<const char*>(glGetString(GL_VERSION));
631 if (str) { 643 if (str) {
632 std::string lstr(StringToLowerASCII(std::string(str))); 644 std::string lstr(StringToLowerASCII(std::string(str)));
633 is_es3 = (lstr.substr(0, 12) == "opengl es 3."); 645 is_es3 = (lstr.substr(0, 12) == "opengl es 3.");
634 } 646 }
635 647
636 if (is_es3 || extensions.Contains("GL_ARB_sampler_objects")) { 648 if (is_es3 || extensions.Contains("GL_ARB_sampler_objects")) {
637 feature_flags_.enable_samplers = true; 649 feature_flags_.enable_samplers = true;
638 // TODO(dsinclair): Add AddExtensionString("GL_CHROMIUM_sampler_objects") 650 // TODO(dsinclair): Add AddExtensionString("GL_CHROMIUM_sampler_objects")
639 // when available. 651 // when available.
640 } 652 }
641 } 653 }
642 654
643 void FeatureInfo::AddExtensionString(const std::string& str) { 655 void FeatureInfo::AddExtensionString(const std::string& str) {
644 if (extensions_.find(str) == std::string::npos) { 656 if (extensions_.find(str) == std::string::npos) {
645 extensions_ += (extensions_.empty() ? "" : " ") + str; 657 extensions_ += (extensions_.empty() ? "" : " ") + str;
646 } 658 }
647 } 659 }
648 660
649 FeatureInfo::~FeatureInfo() { 661 FeatureInfo::~FeatureInfo() {
650 } 662 }
651 663
652 } // namespace gles2 664 } // namespace gles2
653 } // namespace gpu 665 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698