Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

OVR submit layers to TimeWarp even frames are discarded. #2322

Closed
wants to merge 1 commit into from

Conversation

daoshengmu
Copy link
Contributor

@daoshengmu daoshengmu commented Nov 19, 2019

Fixes #2320. We will get a discard state [1] when WebVR immersive mode is stuck at the content side. That makes us can't continue to get newest controller states until calling vrapi_SubmitFrame2.

[1]

m.device->EndFrame(aDiscardFrame);

@daoshengmu daoshengmu self-assigned this Nov 19, 2019
Copy link
Contributor

@MortimerGoro MortimerGoro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The screen turns black so it breaks the timewarp. We should try to find a way to detect the exit without breaking the TimeWarp effect

@MortimerGoro
Copy link
Contributor

I've tried to reuse the last swapChain and it works but the TimeWarp is not correct either.

@daoshengmu
Copy link
Contributor Author

daoshengmu commented Nov 20, 2019

Sorry for my unclear comment. This PR is in order to resolve the problem we can’t exit the immersive mode by getting button states when we get stuck at the content side. The actual fix for this demo is supporting Gamepad haptic feedbacks (#2198).

@daoshengmu daoshengmu force-pushed the HandleDiscardImmersiveFrame branch from 4a6c650 to 61965f2 Compare November 20, 2019 17:25
@MortimerGoro
Copy link
Contributor

Yes, the problem is that it breaks the TimeWarp effect. In master if there is a long delay the user sees the last frame Timewarped, but with this change it sees a black screen.

@daoshengmu daoshengmu force-pushed the HandleDiscardImmersiveFrame branch from 61965f2 to c183b17 Compare November 20, 2019 19:20
@daoshengmu
Copy link
Contributor Author

I guess submitting layers with the previous frame index and predictedDisplayTime is what we want. After that, I can see it shows the last frame before the JS crash.

Copy link
Contributor

@MortimerGoro MortimerGoro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have created this sample for testing in Oculus Browser too: https://mortimergoro.github.io/webvr_long_pause/

We should achieve the same behaviour that Oculus Browser does:

  • The last used frame is Timewarped (is not black and it doesn't follow the head position)
  • Exit from WebVR works

@MortimerGoro
Copy link
Contributor

I found a way to get the desired behavior, PR here: #2341

@daoshengmu
Copy link
Contributor Author

The more correct fix is available at #2341 now.

@daoshengmu daoshengmu closed this Nov 21, 2019
@bluemarvin bluemarvin deleted the HandleDiscardImmersiveFrame branch March 4, 2020 22:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Getting freeze at the immersive mode in http://moonrider.xyz
2 participants