Skip to content

feat(naga): constant evaluation for select #7602

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

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

ErichDonGubler
Copy link
Member

Connections

Testing

  • Still deciding on test coverage here. WebGPU CTS is pretty thorough on this front; maybe we can defer?

Squash or Rebase?

Squash unless multiple commits.

Checklist

  • If this contains user-facing changes, add a CHANGELOG.md entry.

@ErichDonGubler ErichDonGubler force-pushed the const-eval-select branch 2 times, most recently from cb645c6 to 3806939 Compare April 23, 2025 15:04

let select_single_component =
|this: &mut Self, reject_scalar, reject, accept, condition| {
let accept = this.cast(accept, reject_scalar, span)?;
Copy link
Member Author

@ErichDonGubler ErichDonGubler Apr 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Ah, this apparently causes a problem for one testing case where we check _ = select(true, 1, false); in validation::validation_error_messages, because cast here coerces from integrals to bool via a non-zero comparison.

I'm not sure that we should be permitting this sort of cast generally. @jimblandy, does that sound correct to do such casting? If so, I need to filter out the case of booleans specifically here...which feels wrong.

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.

2 participants