Swoorup / wgsl-bindgen

Generate typesafe Rust bindings for wgsl shaders in wgpu
https://crates.io/crates/wgsl_bindgen
MIT License
34 stars 7 forks source link

Allow capabilities #5

Closed alanlzhang closed 8 months ago

alanlzhang commented 8 months ago

Currently wgsl-bindgen use default setting for Composer, this patch provide user the option to set the capabilities they want.

Some capabilities (such as PUSH_CONSTANT) are quit useful, and user may want to enable it.

Swoorup commented 8 months ago

Does this change the generated output in any way?

alanlzhang commented 8 months ago

For example var<push_constant> value;

With this patch, bindgen will generate a rust struct for it, just like other uniforms.

Without this patch, naga will error with 'Unsupported capability ...'