Skip to content
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

Add COPY_DST to Metal's surface usage bits #2491

Merged
merged 1 commit into from
Feb 18, 2022

Conversation

vl4dimir
Copy link
Contributor

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 flags TextureUsages::RENDER_ATTACHMENT | TextureUsages::COPY_DST could not be configured anymore (macOS 11.6.2) due to a validation mismatch. This PR adds the COPY_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 panic Error 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.

Copy link
Member

@kvark kvark left a comment

Choose a reason for hiding this comment

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

I checked, and it seems that the rest of the code would handle this fine.

@kvark kvark merged commit c1dcd6d into gfx-rs:master Feb 18, 2022
@vl4dimir vl4dimir deleted the metal-surface-usages branch February 20, 2022 13:47
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.
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.

2 participants