tauri-apps / tauri

Build smaller, faster, and more secure desktop applications with a web frontend.
https://tauri.app
Apache License 2.0
81.93k stars 2.46k forks source link

WebGPU support? #6381

Closed DolphinIQ closed 1 year ago

DolphinIQ commented 1 year ago

Describe the problem

Hello, I love this project!

WebGPU is a new graphics API for complex rendering and compute, using hardware acceleration. Use cases include demanding 3D games and acceleration of scientific calculations. It is meant to supersede WebGL and allows developers to create more advanced applications thanks to new optimizations and features (for example Compute Shaders, which are not available in WebGL2).

Does Tauri allow enabling WebGPU support? According to https://github.com/MicrosoftEdge/WebView2Feedback/issues/2233 WebView2 WebGPU support on Windows is up to date, but I was unable to find any information about how to enable it on a Tauri window/project.

I come from WebGL browser world and WebGPU is currently only accessible through flags. Theoretically I shouldn't have to worry about experimental features, since my app will be running my safe code only. I would love to be able to build next gen desktop graphics applications with Tauri & WebGPU.

Describe the solution you'd like

I would like to be able to enable experimental features, such as WebGPU. One option would be to allow the user to pass in flags like "enable-unsafe-webgpu".

Alternatives considered

No response

Additional context

No response

FabianLars commented 1 year ago

The webgpu flag is only available in the non-stable webview2 channels which we currently have no plans to support (the webview bindings crate doesn't support them either fwiw). Once it is also available in the stable channel you could use the api introduced here https://github.com/tauri-apps/tauri/pull/5799 (will be part of 1.3) to set the flag.

Note that this would still be Windows-only. The Linux and macOS webviews have no setting to enable flags like these.

FabianLars commented 1 year ago

stop, wait! i was wrong, gimme a second 🤣

Edit: Yeah sorry, if you inject --enable-unsafe-webgpu via the above mentioned additionalBrowserArgs config it works in the stable channel too: grafik

Still, this is windows only!

DolphinIQ commented 1 year ago

Thank you @FabianLars for a great quick answer! That is awesome. Do we know when is Tauri 1.3 coming?

FabianLars commented 1 year ago

relatively soon-ish. It's currently in an internal audit, no idea how far that progressed already. My guess would be sometime this month (prob soon after Lucas returns from his vacation 😅 )

nothingismagick commented 1 year ago

Would be really great to document this addition.

AathifMahir commented 1 year ago

Awesome work!

Will be looking to contribute Tauri on Windows Side Pretty soon, Haven't had a chance to look through the source code will look into it in my spare time and let's see how we can improve Tauri on Windows.

nischalj10 commented 2 months ago

any plans yet of mac/ linux support?

FabianLars commented 2 months ago

We have no control over that (as long as we're "stuck" with the OS webviews). Safari added it to their TP version in December so i would expect that it's not that far off. No idea about Linux though.

xpluscal commented 1 week ago

Heyhey, any updates on this topic?