Reduce internal Flush() in GL resource glGen/Delete APIs.
Previously command buffer Flush() was inserted in all
glGen/glDelete APIs to preserve glGen/glDelete/glBind
ordering semantics across shared contexts.
This change removes auto Flush() on glGen*, and requires
that users call glFlush or glFinish explicitly to
guarantee ordering semantics.
Further for share groups without bind_generates_resouce
semantic, this change replaces the auto Flush() on
glDelete* with lazy ID collection.
BUG=343269
Review URL: https://codereview.chromium.org/162023002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@252635 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/gpu/command_buffer/client/cmd_buffer_helper.cc b/gpu/command_buffer/client/cmd_buffer_helper.cc
index 693063d..f7a0a18 100644
--- a/gpu/command_buffer/client/cmd_buffer_helper.cc
+++ b/gpu/command_buffer/client/cmd_buffer_helper.cc
@@ -156,6 +156,7 @@
last_flush_time_ = clock();
last_put_sent_ = put_;
CommandBuffer::State state = command_buffer_->FlushSync(put_, get_offset());
+ ++flush_generation_;
CalcImmediateEntries(0);
return state.error == error::kNoError;
}
@@ -169,6 +170,7 @@
last_flush_time_ = clock();
last_put_sent_ = put_;
command_buffer_->Flush(put_);
+ ++flush_generation_;
CalcImmediateEntries(0);
}
}