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

Unified Diff: gpu/command_buffer/client/gles2_implementation.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: Some fixes Created 5 years, 3 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/gles2_implementation.cc
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index de46cf4a5b32b44cbdf53303266ddbeec22d91c8..4b5ea4addb0d2709c604c06fc3cd24549d5f813f 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -5369,6 +5369,51 @@ void GLES2Implementation::RetireSyncPointCHROMIUM(GLuint sync_point) {
gpu_control_->RetireSyncPoint(sync_point);
}
+GLuint GLES2Implementation::InsertFenceSyncCHROMIUM() {
+ const uint32_t release = helper_->GenerateFenceSyncRelease();
+ helper_->InsertFenceSyncCHROMIUM(release);
+ return release;
+}
+
+void GLES2Implementation::GenSyncTokenCHROMIUM(GLuint fence_sync,
+ GLbyte* sync_token) {
+ if (!sync_token) {
+ SetGLError(GL_INVALID_VALUE, "glGenSyncTokenCHROMIUM", "empty sync_token");
+ return;
+ } else if (!helper_->IsFenceSyncRelease(fence_sync)) {
+ SetGLError(GL_INVALID_VALUE, "glGenSyncTokenCHROMIUM",
+ "invalid fence sync");
+ return;
+ } else if (!helper_->IsFenceSyncFlushed(fence_sync)) {
+ SetGLError(GL_INVALID_OPERATION, "glGenSyncTokenCHROMIUM",
+ "fence sync must be flushed before generating sync token");
+ return;
+ }
+
+ int channel_id = 0;
+ uint32_t route_id = 0;
+ helper_->command_buffer()->GetRouteInformation(&channel_id, &route_id);
+
+ SyncToken* sync_token_data = reinterpret_cast<SyncToken*>(sync_token);
+ memset(sync_token_data, 0, sizeof(SyncToken));
+ sync_token_data->channel_client_id = channel_id;
+ sync_token_data->route_id = route_id;
+ sync_token_data->release_count = fence_sync;
+}
+
+void GLES2Implementation::WaitSyncTokenCHROMIUM(const GLbyte* sync_token) {
+ if (!sync_token) {
+ SetGLError(GL_INVALID_VALUE, "glWaitSyncTokenCHROMIUM", "empty sync_token");
+ return;
+ };
+
+ const SyncToken* sync_token_data =
+ reinterpret_cast<const SyncToken*>(sync_token);
+ helper_->WaitSyncTokenCHROMIUM(sync_token_data->channel_client_id,
+ sync_token_data->route_id,
+ sync_token_data->release_count);
+}
+
namespace {
bool ValidImageFormat(GLenum internalformat,

Powered by Google App Engine
This is Rietveld 408576698