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

Unified Diff: mojo/gles2/command_buffer_client_impl.cc

Issue 1331843005: Implemented new fence syncs which replaces the old sync points. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reverted mojo readme, changed wait() to take a pointer Created 5 years, 2 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
« no previous file with comments | « mojo/gles2/command_buffer_client_impl.h ('k') | mojo/gpu/mojo_gles2_impl_autogen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/gles2/command_buffer_client_impl.cc
diff --git a/mojo/gles2/command_buffer_client_impl.cc b/mojo/gles2/command_buffer_client_impl.cc
index c4c228a310bba4f86c2769c8bc7455381662ed6b..d64295349473d95960ca477548c1e01c33b5c27e 100644
--- a/mojo/gles2/command_buffer_client_impl.cc
+++ b/mojo/gles2/command_buffer_client_impl.cc
@@ -128,6 +128,8 @@ CommandBufferClientImpl::CommandBufferClientImpl(
last_put_offset_(-1),
next_transfer_buffer_id_(0),
next_image_id_(0),
+ next_fence_sync_release_(1),
+ flushed_fence_sync_release_(0),
async_waiter_(async_waiter) {
command_buffer_.Bind(mojo::InterfacePtrInfo<mojo::CommandBuffer>(
command_buffer_handle.Pass(), 0u),
@@ -190,6 +192,7 @@ void CommandBufferClientImpl::Flush(int32 put_offset) {
last_put_offset_ = put_offset;
command_buffer_->Flush(put_offset);
+ flushed_fence_sync_release_ = next_fence_sync_release_ - 1;
}
void CommandBufferClientImpl::OrderingBarrier(int32_t put_offset) {
@@ -408,4 +411,16 @@ uint64_t CommandBufferClientImpl::GetCommandBufferID() const {
return 0;
}
+uint64_t CommandBufferClientImpl::GenerateFenceSyncRelease() {
+ return next_fence_sync_release_++;
+}
+
+bool CommandBufferClientImpl::IsFenceSyncRelease(uint64_t release) {
+ return release != 0 && release < next_fence_sync_release_;
+}
+
+bool CommandBufferClientImpl::IsFenceSyncFlushed(uint64_t release) {
+ return release != 0 && release <= flushed_fence_sync_release_;
+}
+
} // namespace gles2
« no previous file with comments | « mojo/gles2/command_buffer_client_impl.h ('k') | mojo/gpu/mojo_gles2_impl_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698