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

WebGPU native (C header/API) backend for wgpu-rs #1608

Open
kvark opened this issue Jul 6, 2021 · 5 comments
Open

WebGPU native (C header/API) backend for wgpu-rs #1608

kvark opened this issue Jul 6, 2021 · 5 comments
Labels
area: ecosystem Help the connected projects grow and prosper help required We need community help to make this happen. type: enhancement New feature or request

Comments

@kvark
Copy link
Member

kvark commented Jul 6, 2021

Is your feature request related to a problem? Please describe.
wgpu-rs currently has 2 backends: direct (for wgpu-core) and web (for WebGPU on wasm32 target).
We need to add a 3rd backend: native, for implementing https://github.com/webgpu-native/webgpu-headers

Describe the solution you'd like
Adding this backend should be straightforward. We would dynamically link with an implementation, be it wgpu-native or Dawn library.

Describe alternatives you've considered
Using the C API as the main target, and then adding a backend for wgpu-core. We irreversibly changed this direction a while ago.

Additional context
servo/pathfinder#306 (comment)

@kvark kvark added type: enhancement New feature or request help required We need community help to make this happen. area: ecosystem Help the connected projects grow and prosper labels Jul 6, 2021
@Gordon-F
Copy link
Contributor

Gordon-F commented Jul 6, 2021

Does this also meaning, that this backend would have blazing fast compile time for native targets? It should have only one dependency - libloading.

@kvark
Copy link
Member Author

kvark commented Jul 6, 2021

Yes, that's right. Given the stable C API, it should be very fast to build. As fast as the Web backend.

@Gordon-F
Copy link
Contributor

Gordon-F commented Jul 6, 2021

These might be a game-changer for users who avoid using Rust and wgpu because of compile time. Maybe miniquad users, for example, will take a look at wgpu.

@zicklag
Copy link
Contributor

zicklag commented Jul 28, 2021

Would it make sense to have like a WebGPU Rust trait that would have implementations for both web_sys and for the C API?

Then users could also bring their own WebGPU trait implementations if they wanted to do something like network rendering ( one of the use-cases mentioned in the pathfinder issue ).

@cwfitzgerald
Copy link
Member

We already basically have this. We have a unified trait in wgpu-rs that has all the appropriate backends.

I'm not entirely convinced there is good reason to make that trait fully switchable. That being said it would allow for a bunch of clever things such as wgpu plugins that work through intercepting calls to the backend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ecosystem Help the connected projects grow and prosper help required We need community help to make this happen. type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants