Skip to content

Conversation

@andyleiserson
Copy link
Contributor

The spec defines many built-ins to have the @must_use attribute. This PR applies "must use" enforcement on calls to applicable built-ins.

There are some preliminary refactors including moving a chunk of code. They are in separate commits and it is probably easier to review that way.

This is a breaking change for shaders that call these functions without using the result, which is unfortunate, but we don't have infrastructure for deprecation warnings.

This can of course wait until after the release if desired, although it seems like a change that will cause the same amount of pain in whatever release it goes in, rather than a change that needs soak time before being released.

I don't love MUST_USE_YES and MUST_USE_NO, but I also don't love random booleans that you have to look 100 lines up or down to interpret.

Testing
Tested by the CTS

Squash or Rebase? Rebase (after squashing fixups)

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy --tests. If applicable, add:
    • --target wasm32-unknown-unknown
  • Run cargo xtask test to run tests.
  • Need to update PR link in changelog.

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.

1 participant