-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Implement recreate_context for WebGPU canvas and fix handle_wgpu_msg crash #30386
base: main
Are you sure you want to change the base?
Conversation
If those tests use iframes to trigger media query changes, note that all iframe media query tests are incredibly flaky and brittle because of Servo's loose implementation of iframe loading order. |
When based on #30406 there is no error on wgpu examples. But when refreshed examples do not work (also non-ui wgpu examples), maybe that's has something to do with wasm loading as pure JS examples work normally on refresh too. |
This comment was marked as resolved.
This comment was marked as resolved.
Resize canvas example from webgpu-samples still crash, but that is not problem with |
canvas: HTMLCanvasElementOrOffscreenCanvas, | ||
#[ignore_malloc_size_of = "manual writing is hard"] | ||
/// <https://gpuweb.github.io/gpuweb/#dom-gpucanvascontext-configuration-slot> | ||
config: RefCell<Option<GPUCanvasConfiguration>>, |
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.
Is the configuration ever read other than to know whether to reconfigure the context? Why not just store a bool?
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.
It's only for reconfigure AFAIK.
if let Some(config) = self.config.take() { | ||
self.Configure(&config) | ||
} |
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.
Why isn't the call Unconfigure()
here instead of in Configure()
?
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.
That's how it was done in mozilla, but I will recheck specs tomorrow.
I will need to rethink this, so I spitted off crash fix. |
This makes wgpu examples work.
Depends on #30406. DONECurrent state of webgpu examples
Works on reload:
Does not work on reload (but works on freshly opened servo; see #30417):
./mach build -d
does not report any errors./mach test-tidy
does not report any errors