OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef GPU_COMMAND_BUFFER_CLIENT_GPU_CONTROL_H_ | 5 #ifndef GPU_COMMAND_BUFFER_CLIENT_GPU_CONTROL_H_ |
6 #define GPU_COMMAND_BUFFER_CLIENT_GPU_CONTROL_H_ | 6 #define GPU_COMMAND_BUFFER_CLIENT_GPU_CONTROL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // the GPU implementation if it is to be used from multiple threads. This | 82 // the GPU implementation if it is to be used from multiple threads. This |
83 // may not be supported with all implementations. | 83 // may not be supported with all implementations. |
84 virtual void SetLock(base::Lock*) = 0; | 84 virtual void SetLock(base::Lock*) = 0; |
85 | 85 |
86 // Returns true if the channel to the Gpu is lost. When true, all contexts | 86 // Returns true if the channel to the Gpu is lost. When true, all contexts |
87 // should be considered as lost. | 87 // should be considered as lost. |
88 virtual bool IsGpuChannelLost() = 0; | 88 virtual bool IsGpuChannelLost() = 0; |
89 | 89 |
90 // The namespace and command buffer ID forms a unique pair for all existing | 90 // The namespace and command buffer ID forms a unique pair for all existing |
91 // GpuControl (on client) and matches for the corresponding command buffer | 91 // GpuControl (on client) and matches for the corresponding command buffer |
92 // (on server) in a single server process. | 92 // (on server) in a single server process. The extra command buffer data can |
| 93 // be used for extra identification purposes. One usage is to store some |
| 94 // extra field to identify unverified sync tokens for the implementation of |
| 95 // the CanWaitUnverifiedSyncToken() function. |
93 virtual CommandBufferNamespace GetNamespaceID() const = 0; | 96 virtual CommandBufferNamespace GetNamespaceID() const = 0; |
94 virtual uint64_t GetCommandBufferID() const = 0; | 97 virtual uint64_t GetCommandBufferID() const = 0; |
| 98 virtual uint32_t GetExtraCommandBufferData() const = 0; |
95 | 99 |
96 // Fence Syncs use release counters at a context level, these fence syncs | 100 // Fence Syncs use release counters at a context level, these fence syncs |
97 // need to be flushed before they can be shared with other contexts across | 101 // need to be flushed before they can be shared with other contexts across |
98 // channels. Subclasses should implement these functions and take care of | 102 // channels. Subclasses should implement these functions and take care of |
99 // figuring out when a fence sync has been flushed. The difference between | 103 // figuring out when a fence sync has been flushed. The difference between |
100 // IsFenceSyncFlushed and IsFenceSyncFlushReceived, one is testing is the | 104 // IsFenceSyncFlushed and IsFenceSyncFlushReceived, one is testing is the |
101 // client has issued the flush, and the other is testing if the service | 105 // client has issued the flush, and the other is testing if the service |
102 // has received the flush. | 106 // has received the flush. |
103 virtual uint64_t GenerateFenceSyncRelease() = 0; | 107 virtual uint64_t GenerateFenceSyncRelease() = 0; |
104 virtual bool IsFenceSyncRelease(uint64_t release) = 0; | 108 virtual bool IsFenceSyncRelease(uint64_t release) = 0; |
(...skipping 10 matching lines...) Expand all Loading... |
115 // be enqueued first so does not need to be flushed. | 119 // be enqueued first so does not need to be flushed. |
116 virtual bool CanWaitUnverifiedSyncToken(const SyncToken* sync_token) = 0; | 120 virtual bool CanWaitUnverifiedSyncToken(const SyncToken* sync_token) = 0; |
117 | 121 |
118 private: | 122 private: |
119 DISALLOW_COPY_AND_ASSIGN(GpuControl); | 123 DISALLOW_COPY_AND_ASSIGN(GpuControl); |
120 }; | 124 }; |
121 | 125 |
122 } // namespace gpu | 126 } // namespace gpu |
123 | 127 |
124 #endif // GPU_COMMAND_BUFFER_CLIENT_GPU_CONTROL_H_ | 128 #endif // GPU_COMMAND_BUFFER_CLIENT_GPU_CONTROL_H_ |
OLD | NEW |