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

Unified Diff: third_party/WebKit/Source/modules/vr/VRDisplay.cpp

Issue 2891033002: WebVR: flush before requesting sync token for mailbox (Closed)
Patch Set: Created 3 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/vr/VRDisplay.cpp
diff --git a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp
index a98b7a8de59704317c8f0ffc8d6b0042e7a75bde..97eb96ef914cb21c49e865f167e633c22d4f53d8 100644
--- a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp
+++ b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp
@@ -611,12 +611,22 @@ void VRDisplay::submitFrame() {
pending_previous_frame_render_ = true;
pending_submit_frame_ = true;
- display_->SubmitFrame(
- vr_frame_id_,
- gpu::MailboxHolder(static_image->GetMailbox(),
- static_image->GetSyncToken(), GL_TEXTURE_2D));
+
+ TRACE_EVENT_BEGIN0("gpu", "VRDisplay::GetMailbox");
+ auto mailbox = static_image->GetMailbox();
+ TRACE_EVENT_END0("gpu", "VRDisplay::GetMailbox");
+ // Flush to avoid black screen flashes which appear to be related to
+ // "fence sync must be flushed before generating sync token" GL errors.
+ context_gl_->Flush();
+ TRACE_EVENT_BEGIN0("gpu", "VRDisplay::GetSyncToken");
+ auto token = static_image->GetSyncToken();
mthiesse 2017/05/18 15:33:53 s/token/sync_token
klausw 2017/05/18 17:47:39 Done, this was a cherry-pick with a bad manual edi
+ TRACE_EVENT_END0("gpu", "VRDisplay::GetSyncToken");
+ TRACE_EVENT_BEGIN0("gpu", "VRDisplay::SubmitFrame");
+ display_->SubmitFrame(vr_frame_id_,
+ gpu::MailboxHolder(mailbox, sync_token, GL_TEXTURE_2D));
did_submit_this_frame_ = true;
RequestVSync();
+ TRACE_EVENT_END0("gpu", "VRDisplay::SubmitFrame");
// If preserveDrawingBuffer is false, must clear now. Normally this
// happens as part of compositing, but that's not active while
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698