New issue
Advanced search Search tips

Issue 726026 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Feature
Proj-XR



Sign in to add a comment

Support wait-with-timeout for GLFenceEGL

Project Member Reported by klausw@chromium.org, May 24 2017

Issue description

Currently, GLFenceEGL's ClientWait always uses EGL_FOREVER_KHR. It would be nice to be able to specify a timeout here, for example so that a thread can yield to do other work while waiting. The current workaround is to repeatedly poll checking for completion, but that needs a very aggressive timeout to avoid unnecessary delay.

(This is being used in the critical path for WebVR rendering, and even a 1ms delay noticeably cuts into the 16ms frame time budget.)

I have a patch for this I'm planning to send out for review, for now I'm using this bug as a TODO marker in the code location where it's polling for completion.

Code location: https://cs.chromium.org/chromium/src/ui/gl/gl_fence_egl.cc

 

Comment 1 by piman@chromium.org, May 24 2017

Labels: -Type-Bug Type-Feature
Owner: klausw@chromium.org
Status: Started (was: Untriaged)
Labels: -M-60 M-61
klausw: Do you still have that patch? Is this needed for M61?

Comment 4 by klausw@chromium.org, Jul 15 2017

Patch is in https://chromium-review.googlesource.com/c/572663/ .

It would be good to have, though I haven't done timing measurements to see how much of a difference it makes. In theory it should save on average 0.125ms per frame and reduce CPU overhead, and I think it may help avoid timing outliers due to poor scheduling.
Project Member

Comment 5 by bugdroid1@chromium.org, Jul 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e42561bd89deda111978718c68746e1ee5bbf7d3

commit e42561bd89deda111978718c68746e1ee5bbf7d3
Author: Klaus Weidner <klausw@chromium.org>
Date: Mon Jul 17 18:11:34 2017

Add ClientWaitWithTimeout to GLFenceEGL, use for WebVR

Currently, GLFenceEGL's ClientWait always uses EGL_FOREVER_KHR. This change
adds a way to specify a timeout so that a thread can yield to do other work
while waiting.

This is being used in the critical path for WebVR rendering, and even a 1ms
delay noticeably cuts into the 16ms frame time budget. The workaround was to
repeatedly poll checking for completion, but that needs a very aggressive
timeout to avoid unnecessary delay. Using a timeout is more efficient.

Bug:  726026 
Change-Id: I4c4292f31cf472e538cfdf18a835d48226d6ac58
Reviewed-on: https://chromium-review.googlesource.com/572663
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Michael Thiessen <mthiesse@chromium.org>
Commit-Queue: Klaus Weidner <klausw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487159}
[modify] https://crrev.com/e42561bd89deda111978718c68746e1ee5bbf7d3/chrome/browser/android/vr_shell/vr_shell_gl.cc
[modify] https://crrev.com/e42561bd89deda111978718c68746e1ee5bbf7d3/chrome/browser/android/vr_shell/vr_shell_gl.h
[modify] https://crrev.com/e42561bd89deda111978718c68746e1ee5bbf7d3/ui/gl/gl_fence_egl.cc
[modify] https://crrev.com/e42561bd89deda111978718c68746e1ee5bbf7d3/ui/gl/gl_fence_egl.h

Comment 6 by klausw@chromium.org, Jul 17 2017

Status: Fixed (was: Started)
Components: Blink>WebXR

Sign in to add a comment