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

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

Issue 2264253003: Command buffers: ensure we only read immediate data once (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Keep track of the correct draw buffer Created 4 years, 3 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/context_group.h" 5 #include "gpu/command_buffer/service/context_group.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 glGetIntegerv(GL_MAX_SAMPLES_IMG, &max_samples); 153 glGetIntegerv(GL_MAX_SAMPLES_IMG, &max_samples);
154 } else { 154 } else {
155 glGetIntegerv(GL_MAX_SAMPLES, &max_samples); 155 glGetIntegerv(GL_MAX_SAMPLES, &max_samples);
156 } 156 }
157 } 157 }
158 158
159 if (feature_info_->feature_flags().ext_draw_buffers) { 159 if (feature_info_->feature_flags().ext_draw_buffers) {
160 GetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &max_color_attachments_); 160 GetIntegerv(GL_MAX_COLOR_ATTACHMENTS_EXT, &max_color_attachments_);
161 if (max_color_attachments_ < 1) 161 if (max_color_attachments_ < 1)
162 max_color_attachments_ = 1; 162 max_color_attachments_ = 1;
163 if (max_color_attachments_ > 16)
164 max_color_attachments_ = 16;
163 GetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, &max_draw_buffers_); 165 GetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, &max_draw_buffers_);
164 if (max_draw_buffers_ < 1) 166 if (max_draw_buffers_ < 1)
165 max_draw_buffers_ = 1; 167 max_draw_buffers_ = 1;
168 if (max_draw_buffers_ > 16)
169 max_draw_buffers_ = 16;
166 } 170 }
167 if (feature_info_->feature_flags().ext_blend_func_extended) { 171 if (feature_info_->feature_flags().ext_blend_func_extended) {
168 GetIntegerv(GL_MAX_DUAL_SOURCE_DRAW_BUFFERS_EXT, 172 GetIntegerv(GL_MAX_DUAL_SOURCE_DRAW_BUFFERS_EXT,
169 &max_dual_source_draw_buffers_); 173 &max_dual_source_draw_buffers_);
170 DCHECK(max_dual_source_draw_buffers_ >= 1); 174 DCHECK(max_dual_source_draw_buffers_ >= 1);
171 } 175 }
172 176
173 if (feature_info_->gl_version_info().is_es3_capable) { 177 if (feature_info_->gl_version_info().is_es3_capable) {
174 const GLint kMinTransformFeedbackSeparateAttribs = 4; 178 const GLint kMinTransformFeedbackSeparateAttribs = 4;
175 if (!QueryGLFeatureU(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, 179 if (!QueryGLFeatureU(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS,
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 GLuint client_id, GLuint* service_id) const { 602 GLuint client_id, GLuint* service_id) const {
599 Buffer* buffer = buffer_manager_->GetBuffer(client_id); 603 Buffer* buffer = buffer_manager_->GetBuffer(client_id);
600 if (!buffer) 604 if (!buffer)
601 return false; 605 return false;
602 *service_id = buffer->service_id(); 606 *service_id = buffer->service_id();
603 return true; 607 return true;
604 } 608 }
605 609
606 } // namespace gles2 610 } // namespace gles2
607 } // namespace gpu 611 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/build_gles2_cmd_buffer.py ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698