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

Unified Diff: gpu/command_buffer/client/cmd_buffer_helper.cc

Issue 116863003: gpu: Reuse transfer buffers more aggresively (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: [WIP] Introduced internal SetAsyncToken command buffer command Created 6 years, 11 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/client/cmd_buffer_helper.cc
diff --git a/gpu/command_buffer/client/cmd_buffer_helper.cc b/gpu/command_buffer/client/cmd_buffer_helper.cc
index 11219ede664751e3fa92a2dcc800388f8d4d3f5c..c383e15e1e7312e9c6309e4fbe81770fcbee70f3 100644
--- a/gpu/command_buffer/client/cmd_buffer_helper.cc
+++ b/gpu/command_buffer/client/cmd_buffer_helper.cc
@@ -25,6 +25,7 @@ CommandBufferHelper::CommandBufferHelper(CommandBuffer* command_buffer)
entries_(NULL),
total_entry_count_(0),
token_(0),
+ async_token_(0),
put_(0),
last_put_sent_(0),
commands_issued_(0),
@@ -191,6 +192,24 @@ void CommandBufferHelper::WaitForToken(int32 token) {
}
}
+uint32 CommandBufferHelper::InsertAsyncToken() {
epenner 2014/01/23 02:52:44 Perhaps async token is meant to be more generic, b
+ AllocateRingBuffer();
+ if (!usable()) {
+ return async_token_;
+ }
+ DCHECK(HaveRingBuffer());
+
+ async_token_++;
+ if (async_token_ == 0)
+ async_token_++;
+
+ cmd::SetAsyncToken* cmd = GetCmdSpace<cmd::SetAsyncToken>();
+ if (cmd) {
+ cmd->Init(async_token_);
+ }
+ return async_token_;
+}
+
// Waits for available entries, basically waiting until get >= put + count + 1.
// It actually waits for contiguous entries, so it may need to wrap the buffer
// around, adding a noops. Thus this function may change the value of put_. The

Powered by Google App Engine
This is Rietveld 408576698