Repository navigation
Use a test VRDisplay that renders to a GL window - #22953
Conversation
|
Heads up! This PR modifies the following files:
|
|
r? @paulrouget |
| if self.window.get_animation_state() == windowing::AnimationState::Animating { | ||
| self.composite_if_necessary(CompositingReason::Animation); | ||
| } | ||
|
|
There was a problem hiding this comment.
Maybe skip this change, and call hearbeat in perform_updates? perform_updates is the "heartbeart" of the compositor.
There was a problem hiding this comment.
The reason for doing this is that the main GL window is the one with vsync enabled, so the VR heartbeat needs to be called immediately after swapping the main window buffers. Hence having composite_specific_target calling the hearbeats between self.window.present() (which swaps the main window buffers) and self.process_animations(). If we want to prioritize the VR heartbeats over the main page's animations (which I think we do) then the heartbeats need to be in composite_specific_target.
There was a problem hiding this comment.
Right, I agree about doing the work after the vsync-swap-buffer.
But I'm not sure why process_animations is something we should care about? Isn't just a tick sent to the constellation?
This is the current tasks performed by Servo:
- WR render
- swap buffer (blocking, vsync)
- tick animations
We are adding:
- VR heartbeat
- VR swap buffer (which is part of heartbeat)
You're suggesting:
- WR render
- Servo swap_buffer (blocking, vsync)
- VR heartbeat
- VR swap
- Servo tick animations
Is that right?
Would it be basically equivalent to:
- WR render
- Servo Swap_buffer (blocking, vsync)
- Servo tick animations
- VR heartbeat
- VR swap
If so, we can move the call to heartbeat at the end of perform_updates.
But it would be better to move the heartbeat work before the blocking swap_buffer;
- VR heartbeat
- WR render
- Servo Swap_buffer (blocking, vsync)
- VR swap
- Servo tick animations
But that would require extracting the swap_buffer call from VR heartbeat.
Does it make sense?
There was a problem hiding this comment.
Hmm, I see what you mean, process_animations() isn't doing that much (a bunch of hash table lookups and channel sends) so we can probably afford to run it before the heartbeat.
Not sure why extracting the VR swap buffer from the VR heartbeat would help, moving the heartbeat into perform_updates would simplify things though.
| /// run the event loop at the vsync interval. | ||
| fn set_animation_state(&self, _state: AnimationState); | ||
| /// Get the animation state | ||
| fn get_animation_state(&self) -> AnimationState; |
There was a problem hiding this comment.
I don't think this should be needed. The compositor doesn't need to know the animation state. See previous comment.
There was a problem hiding this comment.
If we move the heartbeat call, I think we can drop this.
asajeffrey
left a comment
There was a problem hiding this comment.
I thiiiiiink we need the hearbeats to be called when compositing, to get the vsync right.
| if self.window.get_animation_state() == windowing::AnimationState::Animating { | ||
| self.composite_if_necessary(CompositingReason::Animation); | ||
| } | ||
|
|
There was a problem hiding this comment.
The reason for doing this is that the main GL window is the one with vsync enabled, so the VR heartbeat needs to be called immediately after swapping the main window buffers. Hence having composite_specific_target calling the hearbeats between self.window.present() (which swaps the main window buffers) and self.process_animations(). If we want to prioritize the VR heartbeats over the main page's animations (which I think we do) then the heartbeats need to be in composite_specific_target.
|
@paulrouget OK, I moved the heartbeat calls and got rid of |
|
r=me with Cargo.toml updated. |
a6651ac to
eec3e8c
Compare
|
@bors-servo r=paulrouget |
|
📌 Commit eec3e8c has been approved by |
Use a test VRDisplay that renders to a GL window <!-- Please describe your changes on the following line: --> Add a `dom.webvr.test` pref that registers a new VR display, which registers to a GL window. The matching webvr PR is servo/rust-webvr#66. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #22795 - [X] These changes do not require tests because we need a followup PR to support reftests which use the VR display <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22953) <!-- Reviewable:end -->
|
💔 Test failed - magicleap |
|
Oh how ironic, it's the magicleap build that is broken... |
eec3e8c to
6ee951a
Compare
|
@bors-servo r=paulrouget |
|
📌 Commit 6ee951a has been approved by |
Use a test VRDisplay that renders to a GL window <!-- Please describe your changes on the following line: --> Add a `dom.webvr.test` pref that registers a new VR display, which registers to a GL window. The matching webvr PR is servo/rust-webvr#66. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #22795 - [X] These changes do not require tests because we need a followup PR to support reftests which use the VR display <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22953) <!-- Reviewable:end -->
|
💔 Test failed - status-taskcluster |
6ee951a to
cc2d203
Compare
|
Sigh, test-tidy. @bors-servo r=paulrouget |
|
📌 Commit cc2d203 has been approved by |
Use a test VRDisplay that renders to a GL window <!-- Please describe your changes on the following line: --> Add a `dom.webvr.test` pref that registers a new VR display, which registers to a GL window. The matching webvr PR is servo/rust-webvr#66. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #22795 - [X] These changes do not require tests because we need a followup PR to support reftests which use the VR display <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22953) <!-- Reviewable:end -->
|
💔 Test failed - linux-rel-css |
|
@bors-servo retry |
Use a test VRDisplay that renders to a GL window <!-- Please describe your changes on the following line: --> Add a `dom.webvr.test` pref that registers a new VR display, which registers to a GL window. The matching webvr PR is servo/rust-webvr#66. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #22795 - [X] These changes do not require tests because we need a followup PR to support reftests which use the VR display <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22953) <!-- Reviewable:end -->
|
☀️ Test successful - android-mac, arm32, arm64, linux-rel-css, linux-rel-wpt, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, magicleap, status-taskcluster |
Add a
dom.webvr.testpref that registers a new VR display, which registers to a GL window.The matching webvr PR is servo/rust-webvr#66.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is