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

Sync TextureFormat.describe with the spec #3312

Merged
merged 2 commits into from
Dec 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ Additionally `Surface::get_default_config` now returns an Option and returns Non
#### WebGPU

- Add `MULTISAMPLE_X2`, `MULTISAMPLE_X4` and `MULTISAMPLE_X8` to `TextureFormatFeatureFlags`. By @39ali in [3140](https://github.com/gfx-rs/wgpu/pull/3140)
- Sync `TextureFormat.describe` with the spec. By @teoxoy in [3312](https://github.com/gfx-rs/wgpu/pull/3312)

### Bug Fixes

Expand Down
8 changes: 4 additions & 4 deletions wgpu-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2393,17 +2393,17 @@ impl TextureFormat {
) = match self {
// Normal 8 bit textures
Self::R8Unorm => ( native, float, linear, msaa_resolve, (1, 1), 1, attachment, 1),
Self::R8Snorm => ( native, float, linear, msaa, (1, 1), 1, basic, 1),
Self::R8Snorm => ( native, float, linear, noaa, (1, 1), 1, basic, 1),
Self::R8Uint => ( native, uint, linear, msaa, (1, 1), 1, attachment, 1),
Self::R8Sint => ( native, sint, linear, msaa, (1, 1), 1, attachment, 1),
// Normal 16 bit textures
Self::R16Uint => ( native, uint, linear, msaa, (1, 1), 2, attachment, 1),
Self::R16Sint => ( native, sint, linear, msaa, (1, 1), 2, attachment, 1),
Self::R16Float => ( native, float, linear, msaa_resolve, (1, 1), 2, attachment, 1),
Self::Rg8Unorm => ( native, float, linear, msaa_resolve, (1, 1), 2, attachment, 2),
Self::Rg8Snorm => ( native, float, linear, msaa, (1, 1), 2, attachment, 2),
Self::Rg8Snorm => ( native, float, linear, noaa, (1, 1), 2, basic, 2),
Self::Rg8Uint => ( native, uint, linear, msaa, (1, 1), 2, attachment, 2),
Self::Rg8Sint => ( native, sint, linear, msaa, (1, 1), 2, basic, 2),
Self::Rg8Sint => ( native, sint, linear, msaa, (1, 1), 2, attachment, 2),
// Normal 32 bit textures
Self::R32Uint => ( native, uint, linear, noaa, (1, 1), 4, all_flags, 1),
Self::R32Sint => ( native, sint, linear, noaa, (1, 1), 4, all_flags, 1),
Expand All @@ -2413,7 +2413,7 @@ impl TextureFormat {
Self::Rg16Float => ( native, float, linear, msaa_resolve, (1, 1), 4, attachment, 2),
Self::Rgba8Unorm => ( native, float, linear, msaa_resolve, (1, 1), 4, all_flags, 4),
Self::Rgba8UnormSrgb => ( native, float, corrected, msaa_resolve, (1, 1), 4, attachment, 4),
Self::Rgba8Snorm => ( native, float, linear, msaa, (1, 1), 4, storage, 4),
Self::Rgba8Snorm => ( native, float, linear, noaa, (1, 1), 4, storage, 4),
Self::Rgba8Uint => ( native, uint, linear, msaa, (1, 1), 4, all_flags, 4),
Self::Rgba8Sint => ( native, sint, linear, msaa, (1, 1), 4, all_flags, 4),
Self::Bgra8Unorm => ( native, float, linear, msaa_resolve, (1, 1), 4, attachment, 4),
Expand Down