Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support wgsl diagnostic directives. #113

Open
Elabajaba opened this issue Feb 5, 2025 · 3 comments
Open

Support wgsl diagnostic directives. #113

Elabajaba opened this issue Feb 5, 2025 · 3 comments

Comments

@Elabajaba
Copy link
Contributor

Wgpu added this in v24, but I didn't figure out how to get them working properly before we merged that PR so they're currently unsupported.

There's a basic test for them written. The test and the test input (though the expected output here is incorrect). The test currently panics due to the unwrap because the shader module creation is erroring for some reason.

@Wumpf
Copy link

Wumpf commented Feb 14, 2025

The error stems from the directive not being prior to all global declarations i.e. not all the way at the top. I'm running into the same issue trying to use an enable directive.
(as of writing naga has the scaffolding for enable directive but there's none of them implemented, something I was about to change)

@Wumpf
Copy link

Wumpf commented Feb 14, 2025

Got a hack here to make it fly for myself. This is obviously nowhere close to a shippable solution. Prodded into doing something more cleaner but not having a great time navigating the codebase and tbh it's not something I want to invest time into right now.
But maybe this helps illustrate the issue :) Wumpf@fcfe280

Hit another snag though on the Naga side: the module -> wgsl writeout that is used when targeting WebGPU isn't emitting enable directives either right now :sigh:

@Wumpf
Copy link

Wumpf commented Feb 15, 2025

Hit another snag though on the Naga side: the module -> wgsl writeout that is used when targeting WebGPU isn't emitting enable directives either right now :sigh:

practically oftopic to this issue, but FYI got that part under control over on wgpu by now 🥳 (part of gfx-rs/wgpu#7146)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants