Skip to content

Additional validation of buffer-texture copies #7948

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 3 commits into from
Jul 23, 2025

Conversation

andyleiserson
Copy link
Contributor

@andyleiserson andyleiserson commented Jul 14, 2025

Adds some more buffer-texture copy validation. I am declaring that this fixes #7936, although there are still problems with buffer-texture copies, see #7946 and #7947.

This PR enforces:

  • Offset for copies to/from compressed formats must be aligned to the block size
  • Offset for copies to/from depth stencil formats must be 4B aligned.
  • Temporarily enforces that all buffer-texture copies be 4B aligned, pending a fix for wgpu imposes a 4B alignment for buffer initializations but fails to respect it #7947.
  • Disallows multisampled textures for both T2B and B2T (previously only one checked for multisampled textures)

Testing
Enables a sampling of relevant CTS tests, but some of the tests still have a mix of passing and failing variants and I didn't try to exhaustively list every passing case in test.lst.

Squash or Rebase? Squash

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy --tests. If applicable, add:
    • --target wasm32-unknown-unknown
  • Run cargo xtask test to run tests.
  • If this contains user-facing changes, add a CHANGELOG.md entry.

@andyleiserson andyleiserson requested review from crowlKats and a team as code owners July 14, 2025 21:19
@andyleiserson andyleiserson force-pushed the buffer-texture-copy-validation branch from 505645e to 859c787 Compare July 14, 2025 21:41
@andyleiserson andyleiserson marked this pull request as draft July 14, 2025 23:58
@andyleiserson andyleiserson force-pushed the buffer-texture-copy-validation branch from fe9db5a to 26933e5 Compare July 15, 2025 17:18
@andyleiserson andyleiserson marked this pull request as ready for review July 15, 2025 17:39
@andyleiserson
Copy link
Contributor Author

andyleiserson commented Jul 22, 2025

This comment previously noted which commits belonged to this PR vs. #7935, but that no longer applies since the other PR has been merged and this one rebased.

@andyleiserson andyleiserson force-pushed the buffer-texture-copy-validation branch from 3e2c500 to 22efde3 Compare July 22, 2025 18:44
@teoxoy teoxoy merged commit 1c43ac2 into gfx-rs:trunk Jul 23, 2025
40 checks passed
@andyleiserson andyleiserson deleted the buffer-texture-copy-validation branch July 23, 2025 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing validation for buffer<->texture copies
2 participants