Skip to content

Commit

Permalink
Sync TextureFormat.describe with the spec (#3312)
Browse files Browse the repository at this point in the history
* sync TextureFormat.describe with the spec

* add changelog entry
  • Loading branch information
teoxoy authored Dec 20, 2022
1 parent 052bd17 commit 8ca6e38
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
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

0 comments on commit 8ca6e38

Please sign in to comment.