-
Notifications
You must be signed in to change notification settings - Fork 905
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
[wgpu-core] Compute minimum binding size correctly for arrays. #5222
Merged
Conversation
This file contains 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
jimblandy
added
area: validation
Issues related to validation, diagnostics, and error handling
area: correctness
We're behaving incorrectly
labels
Feb 8, 2024
jimblandy
force-pushed
the
array-min-binding-size
branch
from
February 8, 2024 00:20
443c28b
to
3194089
Compare
nical
approved these changes
Feb 8, 2024
@jimblandy: Looks like Windows CI is failing, and it's relevant? https://github.com/gfx-rs/wgpu/actions/runs/7822956888/job/21349870422?pr=5222#step:13:4146 |
Hoho, maybe we can reliably reproduce #3193 now?? |
jimblandy
force-pushed
the
array-min-binding-size
branch
from
February 8, 2024 23:30
3194089
to
7ffe936
Compare
In early versions of WGSL, `storage` or `uniform` global variables had to be either structs or runtime-sized arrays. This rule was relaxed, and now globals can have any type; Naga automatically wraps such variables in structs when required by the backend shading language. Under the old rules, whenever wgpu-core saw a `storage` or `uniform` global variable with an array type, it could assume it was a runtime-sized array, and take the stride as the minimum binding size. Under the new rules, wgpu-core must consider fixed-sized and runtime-sized arrays separately. Fixes gfx-rs#5219.
jimblandy
force-pushed
the
array-min-binding-size
branch
from
February 9, 2024 02:45
7ffe936
to
d05ea8c
Compare
suspistew
pushed a commit
to suspistew/wgpu
that referenced
this pull request
Mar 23, 2024
…s#5222) * [wgpu-core] Add tests for minimum binding size validation. * [wgpu-core] Compute minimum binding size correctly for arrays. In early versions of WGSL, `storage` or `uniform` global variables had to be either structs or runtime-sized arrays. This rule was relaxed, and now globals can have any type; Naga automatically wraps such variables in structs when required by the backend shading language. Under the old rules, whenever wgpu-core saw a `storage` or `uniform` global variable with an array type, it could assume it was a runtime-sized array, and take the stride as the minimum binding size. Under the new rules, wgpu-core must consider fixed-sized and runtime-sized arrays separately.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area: correctness
We're behaving incorrectly
area: validation
Issues related to validation, diagnostics, and error handling
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.
In early versions of WGSL,
storage
oruniform
global variables hadto be either structs or runtime-sized arrays. This rule was relaxed,
and now globals can have any type; Naga automatically wraps such
variables in structs when required by the backend shading language.
Under the old rules, whenever wgpu-core saw a
storage
oruniform
global variable with an array type, it could assume it was a
runtime-sized array, and take the stride as the minimum binding size.
Under the new rules, wgpu-core must consider fixed-sized and
runtime-sized arrays separately.
Checklist
cargo fmt
.cargo clippy
.cargo xtask test
to run tests.CHANGELOG.md
. See simple instructions inside file.