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

Unified Diff: gpu/command_buffer/common/sync_token.h

Issue 1427543002: Modified old wait sync point functions to also accept new sync tokens. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: format Created 5 years, 1 month 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 | « gpu/command_buffer/common/mailbox_holder.cc ('k') | gpu/ipc/gpu_command_buffer_traits.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/common/sync_token.h
diff --git a/gpu/command_buffer/common/sync_token.h b/gpu/command_buffer/common/sync_token.h
index cceb44e6c0277af142a99e009ebeeffc4ae3a2a3..11af396265ab488e9e27c04763f65977ad36eab0 100644
--- a/gpu/command_buffer/common/sync_token.h
+++ b/gpu/command_buffer/common/sync_token.h
@@ -29,6 +29,16 @@ struct GPU_EXPORT SyncToken {
command_buffer_id_(0),
release_count_(0) {}
+ // TODO(dyen): This is an intermediate conversion constructor while we
+ // are converting from the old sync point system. Remove once conversion
+ // is finished.
+ explicit SyncToken(uint32_t sync_point)
+ : verified_flush_(sync_point ? true : false),
+ namespace_id_(sync_point ? gpu::CommandBufferNamespace::OLD_SYNC_POINTS
+ : gpu::CommandBufferNamespace::INVALID),
+ command_buffer_id_(0),
+ release_count_(sync_point) {}
+
SyncToken(CommandBufferNamespace namespace_id,
uint64_t command_buffer_id,
uint64_t release_count)
@@ -45,10 +55,21 @@ struct GPU_EXPORT SyncToken {
release_count_ = release_count;
}
+ void Clear() {
+ verified_flush_ = false;
+ namespace_id_ = CommandBufferNamespace::INVALID;
+ command_buffer_id_ = 0;
+ release_count_ = 0;
+ }
+
void SetVerifyFlush() {
verified_flush_ = true;
}
+ bool HasData() const {
+ return namespace_id_ != CommandBufferNamespace::INVALID;
+ }
+
int8_t* GetData() { return reinterpret_cast<int8_t*>(this); }
const int8_t* GetConstData() const {
@@ -70,6 +91,15 @@ struct GPU_EXPORT SyncToken {
(release_count_ < other.release_count()))));
}
+ bool operator==(const SyncToken& other) const {
+ return verified_flush_ == other.verified_flush() &&
+ namespace_id_ == other.namespace_id() &&
+ command_buffer_id_ == other.command_buffer_id() &&
+ release_count_ == other.release_count();
+ }
+
+ bool operator!=(const SyncToken& other) const { return !(*this == other); }
+
private:
bool verified_flush_;
CommandBufferNamespace namespace_id_;
« no previous file with comments | « gpu/command_buffer/common/mailbox_holder.cc ('k') | gpu/ipc/gpu_command_buffer_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698