gfx-rs/wgpu · error
Format {texture_format:?} has no WebGPU equivalent
Error message
Format {texture_format:?} has no WebGPU equivalent What it means
Panic in the WebGPU backend's map_texture_format: the wgpu texture format has no equivalent in the browser's GPUTextureFormat (e.g. a native-only format). Any operation needing the JS-side format (create_texture, create_view, pipeline setup) aborts; the faulty input is texture_format.
Source
Thrown at wgpu/src/backend/webgpu.rs:359
},
wgt::AstcChannel::UnormSrgb => match block {
wgt::AstcBlock::B4x4 => tf::Astc4x4UnormSrgb,
wgt::AstcBlock::B5x4 => tf::Astc5x4UnormSrgb,
wgt::AstcBlock::B5x5 => tf::Astc5x5UnormSrgb,
wgt::AstcBlock::B6x5 => tf::Astc6x5UnormSrgb,
wgt::AstcBlock::B6x6 => tf::Astc6x6UnormSrgb,
wgt::AstcBlock::B8x5 => tf::Astc8x5UnormSrgb,
wgt::AstcBlock::B8x6 => tf::Astc8x6UnormSrgb,
wgt::AstcBlock::B8x8 => tf::Astc8x8UnormSrgb,
wgt::AstcBlock::B10x5 => tf::Astc10x5UnormSrgb,
wgt::AstcBlock::B10x6 => tf::Astc10x6UnormSrgb,
wgt::AstcBlock::B10x8 => tf::Astc10x8UnormSrgb,
wgt::AstcBlock::B10x10 => tf::Astc10x10UnormSrgb,
wgt::AstcBlock::B12x10 => tf::Astc12x10UnormSrgb,
wgt::AstcBlock::B12x12 => tf::Astc12x12UnormSrgb,
},
wgt::AstcChannel::Hdr => {
unimplemented!("Format {texture_format:?} has no WebGPU equivalent")
}
},
_ => unimplemented!("Format {texture_format:?} has no WebGPU equivalent"),
}
}
fn map_texture_component_type(
sample_type: wgt::TextureSampleType,
) -> webgpu_sys::GpuTextureSampleType {
use webgpu_sys::GpuTextureSampleType as ts;
use wgt::TextureSampleType;
match sample_type {
TextureSampleType::Float { filterable: true } => ts::Float,
TextureSampleType::Float { filterable: false } => ts::UnfilterableFloat,
TextureSampleType::Sint => ts::Sint,
TextureSampleType::Uint => ts::Uint,
TextureSampleType::Depth => ts::Depth,
}View on GitHub (pinned to 3e11ff59bf)
Solutions
- Use a format that exists in the WebGPU JS API when targeting WASM
- Query/validate the format against map_texture_format support before creating resources on the web backend
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at wgpu/src/backend/webgpu.rs:359 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/38560940a65af643.
Report an issue: GitHub.