-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[WebGPU] explicit layouts should be validated for compatibility with the shader #36594
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
Merged
webkit-commit-queue
merged 1 commit into
WebKit:main
from
tadeuzagallo:eng/WebGPU-explicit-layouts-should-be-validated-for-compatibility-with-the-shader
Nov 14, 2024
Merged
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
Member
EWS run on previous version of this PR (hash 9425ee6)
|
9425ee6
to
f450494
Compare
EWS run on current version of this PR (hash f450494) |
mwyrzykowski
approved these changes
Nov 13, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
…the shader https://bugs.webkit.org/show_bug.cgi?id=282710 rdar://138847403 Reviewed by Mike Wyrzykowski. There is a bug in our validation code that checks the compatibility between the variables used by the shader and the bind group provided via the API, and it happens in two steps: - first, we start by traversing the API-provided bind group we check if the shader contains a variable for that group/binding pair. Here we incorrectly check against all the variables in the shader, but we should only consider the variables that are actually used, since it's valid to have multiple variables with the same binding, so long as they are not used by the same entry point. - the second part of the code is actually correct, where we only validate the used variables against the bind group. However, since we incorrectly selected an unused variable to be serialized in the previous step, that variable is never, allowing a type mismatch between the generated shader and the bind group. This previous landed in 286432@main, but there was an issue as we were trying to generate buffer lengths for the variables that were already used for buffer lengths. In order to fix that I kept the old the check that shader contains the variable, on top of checking whether it's used. * LayoutTests/fast/webgpu/nocrash/fuzz-282710-expected.txt: Added. * LayoutTests/fast/webgpu/nocrash/fuzz-282710.html: Added. * Source/WebGPU/WGSL/GlobalVariableRewriter.cpp: (WGSL::RewriteGlobalVariables::insertStructs): Canonical link: https://commits.webkit.org/286585@main
f450494
to
19c23eb
Compare
Committed 286585@main (19c23eb): https://commits.webkit.org/286585@main Reviewed commits have been landed. Closing PR #36594 and removing active labels. |
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.
19c23eb
f450494