summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/client/cmd_buffer_helper.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gpu/command_buffer/client/cmd_buffer_helper.cc')
-rw-r--r--gpu/command_buffer/client/cmd_buffer_helper.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/gpu/command_buffer/client/cmd_buffer_helper.cc b/gpu/command_buffer/client/cmd_buffer_helper.cc
index ad5447a..f7d31c5 100644
--- a/gpu/command_buffer/client/cmd_buffer_helper.cc
+++ b/gpu/command_buffer/client/cmd_buffer_helper.cc
@@ -52,13 +52,18 @@ bool CommandBufferHelper::AllocateRingBuffer() {
return true;
}
- int32 id = -1;
- ring_buffer_ = command_buffer_->CreateTransferBuffer(ring_buffer_size_, &id);
+ int32 id = command_buffer_->CreateTransferBuffer(ring_buffer_size_, -1);
if (id < 0) {
ClearUsable();
return false;
}
+ ring_buffer_ = command_buffer_->GetTransferBuffer(id);
+ if (!ring_buffer_.ptr) {
+ ClearUsable();
+ return false;
+ }
+
ring_buffer_id_ = id;
command_buffer_->SetGetBuffer(id);