Fix WebVR VSync scheduling heuristic
The heuristic wasn't working right due to using the wrong frame as timing reference, resulting in overthrottling for fast applications and excessive latency for slow applications. When estimating the render time for a frame that was already complete at the time of check, it uses the time-until-copied as a lower bound, but accidentally used the copy time of the currently processing frame as opposed to the copy time of the previous rendering frame, resulting in overestimating the render time. Also, the heuristic to decide when to skip VSync also should have used the currently rendering frame (two frames back when sending a new animating frame), but was erroneously using the currently processing frame (one frame back). Fix this, and adjust the heuristic to more accurately reflect the intended scheduling. Bug: 827811 Change-Id: Ic4884ccaee6f2f6d3051ce2790132582dba6702a Reviewed-on: https://chromium-review.googlesource.com/989431 Commit-Queue: Ian Vollick <vollick@chromium.org> Reviewed-by:Ian Vollick <vollick@chromium.org> Cr-Commit-Position: refs/heads/master@{#547398}
Showing
Please register or sign in to comment