-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
compositing: Allow WebGL contexts to have different Surfman devices #40721
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
Conversation
Currently, a single `surfman::Device` is used for all WebGL contexts. This cannot work when we have multiple rendering contexts. So, extract the surfman `Connection` and `Adapter` into a per-painter data structure (`PainterSurfmanDetailsMap`) and store the `Device` directly in the WebGL context. This patch also modifies the WebXR traits so that the `Device` doesn't need to be explictly passed into most methods. Testing: Should be covered by existing tests. --------- Signed-off-by: Mukilan Thiyagarajan <[email protected]> Co-authored-by: Martin Robinson <[email protected]>
- Do not remove WebGL contexts from the context map before cleaning up the WebXR layers. The layer cleanup process consults the map. - When cleanup up layers, be sure to replace the WebXRBridge in the WebGLThread data structure. - Allow failing to the Device when processing WebXR commands. WebXR sometimes tries to access contexts after they have been removed. Signed-off-by: Martin Robinson <[email protected]>
|
🔨 Triggering try run (#19472012056) for Linux (WPT) |
|
|
Test results for linux-wpt from try job (#19472012056): Flaky unexpected result (35)
Stable unexpected results that are known to be intermittent (29)
|
|
✨ Try run (#19472012056) succeeded. |
mukilan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
| bound_context_id: &mut self.bound_context_id, | ||
| // Take `webxr_bridge` from the `WebGLThread` in order to avoid a double mutable borrow. | ||
| let Some(mut webxr_bridge) = self.webxr_bridge.take() else { | ||
| return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can add a warn statement here to detect similar issues in the future where the bridge is not restored correctly but we continue to receive commands.
Currently, a single
surfman::Deviceis used for all WebGL contexts.This cannot work when we have multiple rendering contexts. So, extract
the surfman
ConnectionandAdapterinto a per-painter data structure(
PainterSurfmanDetailsMap) and store theDevicedirectly in theWebGL context.
This patch also modifies the WebXR traits so that the
Devicedoesn'tneed to be explictly passed into most methods.
This is a reland of #40594 with the following changes:
WebXR layers. The layer cleanup process consults the map.
WebGLThread data structure.
sometimes tries to access contexts after they have been removed.
Testing: Should be covered by existing tests.