gfx-rs / wgpu-native

Native WebGPU implementation based on wgpu-core
Apache License 2.0
843 stars 96 forks source link

Is bindgen at build time still needed? #365

Open waywardmonkeys opened 7 months ago

waywardmonkeys commented 7 months ago

Now that PR #361 has landed and the bindings.rs only contains things prefixed with WGPU and wgpu, the OS-specific stuff is gone and what remains looks to be non-OS specific to me (unless I've missed something).

Would we be able to generate the bindings.rs and check it in to reduce build time (by not having to compile bindgen). This would also simplify things a bit by not needing a more current clang, perhaps improving on things for generating binary builds (as mentioned in the Wiki).

rajveermalviya commented 7 months ago

The long term plan I had in mind is to use the new webgpu.yml to generate all the structs, enums and extern "C" functions along with generating a large Trait that we would have to then impl.

This would eliminate any user errors that could occur currently when writing them by hand - like forgetting a function, mismatched types from the header, and so forth.

Also removing the need for checks.py, because we would get those checks done by the rust compiler for free.

almarklein commented 7 months ago

the new webgpu.yml

I did not know about that yaml file yet. That's going to make our codegen at wgpu-py a lot easier ❤️ 🤯