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] Gracefully handle span lookup with no module source #7390

Merged
merged 1 commit into from
Mar 26, 2025

Conversation

andyleiserson
Copy link
Contributor

Fixes #7165

Description
Gracefully handle looking up the source location for a span when no module source is available. This fixes a possible (although unlikely under normal usage) panic.

Testing
The original repro was via the wgpu crate, but rather than add a test at that level, I've added a test in wgsl_errors that seems like a reasonable approximation of the original.

I've also added a test for the InvalidReturnType error, because I didn't see an existing one, and fixed a stale comment.

Squash or Rebase? Squash, if applicable.

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. Ran wgsl_errors locally, will let CI do the rest.
  • If this contains user-facing changes, add a CHANGELOG.md entry. Technically user-facing, but doesn't seem worth a changelog entry.

@ErichDonGubler ErichDonGubler self-assigned this Mar 25, 2025
@cwfitzgerald cwfitzgerald merged commit 90afc88 into gfx-rs:trunk Mar 26, 2025
37 checks passed
@andyleiserson andyleiserson deleted the issue7165 branch March 26, 2025 16:34
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.

ShaderSource::Naga causes panics when rendering ShaderErrors with invalid modules
3 participants