gfx-rs/wgpu · error
not implemented
Error message
not implemented
What it means
describe_vertex_format in the GLES backend has no mapping for 64-bit float vertex formats (Float64, Float64x2, Float64x3, Float64x4) and panics with `unimplemented!()`. OpenGL ES does not support 64-bit (double) vertex attributes, unlike desktop GL/GL_ARB_vertex_attrib_64bit.
Source
Thrown at wgpu-hal/src/gles/conv.rs:228
Vf::Snorm16x4 => (4, glow::SHORT, Vak::Float),
Vf::Uint16x4 => (4, glow::UNSIGNED_SHORT, Vak::Integer),
Vf::Sint16x4 => (4, glow::SHORT, Vak::Integer),
Vf::Float16x4 => (4, glow::HALF_FLOAT, Vak::Float),
Vf::Uint32 => (1, glow::UNSIGNED_INT, Vak::Integer),
Vf::Sint32 => (1, glow::INT, Vak::Integer),
Vf::Float32 => (1, glow::FLOAT, Vak::Float),
Vf::Uint32x2 => (2, glow::UNSIGNED_INT, Vak::Integer),
Vf::Sint32x2 => (2, glow::INT, Vak::Integer),
Vf::Float32x2 => (2, glow::FLOAT, Vak::Float),
Vf::Uint32x3 => (3, glow::UNSIGNED_INT, Vak::Integer),
Vf::Sint32x3 => (3, glow::INT, Vak::Integer),
Vf::Float32x3 => (3, glow::FLOAT, Vak::Float),
Vf::Uint32x4 => (4, glow::UNSIGNED_INT, Vak::Integer),
Vf::Sint32x4 => (4, glow::INT, Vak::Integer),
Vf::Float32x4 => (4, glow::FLOAT, Vak::Float),
Vf::Unorm10_10_10_2 => (4, glow::UNSIGNED_INT_2_10_10_10_REV, Vak::Float),
Vf::Unorm8x4Bgra => (glow::BGRA as i32, glow::UNSIGNED_BYTE, Vak::Float),
Vf::Float64 | Vf::Float64x2 | Vf::Float64x3 | Vf::Float64x4 => unimplemented!(),
};
super::VertexFormatDesc {
element_count,
element_format,
attrib_kind,
}
}
pub fn map_filter_modes(
min: wgt::FilterMode,
mag: wgt::FilterMode,
mip: wgt::MipmapFilterMode,
) -> (u32, u32) {
use wgt::FilterMode as Fm;
use wgt::MipmapFilterMode as Mfm;
let mag_filter = match mag {View on GitHub (pinned to 3e11ff59bf)
Solutions
- Change the vertex format to f32 variants (float32, float32x2, ...) and convert doubles to floats on the CPU (or encode with a fixed-point/split-half encoding)
- If double precision is required, pack doubles into two u32 components (float64 emulation via mathf64x2-style unpacking in the shader)
- Validate vertex layouts at startup and reject float64 formats when the backend is GLES
Example fix
// before
attributes: [wgt::VertexAttribute { format: wgt::VertexFormat::Float64x3, offset: 0, shader_location: 0 }]
// after
attributes: [wgt::VertexAttribute { format: wgt::VertexFormat::Float32x3, offset: 0, shader_location: 0 }] Defensive patterns
Strategy: validation
Validate before calling
fn assert_no_f64_vertex_layout(layout: &wgt::VertexBufferLayout) -> Result<(), String> {
for a in &layout.attributes {
if matches!(a.format, wgt::VertexFormat::Float64 | wgt::VertexFormat::Float64x2 | wgt::VertexFormat::Float64x3 | wgt::VertexFormat::Float64x4) {
return Err(format!("float64 vertex format not supported on GLES: {:?}", a.format));
}
}
Ok(())
} Type guard
fn is_f64_vertex_format(f: wgt::VertexFormat) -> bool {
matches!(f, wgt::VertexFormat::Float64 | wgt::VertexFormat::Float64x2 | wgt::VertexFormat::Float64x3 | wgt::VertexFormat::Float64x4)
} Try / catch
match device.create_render_pipeline(&desc) {
Ok(p) => p,
Err(e) => { log::error!("pipeline creation failed (check float64 attributes on GLES): {e}"); fallback_pipeline() }
} Prevention
- Use Float32 vertex formats on GLES/WebGL targets
- Convert doubles to f32 on the CPU or pack into u32 pairs and unpack in the shader
- Audit vertex layouts when porting desktop pipelines to mobile/web
When it happens
Trigger: Creating a render pipeline whose vertex buffer layout uses vertex_format: "float64", "float64x2", "float64x3" or "float64x4" while running on the GLES backend (e.g. WebGL2), which calls conv::describe_vertex_format during create_render_pipeline.
Common situations: Porting desktop (Vulkan/D3D) code using double-precision vertex data to a WebGL/GLES target; accidentally leaving debug f64 attributes in shaders/vertex layouts; targeting Android/iOS where GLES is the backend.
Related errors
- not implemented
- not implemented
- VERTEX_ATTRIBUTE_64BIT feature must be enabled to use Double
- not implemented
- metal does not support vertex ray hit return
AI-assisted analysis of gfx-rs/wgpu@3e11ff59bf (2026-09-03).
Data as JSON: /api/errors/346f222995363968.
Report an issue: GitHub.