Add COPY_DST to Metal's surface usage bits #2491
Merged
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.
Description
After
cargo upgrade
-ing wgpu-core from 0.12.0 to 0.12.2, and wgpu-hal from 0.12.0 to 0.12.4, a Metal surface with usage flagsTextureUsages::RENDER_ATTACHMENT | TextureUsages::COPY_DST
could not be configured anymore (macOS 11.6.2) due to a validation mismatch. This PR adds theCOPY_DST
flag to Metal's surface capabilities so validation now passes for this particular usage flag. See "Discussion" below.Testing
The simplest way to test is to add a
wgpu::TextureUsages::COPY_DST
usage flag to hello_triangle example's surface configuration. Prior to this change (and given you're on macOS), you'll get a panicError in Surface::configure: requested usage is not supported
. This change fixes the panic.Discussion
I see there's a TODO for possibly exposing more flags, but I'm not knowledgeable enough to add them without discussing first. For example, I feel
DEPTH_STENCIL_WRITE
would also work? I'm happy to test out any additional changes and update the PR.