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