summaryrefslogtreecommitdiffstats
path: root/mojo/gles2
diff options
context:
space:
mode:
authordyen <dyen@chromium.org>2015-10-07 11:58:31 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-07 18:59:10 +0000
commit5c38a030b88f43b57f404dc60d777572b33ea3c4 (patch)
treedcbefdf15124d6a1a11245bd1c901515cc11e795 /mojo/gles2
parentb474ca01fcc5376eb538f71e524351e52319d396 (diff)
downloadchromium_src-5c38a030b88f43b57f404dc60d777572b33ea3c4.zip
chromium_src-5c38a030b88f43b57f404dc60d777572b33ea3c4.tar.gz
chromium_src-5c38a030b88f43b57f404dc60d777572b33ea3c4.tar.bz2
Implemented new fence syncs which replaces the old sync points.
The new GL_CHROMIUM_sync_point proposal has been implemented now. The old functions are all different enough that no names were overloaded, so all of the old functionality still exists. This way, we can incrementally move over call sites of the old functions to use the new ones. R=jam@chromium.org, piman@chromium.org BUG=514815 Review URL: https://codereview.chromium.org/1331843005 Cr-Commit-Position: refs/heads/master@{#352901}
Diffstat (limited to 'mojo/gles2')
-rw-r--r--mojo/gles2/command_buffer_client_impl.cc15
-rw-r--r--mojo/gles2/command_buffer_client_impl.h6
2 files changed, 21 insertions, 0 deletions
diff --git a/mojo/gles2/command_buffer_client_impl.cc b/mojo/gles2/command_buffer_client_impl.cc
index 3548c1f..ba16771 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
diff --git a/mojo/gles2/command_buffer_client_impl.h b/mojo/gles2/command_buffer_client_impl.h
index b5e2db3..2c3c925 100644
--- a/mojo/gles2/command_buffer_client_impl.h
+++ b/mojo/gles2/command_buffer_client_impl.h
@@ -76,6 +76,9 @@ class CommandBufferClientImpl : public mojo::CommandBufferLostContextObserver,
bool IsGpuChannelLost() override;
gpu::CommandBufferNamespace GetNamespaceID() const override;
uint64_t GetCommandBufferID() const override;
+ uint64_t GenerateFenceSyncRelease() override;
+ bool IsFenceSyncRelease(uint64_t release) override;
+ bool IsFenceSyncFlushed(uint64_t release) override;
private:
class SyncClientImpl;
@@ -106,6 +109,9 @@ class CommandBufferClientImpl : public mojo::CommandBufferLostContextObserver,
// Image IDs are allocated in sequence.
int next_image_id_;
+ uint64_t next_fence_sync_release_;
+ uint64_t flushed_fence_sync_release_;
+
const MojoAsyncWaiter* async_waiter_;
};