@@ -1422,10 +1422,12 @@ BrowserWorld::TickImmersive() {
1422
1422
m.device ->SetRenderMode (device::RenderMode::Immersive);
1423
1423
1424
1424
const bool supportsFrameAhead = m.device ->SupportsFramePrediction (DeviceDelegate::FramePrediction::ONE_FRAME_AHEAD);
1425
+ auto framePrediction = DeviceDelegate::FramePrediction::ONE_FRAME_AHEAD;
1425
1426
VRB_GL_CHECK (glDepthMask (GL_FALSE));
1426
1427
if (!supportsFrameAhead || (m.externalVR ->GetVRState () != ExternalVR::VRState::Rendering)) {
1427
1428
// Do not use one frame ahead prediction if not supported or we are rendering the spinner.
1428
- m.device ->StartFrame (DeviceDelegate::FramePrediction::NO_FRAME_AHEAD);
1429
+ framePrediction = DeviceDelegate::FramePrediction::NO_FRAME_AHEAD;
1430
+ m.device ->StartFrame (framePrediction);
1429
1431
m.externalVR ->PushFramePoses (m.device ->GetHeadTransform (), m.controllers ->GetControllers (),
1430
1432
m.context ->GetTimestamp ());
1431
1433
}
@@ -1435,15 +1437,15 @@ BrowserWorld::TickImmersive() {
1435
1437
m.externalVR ->GetFrameResult (surfaceHandle, textureWidth, textureHeight, leftEye, rightEye);
1436
1438
ExternalVR::VRState state = m.externalVR ->GetVRState ();
1437
1439
if (supportsFrameAhead) {
1438
- if (m. externalVR -> WasFirstPresentingFrame () ) {
1440
+ if (framePrediction != DeviceDelegate::FramePrediction::ONE_FRAME_AHEAD ) {
1439
1441
// StartFrame() has been already called to render the spinner, do not call it again.
1440
1442
// Instead, repeat the XR frame and render the spinner while we transition
1441
1443
// to one frame ahead prediction.
1442
1444
state = ExternalVR::VRState::Loading;
1443
1445
} else {
1444
1446
// Predict poses for one frame ahead and push the data to shmem so Gecko
1445
1447
// can start the next XR RAF ASAP.
1446
- m.device ->StartFrame (DeviceDelegate::FramePrediction::ONE_FRAME_AHEAD );
1448
+ m.device ->StartFrame (framePrediction );
1447
1449
}
1448
1450
m.externalVR ->PushFramePoses (m.device ->GetHeadTransform (), m.controllers ->GetControllers (),
1449
1451
m.context ->GetTimestamp ());
0 commit comments