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

Unified Diff: gpu/command_buffer/service/context_group.cc

Issue 1905743002: Improve BindBufferBase/BindBufferRange in GPU command buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/context_group.cc
diff --git a/gpu/command_buffer/service/context_group.cc b/gpu/command_buffer/service/context_group.cc
index 56f70303af63af2016fb3037a538fbeeea596e6e..6ea89612b7d2f8beecb3b0a52f31224fb8e30d98 100644
--- a/gpu/command_buffer/service/context_group.cc
+++ b/gpu/command_buffer/service/context_group.cc
@@ -101,6 +101,9 @@ ContextGroup::ContextGroup(
max_fragment_input_components_(0u),
min_program_texel_offset_(0),
max_program_texel_offset_(0),
+ max_transform_feedback_separate_attribs_(0u),
+ max_uniform_buffer_bindings_(0u),
+ uniform_buffer_offset_alignment_(1u),
program_cache_(NULL),
feature_info_(feature_info) {
{
@@ -176,6 +179,34 @@ bool ContextGroup::Initialize(GLES2Decoder* decoder,
DCHECK(max_dual_source_draw_buffers_ >= 1);
}
+ if (feature_info_->gl_version_info().IsES3Capable()) {
+ const GLint kMinTransformFeedbackSeparateAttribs = 4;
+ if (!QueryGLFeatureU(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS,
+ kMinTransformFeedbackSeparateAttribs,
+ &max_transform_feedback_separate_attribs_)) {
+ LOG(ERROR) << "ContextGroup::Initialize failed because maximum "
piman 2016/04/20 21:14:35 nit: DLOG
Zhenyao Mo 2016/04/20 22:08:50 This is consistent with the rest of the code. We
piman 2016/04/20 22:14:52 We should stop doing that. Strings and logging cod
+ << "transform feedback separate attribs is too small ("
+ << max_transform_feedback_separate_attribs_ << ", should be "
+ << kMinTransformFeedbackSeparateAttribs << ").";
+ return false;
+ }
+
+ const GLint kMinUniformBufferBindings = 24;
+ if (!QueryGLFeatureU(GL_MAX_UNIFORM_BUFFER_BINDINGS,
+ kMinUniformBufferBindings,
+ &max_uniform_buffer_bindings_)) {
+ LOG(ERROR) << "ContextGroup::Initialize failed because maximum "
piman 2016/04/20 21:14:35 nit: DLOG
Zhenyao Mo 2016/04/20 22:08:50 Same here.
+ << "uniform buffer bindings is too small ("
+ << max_uniform_buffer_bindings_ << ", should be "
+ << kMinUniformBufferBindings << ").";
+ return false;
+ }
+
+ // TODO(zmo): Should we check max UNIFORM_BUFFER_OFFSET_ALIGNMENT is 256?
+ GetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT,
+ &uniform_buffer_offset_alignment_);
+ }
+
buffer_manager_.reset(
new BufferManager(memory_tracker_.get(), feature_info_.get()));
framebuffer_manager_.reset(new FramebufferManager(

Powered by Google App Engine
This is Rietveld 408576698