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

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

Issue 1489573003: Added an extra sync token field for extra command buffer identification. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Return False on invalid stream id Created 5 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
« no previous file with comments | « gpu/command_buffer/common/constants.h ('k') | gpu/command_buffer/service/in_process_command_buffer.h » ('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 11af396265ab488e9e27c04763f65977ad36eab0..14f725681ebc2a76d6b4e6d0978dbaae63eca8f0 100644
--- a/gpu/command_buffer/common/sync_token.h
+++ b/gpu/command_buffer/common/sync_token.h
@@ -26,6 +26,7 @@ struct GPU_EXPORT SyncToken {
SyncToken()
: verified_flush_(false),
namespace_id_(CommandBufferNamespace::INVALID),
+ extra_data_field_(0),
command_buffer_id_(0),
release_count_(0) {}
@@ -36,21 +37,26 @@ struct GPU_EXPORT SyncToken {
: verified_flush_(sync_point ? true : false),
namespace_id_(sync_point ? gpu::CommandBufferNamespace::OLD_SYNC_POINTS
: gpu::CommandBufferNamespace::INVALID),
+ extra_data_field_(0),
command_buffer_id_(0),
release_count_(sync_point) {}
SyncToken(CommandBufferNamespace namespace_id,
+ int32_t extra_data_field,
uint64_t command_buffer_id,
uint64_t release_count)
: verified_flush_(false),
namespace_id_(namespace_id),
+ extra_data_field_(extra_data_field),
command_buffer_id_(command_buffer_id),
release_count_(release_count) {}
void Set(CommandBufferNamespace namespace_id,
+ int32_t extra_data_field,
uint64_t command_buffer_id,
uint64_t release_count) {
namespace_id_ = namespace_id;
+ extra_data_field_ = extra_data_field;
command_buffer_id_ = command_buffer_id;
release_count_ = release_count;
}
@@ -58,6 +64,7 @@ struct GPU_EXPORT SyncToken {
void Clear() {
verified_flush_ = false;
namespace_id_ = CommandBufferNamespace::INVALID;
+ extra_data_field_ = 0;
command_buffer_id_ = 0;
release_count_ = 0;
}
@@ -81,6 +88,12 @@ struct GPU_EXPORT SyncToken {
uint64_t command_buffer_id() const { return command_buffer_id_; }
uint64_t release_count() const { return release_count_; }
+ // This extra data field can be used by command buffers to add extra
+ // information to identify unverified sync tokens. The current purpose
+ // of this field is only for unverified sync tokens which only exist within
+ // the same process so this information will not survive cross-process IPCs.
+ int32_t extra_data_field() const { return extra_data_field_; }
+
bool operator<(const SyncToken& other) const {
// TODO(dyen): Once all our compilers support c++11, we can replace this
// long list of comparisons with std::tie().
@@ -94,6 +107,7 @@ struct GPU_EXPORT SyncToken {
bool operator==(const SyncToken& other) const {
return verified_flush_ == other.verified_flush() &&
namespace_id_ == other.namespace_id() &&
+ extra_data_field_ == other.extra_data_field() &&
command_buffer_id_ == other.command_buffer_id() &&
release_count_ == other.release_count();
}
@@ -103,6 +117,7 @@ struct GPU_EXPORT SyncToken {
private:
bool verified_flush_;
CommandBufferNamespace namespace_id_;
+ int32_t extra_data_field_;
uint64_t command_buffer_id_;
uint64_t release_count_;
};
« no previous file with comments | « gpu/command_buffer/common/constants.h ('k') | gpu/command_buffer/service/in_process_command_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698