gfx-rs/wgpu · error

not implemented

Error message

not implemented

What it means

create_pipeline_layout in the GLES backend panics with `unimplemented!()` when a bind group layout entry has BindingType::AccelerationStructure. OpenGL ES has no acceleration structure bindings, so the layout cannot count/map them to uniform or storage buffer slots.

Source

Thrown at wgpu-hal/src/gles/device.rs:1430

                    .max()
                    .map_or(0, |idx| idx as usize + 1)
            ]
            .into_boxed_slice();

            for entry in bg_layout.entries.iter() {
                let counter = match entry.ty {
                    wgt::BindingType::Sampler { .. } => &mut num_samplers,
                    wgt::BindingType::Texture { .. } => &mut num_textures,
                    wgt::BindingType::StorageTexture { .. } => &mut num_images,
                    wgt::BindingType::Buffer {
                        ty: wgt::BufferBindingType::Uniform,
                        ..
                    } => &mut num_uniform_buffers,
                    wgt::BindingType::Buffer {
                        ty: wgt::BufferBindingType::Storage { .. },
                        ..
                    } => &mut num_storage_buffers,
                    wgt::BindingType::AccelerationStructure { .. } => unimplemented!(),
                    wgt::BindingType::ExternalTexture => unimplemented!(),
                };

                binding_to_slot[entry.binding as usize] = *counter;
                let br = naga::ResourceBinding {
                    group: group_index as u32,
                    binding: entry.binding,
                };
                binding_map.insert(br, *counter);
                *counter += entry.count.map_or(1, |c| c.get() as u8);
            }

            group_infos.push(Some(super::BindGroupLayoutInfo {
                entries: Arc::clone(&bg_layout.entries),
                binding_to_slot,
            }));
        }

View on GitHub (pinned to 3e11ff59bf)

Solutions

  1. Do not include AccelerationStructure bindings in layouts used with the GLES backend
  2. Gate RT-related bind group layouts (and their pipelines) behind a backend/capability check
  3. Use a Vulkan/DX12/Metal backend for ray-tracing pipelines

Example fix

// before
let layout = device.create_pipeline_layout(&wgt::PipelineLayoutDescriptor { bind_group_layouts: &[&bgl_with_tlas], .. });
// after
if uses_acceleration_structures(&bgl_with_tlas) && adapter_info.backend == wgt::Backend::Gl {
    return Err(Error::RayTracingNotSupportedOnGles);
}
let layout = device.create_pipeline_layout(&wgt::PipelineLayoutDescriptor { bind_group_layouts: &[&bgl_with_tlas], .. });
Defensive patterns

Strategy: validation

Validate before calling

fn layout_uses_acceleration_structure(l: &wgt::PipelineLayoutDescriptor) -> bool {
    l.bind_group_layouts.iter().flatten().any(|b| b.entries.iter().any(|e| matches!(e.ty, wgt::BindingType::AccelerationStructure { .. })))
}

Type guard

fn is_acceleration_structure_ty(t: wgt::BindingType) -> bool { matches!(t, wgt::BindingType::AccelerationStructure { .. }) }

Try / catch

match device.create_pipeline_layout(&layout_desc) {
    Ok(l) => l,
    Err(e) => { log::error!("layout creation failed: {e}"); Err(e) }
}

Prevention

When it happens

Trigger: Calling device.create_pipeline_layout (or a pipeline creation that implies it) where any referenced BindGroupLayout contains a ray-tracing acceleration-structure binding on the GLES backend.

Common situations: Sharing bind group layout definitions between RT and raster pipelines while running on GL/WebGL; enabling ray tracing behind a feature flag that still reaches pipeline layout creation on GLES.

Related errors


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