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 worker globals for webgpu #25532

Closed
jdm opened this issue Jan 15, 2020 · 1 comment
Closed

Support worker globals for webgpu #25532

jdm opened this issue Jan 15, 2020 · 1 comment

Comments

@jdm
Copy link
Member

@jdm jdm commented Jan 15, 2020

There are various code paths for webgpu that get a global object and downcast it to Window in order to access the Navigator object to access the gpu property. There is a WorkerNavigator that exposes the same property; we should add a helper to GlobalScope that does the right thing to avoid code having to care.

cc @imiklos

@jdm
Copy link
Member Author

@jdm jdm commented Jan 15, 2020

I guess it's a bit more complicated - there's a create_bind_group_layout_id API (and others that access the gpu_id_hub) on Navigator which we need to support for workers as well.

@imiklos imiklos mentioned this issue Jan 23, 2020
3 of 3 tasks complete
bors-servo added a commit that referenced this issue Jan 23, 2020
Support worker for WebGPU

To create resource ids for the WebGPU we need to access the `IdentityHub`.
In order to access the `IdentityHub` from a `Window` or a `Worker` as well, I've moved the `IdentityHub` to the `GlobalScope` from the `Navigator`.

<!-- Please describe your changes on the following line: -->
---
<!-- 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 #25532

cc @kvark @jdm @zakorgy
bors-servo added a commit that referenced this issue Jan 23, 2020
Support worker for WebGPU

To create resource ids for the WebGPU we need to access the `IdentityHub`.
In order to access the `IdentityHub` from a `Window` or a `Worker` as well, I've moved the `IdentityHub` to the `GlobalScope` from the `Navigator`.

<!-- Please describe your changes on the following line: -->
---
<!-- 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 #25532

cc @kvark @jdm @zakorgy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

1 participant
You can’t perform that action at this time.