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

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: Forgot to remove cmd buffer helper functios and replace with gpu control ones Created 5 years, 3 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: 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 b34d438078400d12ebb164b47afe11212a56bd4b..dca6bd0de1426fa49c6905b81745aaef0cd75afb 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;
}
+uint32_t CommandBufferClientImpl::GenerateFenceSyncRelease() {
+ return next_fence_sync_release_++;
+}
+
+bool CommandBufferClientImpl::IsFenceSyncRelease(uint32_t release) {
+ return release != 0 && release < next_fence_sync_release_;
+}
+
+bool CommandBufferClientImpl::IsFenceSyncFlushed(uint32_t release) {
+ return release != 0 && release <= flushed_fence_sync_release_;
+}
+
} // namespace gles2

Powered by Google App Engine
This is Rietveld 408576698