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

Unified Diff: gpu/command_buffer/client/gpu_control.h

Issue 2550583002: gpu: Thread-safe command buffer state lookup. (Closed)
Patch Set: piman'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
Index: gpu/command_buffer/client/gpu_control.h
diff --git a/gpu/command_buffer/client/gpu_control.h b/gpu/command_buffer/client/gpu_control.h
index afdb93adee484d5eeb86e6b06751cdddd0e2c17a..62429898c882dcff05f3556d759f9a19dc72f888 100644
--- a/gpu/command_buffer/client/gpu_control.h
+++ b/gpu/command_buffer/client/gpu_control.h
@@ -82,18 +82,29 @@ class GPU_EXPORT GpuControl {
virtual CommandBufferId GetCommandBufferID() const = 0;
virtual int32_t GetExtraCommandBufferData() const = 0;
- // Fence Syncs use release counters at a context level, these fence syncs
- // need to be flushed before they can be shared with other contexts across
- // channels. Subclasses should implement these functions and take care of
- // figuring out when a fence sync has been flushed. The difference between
- // IsFenceSyncFlushed and IsFenceSyncFlushReceived, one is testing is the
- // client has issued the flush, and the other is testing if the service
- // has received the flush.
+ // Generates a fence sync which should be inserted into the GL command stream.
+ // When the service executes the fence sync it is released. Fence syncs are
+ // shared with other contexts as sync tokens which encapsulate the fence sync
+ // and the command buffer on which it was generated. Fence syncs need to be
+ // flushed before they can be used by other contexts. Furthermore, the flush
+ // must be verified before sending a sync token across channel boundaries.
virtual uint64_t GenerateFenceSyncRelease() = 0;
+
+ // Returns true if the fence sync is valid.
virtual bool IsFenceSyncRelease(uint64_t release) = 0;
+
+ // Returns true if the client has flushed the fence sync.
virtual bool IsFenceSyncFlushed(uint64_t release) = 0;
+
+ // Returns true if the service has received the fence sync. Used for verifying
+ // sync tokens.
virtual bool IsFenceSyncFlushReceived(uint64_t release) = 0;
+ // Returns true if the service has released (executed) the fence sync. Some
+ // implementations may support calling this from any thread without holding
+ // the lock provided by the client.
piman 2016/12/07 20:30:12 Are there implementations that are not thread safe
sunnyps 2016/12/08 01:14:15 I made the InProcessCommandBuffer implementation t
+ virtual bool IsFenceSyncReleased(uint64_t release) = 0;
+
// Runs |callback| when sync token is signalled.
virtual void SignalSyncToken(const SyncToken& sync_token,
const base::Closure& callback) = 0;

Powered by Google App Engine
This is Rietveld 408576698