fix(naga): Don't panic on oversize types#9516
Open
andyleiserson wants to merge 1 commit intogfx-rs:trunkfrom
Open
fix(naga): Don't panic on oversize types#9516andyleiserson wants to merge 1 commit intogfx-rs:trunkfrom
andyleiserson wants to merge 1 commit intogfx-rs:trunkfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #9440 a.k.a. https://bugzilla.mozilla.org/show_bug.cgi?id=2020561 and https://bugzilla.mozilla.org/show_bug.cgi?id=2031636.
Changes some panics on oversize types to be errors instead.
The messy thing here is that the
Layouteroperates lazily, so when we get an error fromupdate(), it's not necessarily related to what we're working on at that moment. This is particularly problematic in the constant evaluator where the context for the error is assumed farther up the call stack, so I've madeConstantEvaluatorError::TypeTooLargeinclude the type, unlike the rest of the constant evaluator errors.This could probably all be refactored to be cleaner, but this was as much time as I could justify spending on it right now. The type size limit is 2 GB; shaders that exceed it are pathological and unlikely to be useful in any current WebGPU deployment.
Testing
Adds directed tests in wgsl_errors.
Squash or Rebase? Squash
Checklist
wgpumay be affected behaviorally.CHANGELOG.mdentries for the user-facing effects of this change are present.