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

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

Issue 1427543002: Modified old wait sync point functions to also accept new sync tokens. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: format Created 5 years, 1 month 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 45b52d9461df319a4f161f862b6aca6217b95e0c..4fcb0b3217102debe568bd972bbadbecf86a0d34 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -5366,6 +5366,11 @@ GLuint GLES2Implementation::InsertSyncPointCHROMIUM() {
return gpu_control_->InsertSyncPoint();
}
+void GLES2Implementation::WaitSyncPointCHROMIUM(GLuint sync_point) {
+ // This should no longer be called.
+ NOTREACHED();
+}
+
GLuint GLES2Implementation::InsertFutureSyncPointCHROMIUM() {
GPU_CLIENT_SINGLE_THREAD_CHECK();
GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glInsertFutureSyncPointCHROMIUM");
@@ -5437,25 +5442,34 @@ void GLES2Implementation::GenUnverifiedSyncTokenCHROMIUM(GLuint64 fence_sync,
}
void GLES2Implementation::WaitSyncTokenCHROMIUM(const GLbyte* sync_token) {
- if (!sync_token) {
- SetGLError(GL_INVALID_VALUE, "glWaitSyncTokenCHROMIUM", "empty sync_token");
- return;
- };
+ if (sync_token) {
+ // Copy the data over before data access to ensure alignment.
+ SyncToken sync_token_data;
+ memcpy(&sync_token_data, sync_token, sizeof(SyncToken));
+ if (sync_token_data.HasData()) {
+ if (!sync_token_data.verified_flush() &&
+ !gpu_control_->CanWaitUnverifiedSyncToken(&sync_token_data)) {
+ SetGLError(GL_INVALID_VALUE, "glWaitSyncTokenCHROMIUM",
+ "Cannot wait on sync_token which has not been verified");
+ return;
+ }
- // Copy the data over before data access to ensure alignment.
- SyncToken sync_token_data;
- memcpy(&sync_token_data, sync_token, sizeof(SyncToken));
+ // TODO(dyen): Temporarily support old sync points, remove once all old
+ // sync points have been removed.
+ const gpu::CommandBufferNamespace namespace_id =
+ sync_token_data.namespace_id();
+ if (namespace_id == gpu::CommandBufferNamespace::OLD_SYNC_POINTS) {
+ const uint32_t sync_point =
+ static_cast<uint32_t>(sync_token_data.release_count());
+ helper_->WaitSyncPointCHROMIUM(sync_point);
+ return;
+ }
- if (!sync_token_data.verified_flush() &&
- !gpu_control_->CanWaitUnverifiedSyncToken(&sync_token_data)) {
- SetGLError(GL_INVALID_VALUE, "glWaitSyncTokenCHROMIUM",
- "Cannot wait on sync_token which has not been verified");
- return;
+ helper_->WaitSyncTokenCHROMIUM(
+ static_cast<GLuint>(sync_token_data.namespace_id()),
+ sync_token_data.command_buffer_id(), sync_token_data.release_count());
+ }
}
-
- helper_->WaitSyncTokenCHROMIUM(sync_token_data.namespace_id(),
- sync_token_data.command_buffer_id(),
- sync_token_data.release_count());
}
namespace {
« no previous file with comments | « gpu/command_buffer/build_gles2_cmd_buffer.py ('k') | gpu/command_buffer/client/gles2_implementation_impl_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698