NOTE: THIS IS NOT A MODULAR PROJECT!!!
This repo shows proof of concept bindings to wgpu-native. These bindings are not in a state such that they can be used for anything production ready, but one can at least reach a hello-triangle stage.
There is an example that can be run with:
magic run exec
respctively.
Note: the C binding generator in gen_c.py
is currently stale, so running it will break things.
- I've only written code to get the surface for MacOS.
- There are several structs like
WGPURequestAdapterOptions
that don't seem to work when used in an FFI call. - In an FFI-callback, accessing the status struct seems to cause issues for some reason (but works if replaced with an UInt32).
- Due to the awkward stage the Mojo standard library is currently in with respect to collections (and the
CollectionElement
trait), some types need to be wrapped inArc
so they can be used in collections. - Lifetime inference doesn't seem to be working well for structs like
RequestPipelineDescriptor
.
- Learn WebGPU by Élie Michel and contributors.
- wgpu-native (especially the triangle example).
- webgpu-headers the
webgpu.json
file is thewebgpu.yml
file from here (at the relevant commit for thewgpu
version), converted to JSON. - zig-objc by Mitchell Hashimoto for Objective-C bindings.