Skip to content

Commit

Permalink
vk: fix ASTC format mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
kvark committed Feb 14, 2022
1 parent a604535 commit 046f008
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
12 changes: 6 additions & 6 deletions wgpu-hal/src/vulkan/conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ impl super::PrivateCapabilities {
Tf::Astc8x5RgbaUnormSrgb => F::ASTC_8X5_SRGB_BLOCK,
Tf::Astc8x6RgbaUnorm => F::ASTC_8X6_UNORM_BLOCK,
Tf::Astc8x6RgbaUnormSrgb => F::ASTC_8X6_SRGB_BLOCK,
Tf::Astc10x5RgbaUnorm => F::ASTC_8X8_UNORM_BLOCK,
Tf::Astc10x5RgbaUnormSrgb => F::ASTC_8X8_SRGB_BLOCK,
Tf::Astc10x6RgbaUnorm => F::ASTC_10X5_UNORM_BLOCK,
Tf::Astc10x6RgbaUnormSrgb => F::ASTC_10X5_SRGB_BLOCK,
Tf::Astc8x8RgbaUnorm => F::ASTC_10X6_UNORM_BLOCK,
Tf::Astc8x8RgbaUnormSrgb => F::ASTC_10X6_SRGB_BLOCK,
Tf::Astc8x8RgbaUnorm => F::ASTC_8X8_UNORM_BLOCK,
Tf::Astc8x8RgbaUnormSrgb => F::ASTC_8X8_SRGB_BLOCK,
Tf::Astc10x5RgbaUnorm => F::ASTC_10X5_UNORM_BLOCK,
Tf::Astc10x5RgbaUnormSrgb => F::ASTC_10X5_SRGB_BLOCK,
Tf::Astc10x6RgbaUnorm => F::ASTC_10X6_UNORM_BLOCK,
Tf::Astc10x6RgbaUnormSrgb => F::ASTC_10X6_SRGB_BLOCK,
Tf::Astc10x8RgbaUnorm => F::ASTC_10X8_UNORM_BLOCK,
Tf::Astc10x8RgbaUnormSrgb => F::ASTC_10X8_SRGB_BLOCK,
Tf::Astc10x10RgbaUnorm => F::ASTC_10X10_UNORM_BLOCK,
Expand Down
3 changes: 3 additions & 0 deletions wgpu-hal/src/vulkan/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ unsafe extern "system" fn debug_utils_messenger_callback(
log::log!(level, "\tobjects: {}", names.join(", "));
}

// uncommenting this is useful for tests
//assert_ne!(level, log::Level::Error);

vk::FALSE
}

Expand Down
24 changes: 12 additions & 12 deletions wgpu-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1909,6 +1909,18 @@ pub enum TextureFormat {
/// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format.
#[cfg_attr(feature = "serde", serde(rename = "astc-8x6-unorm-srgb"))]
Astc8x6RgbaUnormSrgb,
/// 8x8 block compressed texture. 16 bytes per block (2 bit/px). Complex pallet. 8 bit integer RGBA.
/// [0, 255] converted to/from float [0, 1] in shader.
///
/// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format.
#[cfg_attr(feature = "serde", serde(rename = "astc-8x8-unorm"))]
Astc8x8RgbaUnorm,
/// 8x8 block compressed texture. 16 bytes per block (2 bit/px). Complex pallet. 8 bit integer RGBA.
/// Srgb-color [0, 255] converted to/from linear-color float [0, 1] in shader.
///
/// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format.
#[cfg_attr(feature = "serde", serde(rename = "astc-8x8-unorm-srgb"))]
Astc8x8RgbaUnormSrgb,
/// 10x5 block compressed texture. 16 bytes per block (2.56 bit/px). Complex pallet. 8 bit integer RGBA.
/// [0, 255] converted to/from float [0, 1] in shader.
///
Expand All @@ -1933,18 +1945,6 @@ pub enum TextureFormat {
/// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format.
#[cfg_attr(feature = "serde", serde(rename = "astc-10x6-unorm-srgb"))]
Astc10x6RgbaUnormSrgb,
/// 8x8 block compressed texture. 16 bytes per block (2 bit/px). Complex pallet. 8 bit integer RGBA.
/// [0, 255] converted to/from float [0, 1] in shader.
///
/// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format.
#[cfg_attr(feature = "serde", serde(rename = "astc-8x8-unorm"))]
Astc8x8RgbaUnorm,
/// 8x8 block compressed texture. 16 bytes per block (2 bit/px). Complex pallet. 8 bit integer RGBA.
/// Srgb-color [0, 255] converted to/from linear-color float [0, 1] in shader.
///
/// [`Features::TEXTURE_COMPRESSION_ASTC_LDR`] must be enabled to use this texture format.
#[cfg_attr(feature = "serde", serde(rename = "astc-8x8-unorm-srgb"))]
Astc8x8RgbaUnormSrgb,
/// 10x8 block compressed texture. 16 bytes per block (1.6 bit/px). Complex pallet. 8 bit integer RGBA.
/// [0, 255] converted to/from float [0, 1] in shader.
///
Expand Down

0 comments on commit 046f008

Please sign in to comment.