From 046f008cc017e14d01b55b74fc4d9102a6587695 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Sun, 13 Feb 2022 00:18:16 -0500 Subject: [PATCH] vk: fix ASTC format mapping --- wgpu-hal/src/vulkan/conv.rs | 12 ++++++------ wgpu-hal/src/vulkan/instance.rs | 3 +++ wgpu-types/src/lib.rs | 24 ++++++++++++------------ 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/wgpu-hal/src/vulkan/conv.rs b/wgpu-hal/src/vulkan/conv.rs index 087af70594..7ee0cd0e91 100644 --- a/wgpu-hal/src/vulkan/conv.rs +++ b/wgpu-hal/src/vulkan/conv.rs @@ -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, diff --git a/wgpu-hal/src/vulkan/instance.rs b/wgpu-hal/src/vulkan/instance.rs index 71e0fc7e38..568278e04f 100644 --- a/wgpu-hal/src/vulkan/instance.rs +++ b/wgpu-hal/src/vulkan/instance.rs @@ -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 } diff --git a/wgpu-types/src/lib.rs b/wgpu-types/src/lib.rs index 097a068ed4..96a06094c9 100644 --- a/wgpu-types/src/lib.rs +++ b/wgpu-types/src/lib.rs @@ -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. /// @@ -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. ///