Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for webxr layer management #26927

Merged
merged 1 commit into from Jun 28, 2020

Conversation

@asajeffrey
Copy link
Member

asajeffrey commented Jun 15, 2020

This adds layer management to servo's webxr implementation, and removes all the special-cased code for openxr surface creation and opaque framebuffers.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes do not require tests because it's all back-end plumbing
@highfive
Copy link

highfive commented Jun 15, 2020

Heads up! This PR modifies the following files:

  • @KiChjang: components/script/dom/xrrenderstate.rs, components/script/dom/webglframebuffer.rs, components/script/dom/document.rs, components/script/dom/xrwebglsubimage.rs, components/script/dom/xrwebglbinding.rs and 9 more
@highfive
Copy link

highfive commented Jun 15, 2020

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
  • These commits modify script code, but no tests are modified. Please consider adding a test!
@asajeffrey
Copy link
Member Author

asajeffrey commented Jun 15, 2020

Note: this is still a draft because it depends on servo/webxr#176

@bors-servo
Copy link
Contributor

bors-servo commented Jun 15, 2020

The latest upstream changes (presumably #26872) made this pull request unmergeable. Please resolve the merge conflicts.

@asajeffrey asajeffrey force-pushed the asajeffrey:webxr-layer-management branch from 6a9cf2c to 703be0a Jun 23, 2020
@nox
Copy link
Member

nox commented Jun 25, 2020

@highfive highfive assigned Manishearth and unassigned nox Jun 25, 2020
@asajeffrey asajeffrey force-pushed the asajeffrey:webxr-layer-management branch from 94ae012 to f9bbb5f Jun 26, 2020
Copy link
Member

Manishearth left a comment

Script side seems okay, i'm not so clear on the webgl side though

@asajeffrey asajeffrey force-pushed the asajeffrey:webxr-layer-management branch from f9bbb5f to 9e0ea13 Jun 27, 2020
@asajeffrey asajeffrey marked this pull request as ready for review Jun 27, 2020
@asajeffrey asajeffrey force-pushed the asajeffrey:webxr-layer-management branch from 9e0ea13 to 947b53a Jun 27, 2020
@bors-servo
Copy link
Contributor

bors-servo commented Jun 27, 2020

📌 Commit 947b53a has been approved by Manishearth

@bors-servo
Copy link
Contributor

bors-servo commented Jun 27, 2020

Testing commit 947b53a with merge 012630b...

bors-servo added a commit that referenced this pull request Jun 27, 2020
Support for webxr layer management

<!-- Please describe your changes on the following line: -->

This adds layer management to servo's webxr implementation, and removes all the special-cased code for openxr surface creation and opaque framebuffers.

---
<!-- 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 all back-end plumbing

<!-- 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. -->
@bors-servo
Copy link
Contributor

bors-servo commented Jun 27, 2020

💔 Test failed - status-taskcluster

@asajeffrey
Copy link
Member Author

asajeffrey commented Jun 27, 2020

Hmm, so the windows failure is #26895 but the macOS failures look like genuine errors with WebGL in WebXR, e.g. https://community-tc.services.mozilla.com/tasks/bIxuL7ubTYS69siWmOpkmQ/runs/0/logs/https%3A%2F%2Fcommunity-tc.services.mozilla.com%2Fapi%2Fqueue%2Fv1%2Ftask%2FbIxuL7ubTYS69siWmOpkmQ%2Fruns%2F0%2Fartifacts%2Fpublic%2Ffiltered-wpt-errorsummary.log is

  ▶ CRASH [expected ERROR] /webxr/gamepads-module/xrInputSource_gamepad_input_registered.https.html
  │ 
  │ _RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
  │ [2020-06-27T16:48:41Z ERROR canvas::webgl_thread] Last GL operation failed: BindTexture(3553, Some(WebGLTextureId(3)))
  │ Unexpected WebGL error: 0x502 (1282) [BindTexture(3553, Some(WebGLTextureId(3)))] (thread WebGL thread, at components/canvas/webgl_thread.rs:2229)
  │    0: <servo::backtrace::Print as core::fmt::Debug>::fmt
  │    1: core::fmt::write
  │    2: std::io::Write::write_fmt
  │    3: servo::backtrace::print
  │    4: servo::main::{{closure}}
  │    5: std::panicking::rust_panic_with_hook
  │    6: _rust_begin_unwind
  │    7: std::panicking::begin_panic_fmt
  │    8: canvas::webgl_thread::WebGLImpl::apply
  │    9: canvas::webgl_thread::WebGLThread::handle_msg
  │   10: canvas::webgl_thread::WebGLThread::process
  │   11: std::sys_common::backtrace::__rust_begin_short_backtrace
  │   12: core::ops::function::FnOnce::call_once{{vtable.shim}}
  │   13: std::sys::unix::thread::Thread::new::thread_start
  │   14: __pthread_body
  │   15: __pthread_start
@asajeffrey
Copy link
Member Author

asajeffrey commented Jun 27, 2020

Running that test 100 times on linux it doesn't fail, so it is a macOS-specific issue. Sigh.

@asajeffrey
Copy link
Member Author

asajeffrey commented Jun 27, 2020

Hmm, another macOS WebGL error...

 ▶ CRASH [expected OK] /webxr/xrWebGLLayer_framebuffer_draw.https.html
  │ 
  │ _RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
  │ [2020-06-27T21:42:09Z ERROR canvas::webgl_thread] Last GL operation failed: Clear(16384)
  │ Unexpected WebGL error: 0x506 (1286) [Clear(16384)] (thread WebGL thread, at components/canvas/webgl_thread.rs:2229)
  │    0: <servo::backtrace::Print as core::fmt::Debug>::fmt
  │    1: core::fmt::write
  │    2: std::io::Write::write_fmt
  │    3: servo::backtrace::print
  │    4: servo::main::{{closure}}
  │    5: std::panicking::rust_panic_with_hook
  │    6: _rust_begin_unwind
  │    7: std::panicking::begin_panic_fmt
  │    8: canvas::webgl_thread::WebGLImpl::apply
  │    9: canvas::webgl_thread::WebGLThread::handle_msg
  │   10: canvas::webgl_thread::WebGLThread::process
  │   11: std::sys_common::backtrace::__rust_begin_short_backtrace
  │   12: core::ops::function::FnOnce::call_once{{vtable.shim}}
  │   13: std::sys::unix::thread::Thread::new::thread_start
  │   14: __pthread_body
  │   15: __pthread_start
@asajeffrey asajeffrey force-pushed the asajeffrey:webxr-layer-management branch from f01caf1 to 904f94d Jun 28, 2020
@asajeffrey
Copy link
Member Author

asajeffrey commented Jun 28, 2020

So that one was caused by WebGL not supporting TEXTURE_RECTANGLE so we need to do bind the texture to the opaque framebuffer without error checking.

@bors-servo r=Manishearth

@bors-servo
Copy link
Contributor

bors-servo commented Jun 28, 2020

📌 Commit 904f94d has been approved by Manishearth

@bors-servo
Copy link
Contributor

bors-servo commented Jun 28, 2020

Testing commit 904f94d with merge 9d52d7a...

bors-servo added a commit that referenced this pull request Jun 28, 2020
Support for webxr layer management

<!-- Please describe your changes on the following line: -->

This adds layer management to servo's webxr implementation, and removes all the special-cased code for openxr surface creation and opaque framebuffers.

---
<!-- 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 all back-end plumbing

<!-- 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. -->
@bors-servo
Copy link
Contributor

bors-servo commented Jun 28, 2020

💔 Test failed - status-taskcluster

@jdm
Copy link
Member

jdm commented Jun 28, 2020

Looks like it's just missing a mach fmt now; the reftests failures are just #23290.

@asajeffrey asajeffrey force-pushed the asajeffrey:webxr-layer-management branch from 904f94d to 349619e Jun 28, 2020
@asajeffrey
Copy link
Member Author

asajeffrey commented Jun 28, 2020

Ran mach fmt. @bors-servo r=Manishearth

@bors-servo
Copy link
Contributor

bors-servo commented Jun 28, 2020

📌 Commit 349619e has been approved by Manishearth

@bors-servo
Copy link
Contributor

bors-servo commented Jun 28, 2020

Testing commit 349619e with merge 345238a...

@bors-servo
Copy link
Contributor

bors-servo commented Jun 28, 2020

☀️ Test successful - status-taskcluster
Approved by: Manishearth
Pushing 345238a to master...

@bors-servo bors-servo merged commit 345238a into servo:master Jun 28, 2020
2 checks passed
2 checks passed
Community-TC (pull_request) TaskGroup: success
Details
homu Test successful
Details
@thtrummer

This comment has been minimized.

Are all the Cargo.toml files / symlinks on purpose?

This comment has been minimized.

Copy link
Member Author

asajeffrey replied Jul 17, 2020

Oops, this should be fixed by #27370.

This comment has been minimized.

Copy link

thtrummer replied Jul 18, 2020

Thanks! Now Git on Windows is happy again... :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

7 participants
You can’t perform that action at this time.