Additional validation of texture copies #7935
Merged
+231
−124
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.