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

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: Update unit test classes. 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
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..c67f434f3bfa31602eccccf1ad0c98a473cd0efb 100644
--- a/gpu/command_buffer/client/cmd_buffer_helper.cc
+++ b/gpu/command_buffer/client/cmd_buffer_helper.cc
@@ -23,6 +23,7 @@ CommandBufferHelper::CommandBufferHelper(CommandBuffer* command_buffer)
token_(0),
put_(0),
last_put_sent_(0),
+ last_shallow_put_sent_(0),
#if defined(CMD_HELPER_PERIODIC_FLUSH_CHECK)
commands_issued_(0),
#endif
@@ -153,12 +154,26 @@ void CommandBufferHelper::Flush() {
if (usable() && last_put_sent_ != put_) {
last_flush_time_ = base::TimeTicks::Now();
last_put_sent_ = put_;
+ last_shallow_put_sent_ = put_;
command_buffer_->Flush(put_);
++flush_generation_;
CalcImmediateEntries(0);
}
}
+void CommandBufferHelper::ShallowFlush() {
+ // Wrap put_ before flush.
+ if (put_ == total_entry_count_)
+ put_ = 0;
+
+ if (usable() && last_shallow_put_sent_ != put_) {
+ last_shallow_put_sent_ = put_;
+ command_buffer_->ShallowFlush(put_);
+ ++flush_generation_;
+ CalcImmediateEntries(0);
+ }
+}
+
#if defined(CMD_HELPER_PERIODIC_FLUSH_CHECK)
void CommandBufferHelper::PeriodicFlushCheck() {
base::TimeTicks current_time = base::TimeTicks::Now();

Powered by Google App Engine
This is Rietveld 408576698