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

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
« no previous file with comments | « gpu/command_buffer/service/context_group.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 001b43c9d4db5e874113a5547e93ed75d3f41d29..d701117a9223ba5955a10b501957534828d33ea0 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) {
{
@@ -175,6 +178,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 "
+ << "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 "
+ << "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(
« no previous file with comments | « gpu/command_buffer/service/context_group.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698