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

Unified Diff: components/mus/gles2/command_buffer_driver.cc

Issue 1331843005: Implemented new fence syncs which replaces the old sync points. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reverted mojo readme, changed wait() to take a pointer Created 5 years, 2 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 | « components/mus/gles2/command_buffer_driver.h ('k') | components/mus/gles2/command_buffer_local.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/gles2/command_buffer_driver.cc
diff --git a/components/mus/gles2/command_buffer_driver.cc b/components/mus/gles2/command_buffer_driver.cc
index a03a357f1a24d01d21fa13f1d7a3a47fa5735c38..acffd148f62a8b9674b25ac7e184942fb336edab 100644
--- a/components/mus/gles2/command_buffer_driver.cc
+++ b/components/mus/gles2/command_buffer_driver.cc
@@ -12,7 +12,6 @@
#include "components/mus/gles2/gpu_memory_tracker.h"
#include "components/mus/gles2/gpu_state.h"
#include "components/mus/gles2/mojo_buffer_backing.h"
-#include "gpu/command_buffer/common/constants.h"
#include "gpu/command_buffer/common/value_state.h"
#include "gpu/command_buffer/service/command_buffer_service.h"
#include "gpu/command_buffer/service/context_group.h"
@@ -117,6 +116,10 @@ bool CommandBufferDriver::DoInitialize(
base::Bind(&CommandBufferDriver::OnResize, base::Unretained(this)));
decoder_->SetWaitSyncPointCallback(base::Bind(
&CommandBufferDriver::OnWaitSyncPoint, base::Unretained(this)));
+ decoder_->SetFenceSyncReleaseCallback(base::Bind(
+ &CommandBufferDriver::OnFenceSyncRelease, base::Unretained(this)));
+ decoder_->SetWaitFenceSyncCallback(base::Bind(
+ &CommandBufferDriver::OnWaitFenceSync, base::Unretained(this)));
gpu::gles2::DisallowedFeatures disallowed_features;
@@ -293,6 +296,45 @@ bool CommandBufferDriver::OnWaitSyncPoint(uint32_t sync_point) {
return scheduler_->scheduled();
}
+void CommandBufferDriver::OnFenceSyncRelease(uint64_t release) {
+ // TODO(dyen): Implement once CommandBufferID has been figured out and
+ // we have a SyncPointClient. It would probably look like what is commented
+ // out below:
+ // if (!sync_point_client_->client_state()->IsFenceSyncReleased(release))
+ // sync_point_client_->ReleaseFenceSync(release);
+ NOTIMPLEMENTED();
+}
+
+bool CommandBufferDriver::OnWaitFenceSync(
+ gpu::CommandBufferNamespace namespace_id,
+ uint64_t command_buffer_id,
+ uint64_t release) {
+ gpu::SyncPointManager* sync_point_manager = gpu_state_->sync_point_manager();
+ DCHECK(sync_point_manager);
+
+ scoped_refptr<gpu::SyncPointClientState> release_state =
+ sync_point_manager->GetSyncPointClientState(namespace_id,
+ command_buffer_id);
+
+ if (!release_state)
+ return true;
+
+ if (release_state->IsFenceSyncReleased(release))
+ return true;
+
+ // TODO(dyen): Implement once CommandBufferID has been figured out and
+ // we have a SyncPointClient. It would probably look like what is commented
+ // out below:
+ // scheduler_->SetScheduled(false);
+ // sync_point_client_->Wait(
+ // release_state.get(),
+ // release,
+ // base::Bind(&CommandBufferDriver::OnSyncPointRetired,
+ // weak_factory_.GetWeakPtr()));
+ NOTIMPLEMENTED();
+ return scheduler_->scheduled();
+}
+
void CommandBufferDriver::OnSyncPointRetired() {
scheduler_->SetScheduled(true);
}
« no previous file with comments | « components/mus/gles2/command_buffer_driver.h ('k') | components/mus/gles2/command_buffer_local.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698