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

Unified Diff: gpu/command_buffer/client/cmd_buffer_helper.cc

Issue 896723008: Add OrderingBarrierCHROMIUM API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed nits. Created 5 years, 10 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/cmd_buffer_helper.h ('k') | gpu/command_buffer/client/cmd_buffer_helper_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/cmd_buffer_helper.cc
diff --git a/gpu/command_buffer/client/cmd_buffer_helper.cc b/gpu/command_buffer/client/cmd_buffer_helper.cc
index a99201e4b36164ef01ef218d7651f6fe55e851b9..038ba41fda06ae7b10e2d73b91e9423d2b1d8410 100644
--- a/gpu/command_buffer/client/cmd_buffer_helper.cc
+++ b/gpu/command_buffer/client/cmd_buffer_helper.cc
@@ -150,7 +150,7 @@ void CommandBufferHelper::Flush() {
if (put_ == total_entry_count_)
put_ = 0;
- if (usable() && last_put_sent_ != put_) {
+ if (usable()) {
last_flush_time_ = base::TimeTicks::Now();
last_put_sent_ = put_;
command_buffer_->Flush(put_);
@@ -159,6 +159,18 @@ void CommandBufferHelper::Flush() {
}
}
+void CommandBufferHelper::OrderingBarrier() {
+ // Wrap put_ before setting the barrier.
+ if (put_ == total_entry_count_)
+ put_ = 0;
+
+ if (usable()) {
+ command_buffer_->OrderingBarrier(put_);
+ ++flush_generation_;
+ CalcImmediateEntries(0);
+ }
+}
+
#if defined(CMD_HELPER_PERIODIC_FLUSH_CHECK)
void CommandBufferHelper::PeriodicFlushCheck() {
base::TimeTicks current_time = base::TimeTicks::Now();
« no previous file with comments | « gpu/command_buffer/client/cmd_buffer_helper.h ('k') | gpu/command_buffer/client/cmd_buffer_helper_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698