diff --git a/blade-graphics/src/gles/mod.rs b/blade-graphics/src/gles/mod.rs index 3ea9c3a..de3134f 100644 --- a/blade-graphics/src/gles/mod.rs +++ b/blade-graphics/src/gles/mod.rs @@ -603,8 +603,9 @@ fn describe_texture_format(format: crate::TextureFormat) -> FormatInfo { Tf::Bgra8Unorm => (glow::RGBA8, glow::BGRA, glow::UNSIGNED_BYTE), Tf::Bgra8UnormSrgb => (glow::SRGB8_ALPHA8, glow::BGRA, glow::UNSIGNED_BYTE), Tf::Rgba8Snorm => (glow::RGBA8, glow::RGBA, glow::BYTE), - Tf::R16Float => (glow::R16F, glow::RED, glow::FLOAT), - Tf::Rgba16Float => (glow::RGBA16F, glow::RGBA, glow::FLOAT), + Tf::R16Float => (glow::R16F, glow::RED, glow::HALF_FLOAT), + Tf::Rg16Float => (glow::RG16F, glow::RG, glow::HALF_FLOAT), + Tf::Rgba16Float => (glow::RGBA16F, glow::RGBA, glow::HALF_FLOAT), Tf::R32Float => (glow::R32F, glow::RED, glow::FLOAT), Tf::Rg32Float => (glow::RG32F, glow::RG, glow::FLOAT), Tf::Rgba32Float => (glow::RGBA32F, glow::RGBA, glow::FLOAT), @@ -622,6 +623,26 @@ fn describe_texture_format(format: crate::TextureFormat) -> FormatInfo { Tf::Bc4Snorm => (glow::COMPRESSED_SIGNED_RED_RGTC1, glow::RED, 0), Tf::Bc5Unorm => (glow::COMPRESSED_RG_RGTC2, glow::RG, 0), Tf::Bc5Snorm => (glow::COMPRESSED_SIGNED_RG_RGTC2, glow::RG, 0), + Tf::Bc6hUfloat => (glow::COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT, glow::RGB, 0), + Tf::Bc6hSfloat => (glow::COMPRESSED_RGB_BPTC_SIGNED_FLOAT, glow::RGB, 0), + Tf::Bc7Unorm => (glow::COMPRESSED_RGBA_BPTC_UNORM, glow::RGBA, 0), + Tf::Bc7UnormSrgb => (glow::COMPRESSED_SRGB_ALPHA_BPTC_UNORM, glow::RGBA, 0), + Tf::Rgb10a2Unorm => ( + glow::RGB10_A2, + glow::RGBA, + glow::UNSIGNED_INT_2_10_10_10_REV, + ), + Tf::Bgr10a2Unorm => ( + glow::RGB10_A2, // TODO: Unsupported? + glow::BGRA, + glow::UNSIGNED_INT_2_10_10_10_REV, + ), + Tf::Rg11b10Float => ( + glow::R11F_G11F_B10F, + glow::RGB, + glow::UNSIGNED_INT_10F_11F_11F_REV, + ), + Tf::Rgb9e5Ufloat => (glow::RGB9_E5, glow::RGB, glow::UNSIGNED_INT_5_9_9_9_REV), }; FormatInfo { internal, diff --git a/blade-graphics/src/lib.rs b/blade-graphics/src/lib.rs index 8eb16fc..f6f8b18 100644 --- a/blade-graphics/src/lib.rs +++ b/blade-graphics/src/lib.rs @@ -308,15 +308,15 @@ pub enum TextureFormat { Bc4Snorm, Bc5Unorm, Bc5Snorm, - Bc6UFloat, - Bc6SFloat, + Bc6hUfloat, + Bc6hSfloat, Bc7Unorm, Bc7UnormSrgb, // packed 32-bit Rgb10a2Unorm, Bgr10a2Unorm, Rg11b10Float, - Rgb9e5Float, + Rgb9e5Ufloat, } #[derive(Clone, Copy, Debug)] diff --git a/blade-graphics/src/util.rs b/blade-graphics/src/util.rs index a74ffcd..4989d90 100644 --- a/blade-graphics/src/util.rs +++ b/blade-graphics/src/util.rs @@ -84,14 +84,14 @@ impl super::TextureFormat { Self::Bc4Snorm => cx_bc(8), Self::Bc5Unorm => cx_bc(16), Self::Bc5Snorm => cx_bc(16), - Self::Bc6UFloat => cx_bc(16), - Self::Bc6SFloat => cx_bc(16), + Self::Bc6hUfloat => cx_bc(16), + Self::Bc6hSfloat => cx_bc(16), Self::Bc7Unorm => cx_bc(16), Self::Bc7UnormSrgb => cx_bc(16), Self::Rgb10a2Unorm => uncompressed(4), Self::Bgr10a2Unorm => uncompressed(4), Self::Rg11b10Float => uncompressed(4), - Self::Rgb9e5Float => uncompressed(4), + Self::Rgb9e5Ufloat => uncompressed(4), } } diff --git a/blade-graphics/src/vulkan/mod.rs b/blade-graphics/src/vulkan/mod.rs index 8da28f7..95d962a 100644 --- a/blade-graphics/src/vulkan/mod.rs +++ b/blade-graphics/src/vulkan/mod.rs @@ -557,14 +557,14 @@ fn map_texture_format(format: crate::TextureFormat) -> vk::Format { Tf::Bc4Snorm => vk::Format::BC4_SNORM_BLOCK, Tf::Bc5Unorm => vk::Format::BC5_UNORM_BLOCK, Tf::Bc5Snorm => vk::Format::BC5_SNORM_BLOCK, - Tf::Bc6UFloat => vk::Format::BC6H_UFLOAT_BLOCK, - Tf::Bc6SFloat => vk::Format::BC6H_SFLOAT_BLOCK, + Tf::Bc6hUfloat => vk::Format::BC6H_UFLOAT_BLOCK, + Tf::Bc6hSfloat => vk::Format::BC6H_SFLOAT_BLOCK, Tf::Bc7Unorm => vk::Format::BC7_UNORM_BLOCK, Tf::Bc7UnormSrgb => vk::Format::BC7_SRGB_BLOCK, Tf::Rgb10a2Unorm => vk::Format::A2R10G10B10_UNORM_PACK32, Tf::Bgr10a2Unorm => vk::Format::A2B10G10R10_UNORM_PACK32, Tf::Rg11b10Float => vk::Format::B10G11R11_UFLOAT_PACK32, - Tf::Rgb9e5Float => vk::Format::E5B9G9R9_UFLOAT_PACK32, + Tf::Rgb9e5Ufloat => vk::Format::E5B9G9R9_UFLOAT_PACK32, } }