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

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: 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
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 2b186a4bcb0c706a4236e7f41401927f995655ee..27bdd8a0f99ce0b3943872020c292213cea53393 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -5364,6 +5364,48 @@ uint64_t GLES2Implementation::ShareGroupTracingGUID() const {
return share_group_->TracingGUID();
}
+GLuint64 GLES2Implementation::InsertFenceSyncCHROMIUM() {
+ const uint64_t release = gpu_control_->GenerateFenceSyncRelease();
+ helper_->InsertFenceSyncCHROMIUM(release);
+ return release;
+}
+
+void GLES2Implementation::GenSyncTokenCHROMIUM(GLuint64 fence_sync,
+ GLbyte* sync_token) {
+ if (!sync_token) {
+ SetGLError(GL_INVALID_VALUE, "glGenSyncTokenCHROMIUM", "empty sync_token");
+ return;
+ } else if (!gpu_control_->IsFenceSyncRelease(fence_sync)) {
+ SetGLError(GL_INVALID_VALUE, "glGenSyncTokenCHROMIUM",
+ "invalid fence sync");
+ return;
+ } else if (!gpu_control_->IsFenceSyncFlushed(fence_sync)) {
+ SetGLError(GL_INVALID_OPERATION, "glGenSyncTokenCHROMIUM",
+ "fence sync must be flushed before generating sync token");
+ return;
+ }
+
+ SyncToken* sync_token_data = reinterpret_cast<SyncToken*>(sync_token);
+ memset(sync_token_data, 0, sizeof(SyncToken));
+
+ sync_token_data->namespace_id = gpu_control_->GetNamespaceID();
+ sync_token_data->command_buffer_id = gpu_control_->GetCommandBufferID();
+ 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->namespace_id,
+ sync_token_data->command_buffer_id,
+ sync_token_data->release_count);
+}
+
namespace {
bool ValidImageFormat(GLenum internalformat,
« no previous file with comments | « gpu/command_buffer/client/gles2_cmd_helper_autogen.h ('k') | gpu/command_buffer/client/gles2_implementation_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698