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

Unified Diff: gpu/command_buffer/tests/gl_fence_sync_unittest.cc

Issue 1568563002: Added a way for sync point clients to issue out of order waits. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Allow WaitOutOfOrder if no client order data Created 4 years, 11 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 | « gpu/command_buffer/service/sync_point_manager_unittest.cc ('k') | gpu/command_buffer/tests/gl_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/tests/gl_fence_sync_unittest.cc
diff --git a/gpu/command_buffer/tests/gl_fence_sync_unittest.cc b/gpu/command_buffer/tests/gl_fence_sync_unittest.cc
index 2d764765e966a7f5339ecc63006c8adb9083c14e..50de9c19ac0ed46da07b45518ea5546efd637fef 100644
--- a/gpu/command_buffer/tests/gl_fence_sync_unittest.cc
+++ b/gpu/command_buffer/tests/gl_fence_sync_unittest.cc
@@ -67,4 +67,34 @@ TEST_F(GLFenceSyncTest, SimpleReleaseWait) {
EXPECT_EQ(0u, gl2_client_state->fence_sync_release());
}
+static void TestCallback(int* storage, int assign) {
+ *storage = assign;
+}
+
+TEST_F(GLFenceSyncTest, SimpleReleaseSignal) {
+ gl1_.MakeCurrent();
+
+ // Pause the command buffer so the fence sync does not immediately trigger.
+ gl1_.SetCommandsPaused(true);
+
+ const GLuint64 fence_sync = glInsertFenceSyncCHROMIUM();
+ SyncToken sync_token;
+ glGenUnverifiedSyncTokenCHROMIUM(fence_sync, sync_token.GetData());
+ glFlush();
+ ASSERT_TRUE(sync_token.HasData());
+
+ gl2_.MakeCurrent();
+ int callback_called = 0;
+ gl2_.SignalSyncToken(sync_token,
+ base::Bind(TestCallback, &callback_called, 1));
+
+ gl1_.MakeCurrent();
+ EXPECT_EQ(0, callback_called);
+
+ gl1_.SetCommandsPaused(false);
+ glFinish();
+
+ EXPECT_EQ(1, callback_called);
+}
+
} // namespace gpu
« no previous file with comments | « gpu/command_buffer/service/sync_point_manager_unittest.cc ('k') | gpu/command_buffer/tests/gl_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698