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

Make naga oil's error more useful #6

Closed Swoorup closed 8 months ago

Swoorup commented 8 months ago

Make it appear nicer when the naga oily compiler fails.

--- stderr
  Error:   × Failed to compose modules with entry `src/shader/testbed.wgsl`
    │ error: failed to build a valid final module: Global variable [13]
    │ 'scene_transform' is invalid
    │    ┌─ src/shader/testbed.wgsl:76:23
    │    │
    │ 76 │ @group(1) @binding(2) var<uniform> scene_transform:
    │ SceneTransformData;
    │    │                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    │ naga::GlobalVariable [13]
    │    │
    │    = Alignment requirements for address space Uniform are not met by [40]
    │    = The struct member[1] offset 8 must be at least 16
    │ 
    │ 

[Finished running. Exit status: 101]

Hit another issue though https://github.com/bevyengine/naga_oil/issues/78