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 wgsl] Add to_wgsl functions for some Naga IR types. #7180

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

Conversation

jimblandy
Copy link
Member

Add to_wgsl functions that return the WGSL representations of the following types as &'static str values:

  • MathFunction
  • BuiltIn
  • Interpolation
  • Sampling

Use these functions in the WGSL backend.

Also add to_wgsl_debug functions that return some legible string for all possible values, not just those that are defined by the WGSL standard.

There are other types that it would make sense to do this for, like ImageDimension, but these are some of the types I ended up needing for diagnostics and logging in #6833, from which I'm trying to spin them out.

Add `to_wgsl` functions that return the WGSL representations of the
following types as `&'static str` values:

- `MathFunction`
- `BuiltIn`
- `Interpolation`
- `Sampling`

Use these functions in the WGSL backend.

Also add `to_wgsl_debug` functions that return some legible string for
all possible values, not just those that are defined by the WGSL standard.
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