-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Additional validation of texture copies #7935
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
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
* Copies must not overlap. * Copies of multisampled or depth/stencil formats must span the entire texture. * Move no-op for zero-size copies after parameter validation. Closes gfx-rs#2951 Fixes gfx-rs#7844
0b8f788
to
fa7961b
Compare
Sounds like we need to add more CTS tests. |
6 tasks
teoxoy
requested changes
Jul 16, 2025
fa7961b
to
04cd49f
Compare
teoxoy
approved these changes
Jul 22, 2025
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.
Nice!
andyleiserson
added a commit
to andyleiserson/wgpu
that referenced
this pull request
Jul 29, 2025
This fixes a regression introduced by gfx-rs#7935.
6 tasks
andyleiserson
added a commit
that referenced
this pull request
Jul 29, 2025
This fixes a regression introduced by #7935.
6 tasks
andyleiserson
added a commit
to andyleiserson/wgpu
that referenced
this pull request
Jul 30, 2025
This fixes a regression introduced by gfx-rs#7935.
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.
In studying whether #2951 is still an issue, I identified some other texture validation that is missing. This adds it, and also fixes the issue where we skip parameter validation for zero-size copies.
I suspect that this may fix #7844 by rejecting an illegal operation before dx12 panics.I've also included a fix for #7844 that splits depth+stencil copies into two operations, although I'm not sure if this is the right fix -- it appears that metal does support a combined copy in copyTextureToTexture (but not in copyBufferToTexture), so maybe this should be pushed to the backends.Testing
Enables all the
copyTextureToTexture
CTS tests. However, the CTS isn't complete coverage of the validation logic I added. In particular, it doesn't cover the logic that allows copies among different aspects of the same texture. I'm not sure if that even makes sense (copying between depth and stencil?), or if it's just the spec being thorough, but I would welcome a suggestion of an interesting test to add here.Squash or Rebase? Squash
Checklist
cargo fmt
.taplo format
.cargo clippy --tests
. If applicable, add:--target wasm32-unknown-unknown
cargo xtask test
to run tests.CHANGELOG.md
entry. Maybe it's worth one overall changelog entry mentioning this, the vertex/index buffer offset change, and any other added validation that gets added.