Stream: wasi-gfx

Topic: Demo: Running egui via WASI WebGPU in the browser


view this post on Zulip ktz_alias (Feb 17 2026 at 11:23):

Hi! Sharing a small demo project using wasi:webgpu from a JS host (FYI).

Repository: https://github.com/ritalin/egui-wasi-webgpu-demo
Online demo: https://ritalin.github.io/egui-wasi-webgpu-demo/

WASM is transpiled to JavaScript using @bytecodealliance/jco
Tested on Chrome 145 on MacOS Ventura.

What this demo shows

Pipeline:
egui (WASM layout) -> paint commands -> wasi:webgpu calls -> JS shim -> real WebGPU

Limitations

as unknown as RenderContext

This appears to be due to TypeScript type incompatibilities between generated bindings and host shim types.
Hope this is useful as a reference for a JS-hosted wasi:webgpu workflow.

view this post on Zulip Ralph (Feb 17 2026 at 15:03):

fun!!!!

view this post on Zulip Mendy Berger (Feb 26 2026 at 19:40):

Really cool @ktz_alias !!

view this post on Zulip Mendy Berger (Feb 26 2026 at 19:41):

Curious, how did you get egui to render to webgpu directly?

view this post on Zulip Mendy Berger (Feb 26 2026 at 19:42):

Also, seems like you implemented a browser shim from scratch. I've been working on https://github.com/wasi-gfx/wasi-gfx-shim, maybe it's worth collaborating

view this post on Zulip ktz_alias (Feb 27 2026 at 03:54):

@Mendy Berger I used egui-wgpu as the reference beacause of implementing a renderer. (I've used a egui's shader)

view this post on Zulip ktz_alias (Feb 27 2026 at 03:58):

seems like you implemented a browser shim from scratch.

Yes! Firstry, I've created boilerplate codes from the jco transpile output, using a rust swc crate, then I implemented in the WebGPU call.

view this post on Zulip ktz_alias (Feb 27 2026 at 04:14):

I didn't realize https://github.com/wasi-gfx/wasi-gfx-shim repository.


Last updated: Mar 23 2026 at 16:19 UTC