Looking for a prebuilt canvaskit for webgpu. I tried to build it from source but failed

59 views
Skip to first unread message

Miguel Camba

unread,
May 29, 2026, 12:06:41 PMMay 29
to skia-discuss
Hi all,

 I'm trying to evaluate Skia/Graphite + WebGPU would bring more performance for some animations were running mostly on mobile devices. It would improve the experience of some millions of users.

Can anyone here share a recent prebuilt canvaskit_webgpu.{js,wasm} for me to try?

Possibly even an slightly old build would allow us to validate wether skia on webgpu would actually bring performance increases or not.

I did try for several hours to get it to build from source but it's an absolute minefiled.

  - canvaskit-wasm 0.34.x → 0.41.1 on npm — no WebGPU variant in any tarball.
  - Built from source with ./compile.sh webgpu on macOS arm64 with the bundled emsdk 4.0.7. Outcomes per tag:
    - canvaskit/0.39.1: pinned Dawn (Oct 2023) is too old. Skia source references 16-bit texture formats (R16Unorm, etc.) that don't exist in that Dawn
    - canvaskit/0.41.0: pinned Dawn has tint::Bindings referenced in dawn/src/dawn/native/TintUtils.h but the public umbrella dawn/include/tint/tint.h doesn't include src/tint/api/common/bindings.h — looks like a missed include. Patched that locally and the build progressed further but then DawnCaps.cpp references
  wgpu::FeatureName::DualSourceBlending / TextureFormatsTier1 / R8BG8Biplanar420Unorm which the bundled emscripten 4.0.7's in-tree webgpu/webgpu_cpp.h doesn't define. There's clearly a version missmatch here.
    - chrome/m149: same build_dawn.py (no wasm/emcmake handling) and same emsdk pin as above. 
    - Skia main + standalone emsdk 5.0.7 + --use-port=emdawnwebgpu (newest port shipped with emsdk): builds 1119/1128 .o files cleanly, then 30+ Skia files fail because emdawnwebgpu has the renamed Dawn APIwhile Skia main code still uses the older names  (e.g. wgpu::SupportedLimits).
    - All three Skia trees I checked have third_party/dawn/build_dawn.py calling plain cmake + native clang. Even if I patch all the source, link fails.

  So at the moment I genuinely can't find a (Skia tag, Dawn pin, emscripten/emdawnwebgpu version) triple where all three are mutually consistent AND compile.sh webgpu produces a wasm-compatible Dawn library. 
I also checked the CI recipes from dawn for clues, but failed to find anything useful.

I also scouted every source I could find to see if anywhere there's a a prebuilt webgpu wasm file, but I found nothing.


  Specifically helpful would be:

1. A webgpu build ready to use, so I can validate if this will even bring benefits to the users.
2. A build recipe and commit/sha(s) that works.

  Thanks,
  Miguel

William Candillon

unread,
Jun 2, 2026, 2:01:13 AMJun 2
to skia-discuss

Hello Miguel,

I don't think there is a way to have this working at the moment, but I will let someone from the Skia team answer definitively.

Right now it looks like Skia Graphite is leveraging WebGPU/Dawn features which are likely not to be available in the browser.

In React Native, we have a WebGPU module based on Dawn and we would love it if people could "bring" this module to bootstrap Skia Graphite, but it doesn't look like there is a sensible path to do this (even though here, it would be much easier because we do have access to native WebGPU APIs, we're not limited to the JS standard). So currently we do it the other way around: if you run Skia Graphite, you get JS WebGPU bindings from Graphite and have to drop the WebGPU module.

On the web, html-in-canvas is the way to go for a modern approach to CanvasKit. Of course it is only supported by Google Chrome behind an experimental flag, but the developer community seems to love it so there might be adoption from other vendors.

Kind regards,

William

Lytwulf

unread,
Jun 4, 2026, 8:57:59 AMJun 4
to skia-discuss
Hey,
I believe there was a working PoC of Graphite for wasm/js some time ago.

Currently it is somewhat a dead code and there is no official support for it yet. Skia doesn't currently test the WebGPU/Graphite backend in tests or even compilation for it
Reply all
Reply to author
Forward
0 new messages