gfx-rs / wgpu

A cross-platform, safe, pure-Rust graphics API.

Home Page:https://wgpu.rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Expose the translation units and parsers for naga frontends

ncthbrt opened this issue · comments

Is your feature request related to a problem? Please describe.

When building tooling or extensions for wgsl, or other shader languages, it'd be very useful to be able to parse the source code without having it be well formed. This would more easily enable for example building a module/import system that allows for cyclical imports of types and functions (useful when for example a main module has types defined in it and a child module needs to refer to the type).

Describe the solution you'd like

Exposing the relevant types that would allow translation units to be manipulated and manually lowered.

Describe alternatives you've considered

Building or vendoring in the naga frontends into the source code.

This is the plan for #5713 as well.

@teoxoy is there any timeline on that? Would be immensely helpful for what I'm building right now in naga oil

I'm not aware of any naga maintainer interested in doing this work right now but PRs are welcome!