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

Enable webgpu support #297

Closed
lukexor opened this issue Jun 14, 2024 · 0 comments
Closed

Enable webgpu support #297

lukexor opened this issue Jun 14, 2024 · 0 comments
Labels
enhancement New feature or request web Web platform related

Comments

@lukexor
Copy link
Owner

lukexor commented Jun 14, 2024

WebGPU is a new standard coming to browsers, and the primary reason for switching to using wgpu as it's more performant than WebGL and aligns with modern graphics APIs. Firefox is behind in supporting it and stability is still a bit shaky across platforms.

Enabling it is super simply:

  • Add the webgpu feature flag to wgpu in tetanes/Cargo.toml
  • Change Renderer::create_painter back to using the default wgpu::Backends

An attempt was made to have this enabled previously, but some issues were encountered when trying to load in Chrome on Linux. Worth another go and seeing how it performs across different platforms.

One possible solution if there are still issues is to try and catch any errors creating the Painter when using the BROWSER_WEBGPU backend, and trying to fallback to GL, similar to how it's currently falling back if the default adapter limits aren't supported on the platform.

See: https://developer.mozilla.org/en-US/docs/Web/API/WebGPU_API#browser_compatibility

@lukexor lukexor added enhancement New feature or request web Web platform related labels Jun 14, 2024
@lukexor lukexor mentioned this issue Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request web Web platform related
Projects
None yet
Development

No branches or pull requests

1 participant