@@ -77,6 +77,12 @@ mod webgpu_impl {
7777
7878 #[ doc( hidden) ]
7979 pub const WEBGPU_FEATURE_IMMEDIATES : u64 = 1 << 15 ;
80+
81+ #[ doc( hidden) ]
82+ pub const WEBGPU_FEATURE_TEXTURE_FORMATS_TIER1 : u64 = 1 << 15 ;
83+
84+ #[ doc( hidden) ]
85+ pub const WEBGPU_FEATURE_TEXTURE_FORMATS_TIER2 : u64 = 1 << 16 ;
8086}
8187
8288macro_rules! bitflags_array_impl {
@@ -590,20 +596,11 @@ bitflags_array! {
590596 // ? const 32BIT_FORMAT_MULTISAMPLE = 1 << ??; (https://github.com/gpuweb/gpuweb/issues/3844)
591597 // ? const 32BIT_FORMAT_RESOLVE = 1 << ??; (https://github.com/gpuweb/gpuweb/issues/3844)
592598 // ? const TEXTURE_COMPRESSION_ASTC_HDR = 1 << ??; (https://github.com/gpuweb/gpuweb/issues/3856)
593- // TEXTURE_FORMAT_16BIT_NORM & TEXTURE_COMPRESSION_ASTC_HDR will most likely become web features as well
599+ // TEXTURE_COMPRESSION_ASTC_HDR will most likely become web features as well
594600 // TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES might not be necessary if we have all the texture features implemented
595601
596602 // Texture Formats:
597603
598- /// Enables normalized `16-bit` texture formats.
599- ///
600- /// Supported platforms:
601- /// - Vulkan
602- /// - DX12
603- /// - Metal
604- ///
605- /// This is a native only feature.
606- const TEXTURE_FORMAT_16BIT_NORM = 1 << 1 ;
607604 /// Enables ASTC HDR family of compressed textures.
608605 ///
609606 /// Compressed textures sacrifice some quality in exchange for significantly reduced
@@ -1544,6 +1541,99 @@ bitflags_array! {
15441541 /// This is a web and native feature.
15451542 const DUAL_SOURCE_BLENDING = WEBGPU_FEATURE_DUAL_SOURCE_BLENDING ;
15461543
1544+ /// Implies [`Features::RG11B10UFLOAT_RENDERABLE`]. Adds the following texture format
1545+ /// support (TODO: translate to `rustdoc` links):
1546+ ///
1547+ /// - TODO: validate: Enables the following formats with `RENDER_ATTACHMENT`, `blendable`,
1548+ /// `multisampling` capabilities and the `STORAGE_BINDING` capability with `read-only`
1549+ /// and `write-only` storage texture accesses:
1550+ ///
1551+ /// - [`R16Unorm`]
1552+ /// - [`R16Snorm`]
1553+ /// - [`Rg16Unorm`]
1554+ /// - [`Rg16Snorm`]
1555+ /// - [`Rgba16Unorm`]
1556+ /// - [`Rgba16Snorm`]
1557+ ///
1558+ /// - TODO: validate: Allows the `RENDER_ATTACHMENT`, `blendable`, `multisampling` and
1559+ /// `resolve` capabilities on below texture formats:
1560+ ///
1561+ /// - [`R8Snorm`]
1562+ /// - [`Rg8Snorm`]
1563+ /// - [`Rgba8Snorm`]
1564+ ///
1565+ /// - TODO: validate: Allows the `read-only` and `write-only` storage texture accesses on
1566+ /// below texture formats:
1567+ ///
1568+ /// - [`R8Unorm`]
1569+ /// - [`R8Snorm`]
1570+ /// - [`R8Uint`]
1571+ /// - [`R8Sint`]
1572+ /// - [`Rg8Unorm`]
1573+ /// - [`Rg8Snorm`]
1574+ /// - [`Rg8Uint`]
1575+ /// - [`Rg8Sint`]
1576+ /// - [`R16Uint`]
1577+ /// - [`R16Sint`]
1578+ /// - [`R16Float`]
1579+ /// - [`Rg16Uint`]
1580+ /// - [`Rg16Sint`]
1581+ /// - [`Rg16Float`]
1582+ /// - [`Rgb10A2uint`]
1583+ /// - [`Rgb10A2unorm`]
1584+ /// - [`Rg11B10ufloat`]
1585+ ///
1586+ /// [`R16Float`]: super::TextureFormat::R16Float
1587+ /// [`R16Sint`]: super::TextureFormat::R16Sint
1588+ /// [`R16Snorm`]: super::TextureFormat::R16Snorm
1589+ /// [`R16Uint`]: super::TextureFormat::R16Uint
1590+ /// [`R16Unorm`]: super::TextureFormat::R16Unorm
1591+ /// [`R8Sint`]: super::TextureFormat::R8Sint
1592+ /// [`R8Snorm`]: super::TextureFormat::R8Snorm
1593+ /// [`R8Uint`]: super::TextureFormat::R8Uint
1594+ /// [`R8Unorm`]: super::TextureFormat::R8Unorm
1595+ /// [`Rg11B10ufloat`]: super::TextureFormat::Rg11B10ufloat
1596+ /// [`Rg16Float`]: super::TextureFormat::Rg16Float
1597+ /// [`Rg16Sint`]: super::TextureFormat::Rg16Sint
1598+ /// [`Rg16Snorm`]: super::TextureFormat::Rg16Snorm
1599+ /// [`Rg16Uint`]: super::TextureFormat::Rg16Uint
1600+ /// [`Rg16Unorm`]: super::TextureFormat::Rg16Unorm
1601+ /// [`Rg8Sint`]: super::TextureFormat::Rg8Sint
1602+ /// [`Rg8Snorm`]: super::TextureFormat::Rg8Snorm
1603+ /// [`Rg8Snorm`]: super::TextureFormat::Rg8Snorm
1604+ /// [`Rg8Uint`]: super::TextureFormat::Rg8Uint
1605+ /// [`Rg8Unorm`]: super::TextureFormat::Rg8Unorm
1606+ /// [`Rgb10A2uint`]: super::TextureFormat::Rgb10A2uint
1607+ /// [`Rgb10A2unorm`]: super::TextureFormat::Rgb10A2unorm
1608+ /// [`Rgba16Snorm`]: super::TextureFormat::Rgba16Snorm
1609+ /// [`Rgba16Unorm`]: super::TextureFormat::Rgba16Unorm
1610+ /// [`Rgba8Snorm`]: super::TextureFormat::Rgba8Snorm
1611+ ///
1612+ /// This is a WebGPU equivalent to requesting [`Features::TEXTURE_FORMAT_16BIT_NORM`].
1613+ /// TODO: Just migrate that feature to this one, maybe?
1614+ const TEXTURE_FORMATS_TIER1 = WEBGPU_FEATURE_TEXTURE_FORMATS_TIER1 ;
1615+
1616+ /// Implies [`Feature::TEXTURE_FORMATS_TIER1`]. Enables
1617+ /// [`TextureFormatFeatureFlags::STORAGE_READ_WRITE`](super::TextureFormatFeatureFlags::STORAGE_READ_WRITE)
1618+ /// for the various formats listed below.
1619+ ///
1620+ /// - [`R8Unorm`](super::TextureFormat::R8Unorm)
1621+ /// - [`R8Uint`](super::TextureFormat::R8Uint)
1622+ /// - [`R8Sint`](super::TextureFormat::R8Sint)
1623+ /// - [`Rgba8Unorm`](super::TextureFormat::Rgba8Unorm)
1624+ /// - [`Rgba8Uint`](super::TextureFormat::Rgba8Uint)
1625+ /// - [`Rgba8Sint`](super::TextureFormat::Rgba8Sint)
1626+ /// - [`R16Uint`](super::TextureFormat::R16Uint)
1627+ /// - [`R16Sint`](super::TextureFormat::R16Sint)
1628+ /// - [`R16Float`](super::TextureFormat::R16Float)
1629+ /// - [`Rgba16Uint`](super::TextureFormat::Rgba16Uint)
1630+ /// - [`Rgba16Sint`](super::TextureFormat::Rgba16Sint)
1631+ /// - [`Rgba16Float`](super::TextureFormat::Rgba16Float)
1632+ /// - [`Rgba32Uint`](super::TextureFormat::Rgba32Uint)
1633+ /// - [`Rgba32Sint`](super::TextureFormat::Rgba32Sint)
1634+ /// - [`Rgba32Float`](super::TextureFormat::Rgba32Float)
1635+ const TEXTURE_FORMATS_TIER2 = WEBGPU_FEATURE_TEXTURE_FORMATS_TIER2 ;
1636+
15471637 /// Allows the use of immediate data: small, fast bits of memory that can be updated
15481638 /// inside a [`RenderPass`].
15491639 ///
0 commit comments