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

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

Issue 1374043005: Blacklist MSAA for GPU Raster on Intel GPUs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ignore_cr
Patch Set: version # Created 5 years, 2 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 | « gpu/command_buffer/service/context_group.h ('k') | gpu/command_buffer/service/feature_info.h » ('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/context_group.h" 5 #include "gpu/command_buffer/service/context_group.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 18 matching lines...) Expand all
29 ContextGroup::ContextGroup( 29 ContextGroup::ContextGroup(
30 const scoped_refptr<MailboxManager>& mailbox_manager, 30 const scoped_refptr<MailboxManager>& mailbox_manager,
31 const scoped_refptr<MemoryTracker>& memory_tracker, 31 const scoped_refptr<MemoryTracker>& memory_tracker,
32 const scoped_refptr<ShaderTranslatorCache>& shader_translator_cache, 32 const scoped_refptr<ShaderTranslatorCache>& shader_translator_cache,
33 const scoped_refptr<FramebufferCompletenessCache>& 33 const scoped_refptr<FramebufferCompletenessCache>&
34 framebuffer_completeness_cache, 34 framebuffer_completeness_cache,
35 const scoped_refptr<FeatureInfo>& feature_info, 35 const scoped_refptr<FeatureInfo>& feature_info,
36 const scoped_refptr<SubscriptionRefSet>& subscription_ref_set, 36 const scoped_refptr<SubscriptionRefSet>& subscription_ref_set,
37 const scoped_refptr<ValueStateMap>& pending_valuebuffer_state, 37 const scoped_refptr<ValueStateMap>& pending_valuebuffer_state,
38 bool bind_generates_resource) 38 bool bind_generates_resource)
39 : context_type_(CONTEXT_TYPE_OPENGLES2), 39 : mailbox_manager_(mailbox_manager),
40 mailbox_manager_(mailbox_manager),
41 memory_tracker_(memory_tracker), 40 memory_tracker_(memory_tracker),
42 shader_translator_cache_(shader_translator_cache), 41 shader_translator_cache_(shader_translator_cache),
43 #if defined(OS_MACOSX) 42 #if defined(OS_MACOSX)
44 // Framebuffer completeness is not cacheable on OS X because of dynamic 43 // Framebuffer completeness is not cacheable on OS X because of dynamic
45 // graphics switching. 44 // graphics switching.
46 // http://crbug.com/180876 45 // http://crbug.com/180876
47 // TODO(tobiasjs): determine whether GPU switching is possible 46 // TODO(tobiasjs): determine whether GPU switching is possible
48 // programmatically, rather than just hardcoding this behaviour 47 // programmatically, rather than just hardcoding this behaviour
49 // for OS X. 48 // for OS X.
50 framebuffer_completeness_cache_(NULL), 49 framebuffer_completeness_cache_(NULL),
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 84
86 static void GetIntegerv(GLenum pname, uint32* var) { 85 static void GetIntegerv(GLenum pname, uint32* var) {
87 GLint value = 0; 86 GLint value = 0;
88 glGetIntegerv(pname, &value); 87 glGetIntegerv(pname, &value);
89 *var = value; 88 *var = value;
90 } 89 }
91 90
92 bool ContextGroup::Initialize(GLES2Decoder* decoder, 91 bool ContextGroup::Initialize(GLES2Decoder* decoder,
93 ContextType context_type, 92 ContextType context_type,
94 const DisallowedFeatures& disallowed_features) { 93 const DisallowedFeatures& disallowed_features) {
95 if (!HaveContexts()) {
96 context_type_ = context_type;
97 } else if (context_type_ != context_type) {
98 LOG(ERROR) << "ContextGroup::Initialize failed because the type of "
99 << "the context does not fit with the group.";
100 return false;
101 }
102
103 // If we've already initialized the group just add the context.
104 if (HaveContexts()) { 94 if (HaveContexts()) {
95 if (context_type != feature_info_->context_type()) {
96 LOG(ERROR) << "ContextGroup::Initialize failed because the type of "
97 << "the context does not fit with the group.";
98 return false;
99 }
100 // If we've already initialized the group just add the context.
105 decoders_.push_back(base::AsWeakPtr<GLES2Decoder>(decoder)); 101 decoders_.push_back(base::AsWeakPtr<GLES2Decoder>(decoder));
106 return true; 102 return true;
107 } 103 }
108 104
109 if (!feature_info_->Initialize(disallowed_features)) { 105 if (!feature_info_->Initialize(context_type, disallowed_features)) {
110 LOG(ERROR) << "ContextGroup::Initialize failed because FeatureInfo " 106 LOG(ERROR) << "ContextGroup::Initialize failed because FeatureInfo "
111 << "initialization failed."; 107 << "initialization failed.";
112 return false; 108 return false;
113 } 109 }
114 110
115 transfer_buffer_manager_->Initialize(); 111 transfer_buffer_manager_->Initialize();
116 112
117 const GLint kMinRenderbufferSize = 512; // GL says 1 pixel! 113 const GLint kMinRenderbufferSize = 512; // GL says 1 pixel!
118 GLint max_renderbuffer_size = 0; 114 GLint max_renderbuffer_size = 0;
119 if (!QueryGLFeature( 115 if (!QueryGLFeature(
(...skipping 19 matching lines...) Expand all
139 GetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &max_color_attachments_); 135 GetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &max_color_attachments_);
140 if (max_color_attachments_ < 1) 136 if (max_color_attachments_ < 1)
141 max_color_attachments_ = 1; 137 max_color_attachments_ = 1;
142 GetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, &max_draw_buffers_); 138 GetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, &max_draw_buffers_);
143 if (max_draw_buffers_ < 1) 139 if (max_draw_buffers_ < 1)
144 max_draw_buffers_ = 1; 140 max_draw_buffers_ = 1;
145 } 141 }
146 142
147 buffer_manager_.reset( 143 buffer_manager_.reset(
148 new BufferManager(memory_tracker_.get(), feature_info_.get())); 144 new BufferManager(memory_tracker_.get(), feature_info_.get()));
149 framebuffer_manager_.reset( 145 framebuffer_manager_.reset(new FramebufferManager(
150 new FramebufferManager(max_draw_buffers_, max_color_attachments_, 146 max_draw_buffers_, max_color_attachments_, feature_info_->context_type(),
151 context_type, framebuffer_completeness_cache_)); 147 framebuffer_completeness_cache_));
152 renderbuffer_manager_.reset(new RenderbufferManager( 148 renderbuffer_manager_.reset(new RenderbufferManager(
153 memory_tracker_.get(), max_renderbuffer_size, max_samples, 149 memory_tracker_.get(), max_renderbuffer_size, max_samples,
154 feature_info_.get())); 150 feature_info_.get()));
155 shader_manager_.reset(new ShaderManager()); 151 shader_manager_.reset(new ShaderManager());
156 valuebuffer_manager_.reset( 152 valuebuffer_manager_.reset(
157 new ValuebufferManager(subscription_ref_set_.get(), 153 new ValuebufferManager(subscription_ref_set_.get(),
158 pending_valuebuffer_state_.get())); 154 pending_valuebuffer_state_.get()));
159 155
160 // Lookup GL things we need to know. 156 // Lookup GL things we need to know.
161 const GLint kGLES2RequiredMinimumVertexAttribs = 8u; 157 const GLint kGLES2RequiredMinimumVertexAttribs = 8u;
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 GLuint client_id, GLuint* service_id) const { 441 GLuint client_id, GLuint* service_id) const {
446 Buffer* buffer = buffer_manager_->GetBuffer(client_id); 442 Buffer* buffer = buffer_manager_->GetBuffer(client_id);
447 if (!buffer) 443 if (!buffer)
448 return false; 444 return false;
449 *service_id = buffer->service_id(); 445 *service_id = buffer->service_id();
450 return true; 446 return true;
451 } 447 }
452 448
453 } // namespace gles2 449 } // namespace gles2
454 } // namespace gpu 450 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/context_group.h ('k') | gpu/command_buffer/service/feature_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698