Currently each call to xrSession.requestAnimationFrame() results in a new frame request to the underlying device. This is fine if only one rAF callback is added within a single frame, but if more than one is added then this causes problems, such as poor frame rate and artifacts due to vrDisplay.submitFrame() being called more than once a frame.
The solution here is to maintain a single rAF to the underlying device, and have multiple session.rAFs just add to an array of callbacks that are flushed in the single device rAF. That's also basically what's described in the XR Animation Frame algorithm in the spec.
Currently each call to
xrSession.requestAnimationFrame()
results in a new frame request to the underlying device. This is fine if only one rAF callback is added within a single frame, but if more than one is added then this causes problems, such as poor frame rate and artifacts due tovrDisplay.submitFrame()
being called more than once a frame.The solution here is to maintain a single rAF to the underlying device, and have multiple
session.rAF
s just add to an array of callbacks that are flushed in the single device rAF. That's also basically what's described in the XR Animation Frame algorithm in the spec.