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

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

Issue 2727573003: gpu: Add sync token dependencies to flush metadata. (Closed)
Patch Set: piman's review 2 Created 3 years, 9 months 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/client/gpu_control.h ('k') | gpu/command_buffer/tests/gl_manager.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 6a6bfad2a9a8ba2ef8ebcfdea5ba3cf26151ab2c..990f0c9b4bd8c16ccfd8f804a78f7e7cf329e6b8 100644
--- a/gpu/command_buffer/common/sync_token.h
+++ b/gpu/command_buffer/common/sync_token.h
@@ -8,6 +8,8 @@
#include <stdint.h>
#include <string.h>
+#include <tuple>
+
#include "gpu/command_buffer/common/command_buffer_id.h"
#include "gpu/command_buffer/common/constants.h"
#include "gpu/gpu_export.h"
@@ -77,13 +79,9 @@ struct GPU_EXPORT SyncToken {
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().
- return (namespace_id_ < other.namespace_id()) ||
- ((namespace_id_ == other.namespace_id()) &&
- ((command_buffer_id_ < other.command_buffer_id()) ||
- ((command_buffer_id_ == other.command_buffer_id()) &&
- (release_count_ < other.release_count()))));
+ return std::tie(namespace_id_, command_buffer_id_, release_count_) <
+ std::tie(other.namespace_id_, other.command_buffer_id_,
+ other.release_count_);
}
bool operator==(const SyncToken& other) const {
« no previous file with comments | « gpu/command_buffer/client/gpu_control.h ('k') | gpu/command_buffer/tests/gl_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698