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

Naga should permit override expressions as LocalVariable initializers #5439

Open
jimblandy opened this issue Mar 26, 2024 · 1 comment
Open
Labels
area: naga middle-end Intermediate representation naga Shader Translator type: enhancement New feature or request

Comments

@jimblandy
Copy link
Member

At present, Naga only allows constant expressions in LocalVariable::init, but there's no reason it couldn't permit override expressions as well.

jimblandy@7985ce1 seems to work fine.

@jimblandy
Copy link
Member Author

Note that this is unrelated to WGSL compliance. The WGSL front end already accepts any sort of expression as an initializer for LocalVariables, but initialization by a runtime expression is handled via an explicit Store statement. The question here is merely which initializations we can render using LocalVariable::init, and which require Stores.

Using init produces slightly cleaner output.

@teoxoy teoxoy added type: enhancement New feature or request naga Shader Translator area: naga middle-end Intermediate representation labels Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: naga middle-end Intermediate representation naga Shader Translator type: enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

2 participants