New issue
Advanced search Search tips

Issue 690106 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug
Proj-XR

Blocked on:
issue 691102

Blocking:
issue 655733


Show other hotlists

Hotlists containing this issue:
Hotlist-1


Sign in to add a comment

non-virtualized WebGL contexts cause screen tearing / out of sync WebVR frames

Project Member Reported by klausw@chromium.org, Feb 8 2017

Issue description

Chrome Version: 57.0.2978.0 + patches
OS: Android

What steps will reproduce the problem?
(1) Run custom patched build: 02323a21ecbf43a0a55146eb2dd4dbc96b55f41a + https://codereview.chromium.org/2586803003 on a Pixel phone
(2) Open https://webvr.info/samples/03-vr-presentation.html
(3) Enter WebVR using a Daydream headset

What is the expected result?

(Reasonably) smooth frames

What happens instead?

Very unpleasant view due to frames arriving out of order or with visible tearing.


This issue was discovered as part of a patch series which attempted to accelerate WebVR rendering by enabling directly rendering WebGL content to an Android Surface to bypass extra texture copies. As part of this, it needed WebGL contexts to use their own GL surface, patch https://codereview.chromium.org/2586803003 implemented this. This required disabling virtualized contexts since those require all contexts to use the same surface.

Currently Qualcomm GPUs enable virtualized contexts as a workaround for out-of-order frames:

https://codereview.chromium.org/2586803003/#msg44

     "cr_bugs": [289461],      "description": "Non-virtual contexts on
Qualcomm sometimes cause out-of-order frames",      "os": {
"type": "android"      },      "gl_vendor": "Qualcomm.*",
"features": [        "use_virtualized_gl_contexts"      ]
I'll add some extra debugging to confirm.

Looks like  issue 289461  was a somewhat speculative fix from 2013, and it's unclear if the actual cause was a driver bug and that it's still applicable. For example, in the similar mailbox manager sync issue 554268, the underlying issue seemed to be misuse of fence objects. See  issue 510243  for context.


 
Quoting issue 554268:

MailboxManagerSync (ie android webview) currently forces on virtualized context so avoid synchronization bug. Currently TextureUpdate texture may happen in any context in a share group, but egl fence only guarantees ordering of the context it is created in. See CL description here for a concrete example:
https://chromium.googlesource.com/chromium/src.git/+/f0f36b3182af0fee8595253a2b94e19a48686f2b

Idea was to track which context modified a texture, and update textures modified in current context.

[end quote]

Consider replacing the EGL fence with a cross-context synchronization mechanism? Would EGL_ANDROID_native_fence_sync work for this purpose?

https://www.khronos.org/registry/EGL/extensions/ANDROID/EGL_ANDROID_native_fence_sync.txt
https://linuxplumbersconf.org/2014/ocw/system/presentations/2355/original/03%20-%20sync%20&%20dma-fence.pdf

See also  issue 278606  "Testing EGL sync fences is broken on Qualcomm" for related work. Add a new type to https://cs.chromium.org/chromium/src/ui/gl/gl_fence.cc ?

Labels: -Pri-3 Proj-VR Pri-2
Status: Assigned (was: Untriaged)

Comment 4 by klausw@chromium.org, Feb 11 2017

Blockedon: 691102
Components: Blink>WebXR
Removing Blink>WebVR component and assigning to Blink>WebXR 
Components: -Blink>WebVR

Sign in to add a comment