orca-app / orca

A Wasm environment for cross-platform, sandboxed graphical applications.
https://orca-app.dev
Other
156 stars 13 forks source link

Expose WebGPU API to apps #67

Open martinfouilleul opened 3 months ago

martinfouilleul commented 3 months ago

The way I think we should go about this is having a lightweight "client" implementation of WebGPU that encodes commands into a ringbuffer, that can be read by the host and forwarded (after some checks / handles translations) to the native WebGPU implementation. WebGPU objects on the wasm side should be treated as handles, and translated to webgpu pointers on the native side through a separate handle table (this way the wasm side can't touch native webgpu objects used by the runtime, eg by the vector graphics backend).