-
Notifications
You must be signed in to change notification settings - Fork 947
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
Pipeline constants #5500
Pipeline constants #5500
Conversation
Co-authored-by: Jim Blandy <jimb@red-bean.com>
There's no need to build a fresh `ConstantEvaluator` for every expression; just build it once and reuse it.
This removes some clones and collects, simplifies call sites, and isn't any more complicated to implement.
I found I needed a little bit more detail here.
Properly adjust `AtomicFunction::Exchange::compare` after pipeline constant evaluation.
Allow `LocalVariable::init` to be an override expression. Note that this is unrelated to WGSL compliance. The WGSL front end already accepts any sort of expression as an initializer for `LocalVariable`s, but initialization by an override expression was handled in the same way as initialization by a runtime expression, via an explicit `Store` statement. This commit merely lets us skip the `Store` when the initializer is an override expression, producing slightly cleaner output in some cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these changes have been previously reviewed as PRs to the pipeline-constants
branch.
Wooo! Thanks for all your efforts, I've been waiting for this for a long time! Great job! |
This is awesome! Is there a reason that the constants field isn't an |
@hannesojala: Well, let's start thinking, then! 😉 Why would you want an AFAIK, |
That makes perfect sense! I was only thinking from a semantic clarity perspective, but that's not everything, of course. |
It's time 🎉
Resolves #4366 & resolves #1762.
All commits have been previously approved in the following PRs:
Constant::override
andOverride
. #4845--override
option. #5419LocalVariable
initializers. #5495There are still 2 features that remain to be implemented:
workgroup_size
#4450Commits should not be squashed (they are self-contained and passed CI individually).