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

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

Issue 2550583002: gpu: Thread-safe command buffer state lookup. (Closed)
Patch Set: jbauman's review Created 4 years 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/client/gpu_control.h ('k') | gpu/command_buffer/common/cmd_buffer_common.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/ring_buffer.cc
diff --git a/gpu/command_buffer/client/ring_buffer.cc b/gpu/command_buffer/client/ring_buffer.cc
index ebbb1182aed5f175f8391de22e79118cdf6f4b71..118dc57276e5d79d4810c8bcdb34561da70bb2fd 100644
--- a/gpu/command_buffer/client/ring_buffer.cc
+++ b/gpu/command_buffer/client/ring_buffer.cc
@@ -146,10 +146,9 @@ void RingBuffer::DiscardBlock(void* pointer) {
}
unsigned int RingBuffer::GetLargestFreeSizeNoWaiting() {
- unsigned int last_token_read = helper_->last_token_read();
while (!blocks_.empty()) {
Block& block = blocks_.front();
- if (block.token > last_token_read || block.state == IN_USE) break;
+ if (!helper_->HasTokenPassed(block.token) || block.state == IN_USE) break;
FreeOldestBlock();
}
if (free_offset_ == in_use_offset_) {
« no previous file with comments | « gpu/command_buffer/client/gpu_control.h ('k') | gpu/command_buffer/common/cmd_buffer_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698