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

WGSL: Add a skeleton for enable-extensions/enable …; that reports nice errors #6424

Conversation

ErichDonGubler
Copy link
Member

@ErichDonGubler ErichDonGubler commented Oct 18, 2024

Connections

Description

This PR is much like #6352, but for the enable directive; it unblocks work on enable extensions in WGSL by serving as a foundation on which to build individual extension functionality. It does the following:

  1. Build on Add a skeleton for directives that reports nice errors #6352 by parsing an enable extension list after we encounter an enable in the directive parse path keyword, instead of emitting an unimplemented directive error.
  2. Create an enum modeling all known extensions, including standard-but-unimplemented ones.
  3. Add nice diagnostics for known and unknown extensions. If a known, but unimplemented, extension is requested, provide a hint that points users towards the appropriate Naga issue, so they can let us know they were blocked.

Note that this PR does not actually implement any extensions yet—see also the UnimplementedEnableExtension::tracking_issue_num method added in this PR for references to follow-up work for those.

Testing

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy. If applicable, add:
    • --target wasm32-unknown-unknown
    • --target wasm32-unknown-emscripten
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file.

@ErichDonGubler ErichDonGubler requested review from a team as code owners October 18, 2024 20:11
@ErichDonGubler ErichDonGubler self-assigned this Oct 18, 2024
@ErichDonGubler ErichDonGubler added type: enhancement New feature or request naga Shader Translator area: naga front-end lang: WGSL WebGPU Shading Language labels Oct 18, 2024
@ErichDonGubler ErichDonGubler force-pushed the erichdongubler/push-xrkxlvzkznyw branch 3 times, most recently from 2e61c71 to cb8630b Compare October 18, 2024 20:28
@ErichDonGubler ErichDonGubler changed the title Add a skeleton for enable extensions that reports nice errors WGSL: Add a skeleton for language extensions (i.e., enable …;) that reports nice errors Oct 22, 2024
@ErichDonGubler ErichDonGubler changed the title WGSL: Add a skeleton for language extensions (i.e., enable …;) that reports nice errors WGSL: Add a skeleton for language extensions/enable …; that reports nice errors Oct 22, 2024
@ErichDonGubler
Copy link
Member Author

@teoxoy: This PR is exercised by #5701; any objection to punting tests to a separate PR, so we can keep yet another blocker for it resolved?

@teoxoy
Copy link
Member

teoxoy commented Oct 22, 2024

That's fine with me.

Copy link
Member

@teoxoy teoxoy left a comment

Choose a reason for hiding this comment

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

LGTM

@ErichDonGubler ErichDonGubler enabled auto-merge (rebase) October 22, 2024 20:19
@ErichDonGubler ErichDonGubler merged commit d539466 into gfx-rs:trunk Oct 22, 2024
27 checks passed
@ErichDonGubler ErichDonGubler deleted the erichdongubler/push-xrkxlvzkznyw branch October 22, 2024 20:31
@ErichDonGubler ErichDonGubler changed the title WGSL: Add a skeleton for language extensions/enable …; that reports nice errors WGSL: Add a skeleton for enable-extensions/enable …; that reports nice errors Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: naga front-end lang: WGSL WebGPU Shading Language naga Shader Translator type: enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants