Chromium Code Reviews| 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 |