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

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

Issue 1479673003: Verify resource provider sync tokens before sending to parent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unit test so it doesn't expect dummy fence sync 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 | « cc/test/test_web_graphics_context_3d.cc ('k') | gpu/command_buffer/client/gles2_implementation_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 96d08e1ae236a7e622eba2e381e93b713197242f..556eea73755b870116a3befe4937f2b802221198 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -5589,7 +5589,7 @@ void GLES2Implementation::GenUnverifiedSyncTokenCHROMIUM(GLuint64 fence_sync,
void GLES2Implementation::VerifySyncTokensCHROMIUM(GLbyte **sync_tokens,
GLsizei count) {
- bool sync_tokens_verified = false;
+ bool requires_synchronization = false;
for (GLsizei i = 0; i < count; ++i) {
if (sync_tokens[i]) {
SyncToken sync_token;
@@ -5601,18 +5601,26 @@ void GLES2Implementation::VerifySyncTokensCHROMIUM(GLbyte **sync_tokens,
"Cannot verify sync token using this context.");
return;
}
- if (!sync_tokens_verified) {
- // Insert a fence sync here and ensure it is received immediately.
- // This will require a flush but simplifies things a bit because
- // unverified sync tokens only need an ordering barrier.
- const uint64_t release = gpu_control_->GenerateFenceSyncRelease();
- FlushHelper();
- const bool verified = gpu_control_->IsFenceSyncFlushReceived(release);
- DCHECK(verified);
-
- sync_tokens_verified = true;
- }
+ requires_synchronization = true;
+ }
+ }
+ }
+
+ // This step must be done after all unverified tokens have finished processing
+ // CanWaitUnverifiedSyncToken(), command buffers use that to do any necessary
+ // flushes.
+ if (requires_synchronization) {
+ // Make sure we have no pending ordering barriers by flushing now.
+ FlushHelper();
+ // Ensure all the fence syncs are visible on GPU service.
+ gpu_control_->EnsureWorkVisible();
+
+ // We can automatically mark everything as verified now.
+ for (GLsizei i = 0; i < count; ++i) {
+ SyncToken sync_token;
+ memcpy(&sync_token, sync_tokens[i], sizeof(sync_token));
+ if (!sync_token.verified_flush()) {
sync_token.SetVerifyFlush();
memcpy(sync_tokens[i], &sync_token, sizeof(sync_token));
}
« no previous file with comments | « cc/test/test_web_graphics_context_3d.cc ('k') | gpu/command_buffer/client/gles2_implementation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698