Skip to content

Expose WebGPU in Lime #1940

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

Open
Fancy2209 opened this issue Apr 9, 2025 · 0 comments
Open

Expose WebGPU in Lime #1940

Fancy2209 opened this issue Apr 9, 2025 · 0 comments

Comments

@Fancy2209
Copy link

Fancy2209 commented Apr 9, 2025

In a way a follow up issue to #754 I guess?
Opened this for discussion and tracking, as I feel this should be discussed

People have been asking for a modern Graphics API, WebGPU will allow for this more easily than other options because:

  • Doesn't depend on one specific Windowing library (like SDL GPU only working with SDL3 even tho we still have some SDL2 only targets like WinRT and I guess )
  • Works on Browsers without worrying about it only working on WASM, and works on native trough either Dawn and WGPU-Native that abstract over Vulkan, Metal and D3D12
  • Works on Android, iOS, Windows, Linux, macOS and HTML5, and we could probably find a way to get it working trough offscreen

My current plan is to use wgpu-native instead of Dawn because:

  1. Easier to integrate
  2. It isn't made by Google
  3. It has been battle tested, WGPU is used in Firefox, Servo, Deno and Ruffle

WebGPU will provide some issues though:

  • Context3D is pretty much made for OpenGL, I have no idea if we can realistically implement it well with WebGPU
  • WGPU-Native has support for taking in GLSL, WGSL and SPIR-V, WebGPU on JS only takes WGSL, so I may need to find a way to compile Naga as a WASM library and expose it to JS for GLSL. Naga (WebGPU Shader Compiler) also can only take GLSL 4.4 in, not sure if that'll be an issue
  • WebGPU is on a very breaking period

First step will be exposing WebGPU on lime by adding a WebGPU rendering context for Web and Native, there has been some work on this, as @dimensionscape has been working on a bindings generator based on the yml the WebGPU C Headers are made from.

@Fancy2209 Fancy2209 changed the title Expose WebGPU Expose WebGPU in Lime Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant