Skip to content

Conversation

reima
Copy link
Contributor

@reima reima commented Aug 27, 2025

Connections
Fixes #5456.

Description
TransferError now has separate variants for texture copy formats that are only forbidden in combination with specific aspects (CopyFrom/ToForbiddenTextureFormatAspect), and texture copy formats that are always forbidden, irrespective of the aspect
(CopyFrom/ToForbiddenTextureFormat).

This produces a less confusing error message by not mentioning the aspect if it is not relevant.

In its current form, this is a breaking change, as TransferError::CopyFromForbiddenTextureFormat and TransferError::CopyToForbiddenTextureFormat have changed their shape from struct to tuple. I'm not sure if that matters in practice.

Testing

I've added tests in wgpu-validation/api/texture.rs. I'm not sure if this is the right place.

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.

@reima reima requested a review from a team as a code owner August 27, 2025 12:29
TransferError now has separate variants for texture copy formats that
are only forbidden in combination with specific aspects
(CopyFrom/ToForbiddenTextureFormatAspect), and texture copy formats that
are always forbidden, irrespective of the aspect
(CopyFrom/ToForbiddenTextureFormat).

This produces a less confusing error message by not mentioning the
aspect it is not relevant.
Copy link
Member

@teoxoy teoxoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great - thank you!

@teoxoy teoxoy enabled auto-merge (squash) August 29, 2025 09:54
@teoxoy teoxoy merged commit 80a7420 into gfx-rs:trunk Aug 29, 2025
40 checks passed
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.

Bad error message for trying to copy to Depth32Float format
2 participants