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] Validate that all order-sensitive expressions are emitted. #5769

Draft
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

jimblandy
Copy link
Member

Ensure that every expression whose value is affected by statements' side effects is covered by an Emit statement.

See the comments on Expression::is_order_sensitive for details.

Fixes #5763.

Ensure that every expression whose value is affected by statements'
side effects is covered by an `Emit` statement.

See the comments on `Expression::is_order_sensitive` for details.

Fixes gfx-rs#5763.
Add a test to ensure that module validation will fail if a function
uses an `Expression` that is not covered by any `Emit` statement.
@jimblandy
Copy link
Member Author

Leaving this as a draft, because, naturally, our existing front ends don't actually meet the new requirement:

--- STDERR:              naga::naga-test snapshots::convert_glsl_folder ---
thread 'snapshots::convert_glsl_folder' panicked at naga/tests/snapshots.rs:1054:10:
called `Result::unwrap()` on an `Err` value: WithSpan { inner: Function { handle: [1], name: "main", source: EmitMissing([7]) }, spans: [(Span { start: 65, end: 76 }, "naga::Function [1]"), (Span { start: 84, end: 87 }, "naga::Expression [7]")] }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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

Successfully merging this pull request may close these issues.

Naga doesn't check that subexpressions have been emitted.
1 participant