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

Errors on preprocessor directives #10

Open
sargunv opened this issue Apr 14, 2022 · 6 comments
Open

Errors on preprocessor directives #10

sargunv opened this issue Apr 14, 2022 · 6 comments

Comments

@sargunv
Copy link

sargunv commented Apr 14, 2022

Using this with your VSCode plugin

CleanShot 2022-04-14 at 19 55 30@2x

@PolyMeilex
Copy link
Owner

WGSL does not have a preprocessor, so I guess you are using something custom, would you mind sharing the preprocessor that you are using? So I can maybe hack in some optional support for it

@sargunv
Copy link
Author

sargunv commented Apr 16, 2022

Ah, I'm just using Bevy, but I'm not sure if the preprocessor is part of Bevy or a dependency of Bevy.

@sargunv
Copy link
Author

sargunv commented Apr 16, 2022

Actually it appears to be a feature of Bevy: bevyengine/bevy#3137

@PolyMeilex
Copy link
Owner

It looks like https://marketplace.visualstudio.com/items?itemName=wgsl-analyzer.wgsl-analyzer does support this (look at the Custom imports section), if it ends up working better for you than my project feel free to close this issue. If you'll find it insufficient replacement in some way, feel free to comment here, and then I'll consider implementing it here instead.

@sargunv
Copy link
Author

sargunv commented Apr 16, 2022

I've tried that project, but they don't provide binaries for my platform (ARM MacOS) and my attempt to build one from source failed. The build error is probably solvable but I haven't taken the time to look into it (for now, my shader is dead simple and syntax highlighting alone is enough).

@cactusdualcore
Copy link

Bevy uses naga_oil since 0.11. I think Preprocessor::preprocess does the actual work.

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

3 participants