diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2019-02-27 02:20:30 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-27 02:20:30 -0500 |
commit | ec7a5f21c85d539cc8de58ea702ce5f8ffda0949 (patch) | |
tree | 4c14278f1b5ffecbf2d5fc70c33a236f3af8784f /components/webvr/webvr_thread.rs | |
parent | be3ecc5dc1105c4c02fb5d8f9b33426871c10d06 (diff) | |
parent | c9087013b1bce87302ff49de9c2753262008c59b (diff) | |
download | servo-ec7a5f21c85d539cc8de58ea702ce5f8ffda0949.tar.gz servo-ec7a5f21c85d539cc8de58ea702ce5f8ffda0949.zip |
Auto merge of #22938 - asajeffrey:webvr-future-frame-data, r=paulrouget
Use webvr future_frame_data to avoid blocking the WebGL thread
<!-- Please describe your changes on the following line: -->
This PR fixes a potential deadlock caused by the WebGL thread being blocked on a VR device. Rather than blocking on the VR device, it forwards a future to the script thread, and then then script thread blocks.
---
<!-- 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 do not require tests because it's fixing a potential deadlock
<!-- 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/22938)
<!-- Reviewable:end -->
Diffstat (limited to 'components/webvr/webvr_thread.rs')
-rw-r--r-- | components/webvr/webvr_thread.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/components/webvr/webvr_thread.rs b/components/webvr/webvr_thread.rs index 2d55fa8deac..4ce25bccb50 100644 --- a/components/webvr/webvr_thread.rs +++ b/components/webvr/webvr_thread.rs @@ -385,11 +385,8 @@ impl webgl::WebVRRenderHandler for WebVRCompositorHandler { }, webgl::WebVRCommand::SyncPoses(compositor_id, near, far, sender) => { if let Some(compositor) = self.compositors.get(&compositor_id) { - let pose = unsafe { - (*compositor.0).sync_poses(); - (*compositor.0).synced_frame_data(near, far).to_bytes() - }; - let _ = sender.send(Ok(pose.into())); + let pose = unsafe { (*compositor.0).future_frame_data(near, far) }; + let _ = sender.send(Ok(pose)); } else { let _ = sender.send(Err(())); } |