Add COPY_DST to Metal's surface usage bits#2491
Merged
kvark merged 1 commit intogfx-rs:masterfrom Feb 18, 2022
Merged
Conversation
kvark
approved these changes
Feb 18, 2022
Member
kvark
left a comment
There was a problem hiding this comment.
I checked, and it seems that the rest of the code would handle this fine.
cwfitzgerald
pushed a commit
that referenced
this pull request
Oct 25, 2023
Document `FunctionType` better. Use `FunctionCtx` name key methods where appropriate in the WGSL and HLSL backends.
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
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.
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_DSTcould not be configured anymore (macOS 11.6.2) due to a validation mismatch. This PR adds theCOPY_DSTflag 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_DSTusage 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_WRITEwould also work? I'm happy to test out any additional changes and update the PR.