gfx-rs/wgpu · error

Memory footprint for format {f:?} is not implemented

Error message

Memory footprint for format {f:?} is not implemented

What it means

Panic in TextureFormat::theoretical_memory_footprint: the format f has a hand-written per-pixel size in the catch-all match (e.g. a stencil-only or newly added format), so the helper cannot compute its footprint. The faulty input is the specific texture format.

Source

Thrown at wgpu-types/src/texture/format.rs:1668

            None => match self {
                // One f16 per pixel
                Self::Depth16Unorm => 2,
                // One u24 per pixel, padded to 4 bytes
                Self::Depth24Plus => 4,
                // One u24 per pixel, plus one u8 per pixel
                Self::Depth24PlusStencil8 => 4,
                // One f32 per pixel
                Self::Depth32Float => 4,
                // One f32 per pixel, plus one u8 per pixel, with 3 bytes intermediary padding
                Self::Depth32FloatStencil8 => 8,
                // One u8 per pixel
                Self::Stencil8 => 1,
                // Two chroma bytes per block, one luma byte per block
                Self::NV12 => 3,
                // Two chroma u16s and one luma u16 per block
                Self::P010 => 6,
                f => {
                    unimplemented!("Memory footprint for format {f:?} is not implemented");
                }
            },
        };

        let width_blocks = size.width.div_ceil(block_width) as u64;
        let height_blocks = size.height.div_ceil(block_height) as u64;

        let total_blocks = width_blocks * height_blocks * size.depth_or_array_layers as u64;

        total_blocks * approximate_block_size as u64
    }
}

#[cfg(any(feature = "serde", test))]
impl<'de> Deserialize<'de> for TextureFormat {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,

View on GitHub (pinned to 3e11ff59bf)

Solutions

  1. Use one of the formats with a known footprint
  2. Add an explicit per-pixel size entry for the format in this match
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at wgpu-types/src/texture/format.rs:1668 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of gfx-rs/wgpu@3e11ff59bf (2026-09-03). Data as JSON: /api/errors/b3429fb30b53aa3b. Report an issue: GitHub.