{"record":{"id":"67f882ea463d42b0","repo":"gfx-rs/wgpu","slug":"not-implemented-67f882","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"wgpu-hal/src/metal/command.rs","lineNumber":327,"sourceCode":"\n    /// Updates the bindings for a single shader stage, called in `set_bind_group`.\n    fn update_bind_group_state(\n        &mut self,\n        encoder: Encoder<'_>,\n        index_base: super::ResourceData<u32>,\n        bg_info: &super::BindGroupLayoutInfo,\n        dynamic_offsets: &[wgt::DynamicOffset],\n        group_index: u32,\n        group: &super::BindGroup,\n    ) {\n        use naga::ShaderStage as S;\n        let resource_indices = match encoder.stage() {\n            S::Vertex => &bg_info.base_resource_indices.vs,\n            S::Fragment => &bg_info.base_resource_indices.fs,\n            S::Task => &bg_info.base_resource_indices.ts,\n            S::Mesh => &bg_info.base_resource_indices.ms,\n            S::Compute => &bg_info.base_resource_indices.cs,\n            S::RayGeneration | S::AnyHit | S::ClosestHit | S::Miss => unimplemented!(),\n        };\n        let buffers = match encoder.stage() {\n            S::Vertex => group.counters.vs.buffers,\n            S::Fragment => group.counters.fs.buffers,\n            S::Task => group.counters.ts.buffers,\n            S::Mesh => group.counters.ms.buffers,\n            S::Compute => group.counters.cs.buffers,\n            S::RayGeneration | S::AnyHit | S::ClosestHit | S::Miss => unimplemented!(),\n        };\n        let mut changes_sizes_buffer = false;\n        for index in 0..buffers {\n            let res = &group.buffers[(index_base.buffers + index) as usize];\n            match res {\n                super::BufferLikeResource::Buffer {\n                    ptr,\n                    mut offset,\n                    dynamic_index,\n                    binding_size,","sourceCodeStart":309,"sourceCodeEnd":345,"githubUrl":"https://github.com/gfx-rs/wgpu/blob/3e11ff59bf3f9795d285ecc045014089640d7248/wgpu-hal/src/metal/command.rs#L309-L345","documentation":"This is a Rust `unimplemented!()` panic in wgpu-hal's Metal backend inside `update_bind_group_state`. The backend explicitly does not handle ray-tracing shader stages (RayGeneration, AnyHit, ClosestHit, Miss) when mapping bind group resources per stage; Metal has no hardware ray tracing pipeline support in this backend, so these stages are hard-stubbed. Hitting it means a bind group was bound with a pipeline layout that included ray-tracing stage visibility.","triggerScenarios":"Calling `CommandEncoder::set_bind_group` (or render/compute pass bind group binding) on a Metal device while the pipeline layout has bindings whose `visibility` includes ShaderStages::RAY_GENERATION, ANY_HIT, CLOSEST_HIT, or MISS; the stage match arm falls through to `unimplemented!()` at wgpu-hal/src/metal/command.rs:327.","commonSituations":"Porting code written for the Vulkan or DX12 backends (where ray tracing is partially supported) to Metal; sharing a pipeline layout across backends; accidentally requesting ray-tracing visibility flags on bindings used in a Metal app.","solutions":["Remove ray-tracing shader stages from all binding visibilities in the PipelineLayout used on Metal","Keep ray-tracing pipeline layouts behind a cfg/backend check and only construct them on backends that support ray tracing (Vulkan/DX12)","File or check an upstream issue for Metal ray tracing support; until then treat Metal as a non-ray-tracing backend"],"exampleFix":"// before\nlet layout = device.create_pipeline_layout(&PipelineLayoutDescriptor {\n    bind_group_layouts: &[&bgl_with_rt_visibility],\n    ..\n});\n// after\nlet bgl_desc.visibility = ShaderStages::VERTEX | ShaderStages::FRAGMENT; // drop RT stages on Metal","handlingStrategy":"validation","validationCode":"fn layout_is_metal_safe(layout: &PipelineLayoutDescriptor) -> bool {\n    const RT: ShaderStages = ShaderStages::RAY_GENERATION | ShaderStages::ANY_HIT | ShaderStages::CLOSEST_HIT | ShaderStages::MISS;\n    layout.bind_group_layouts.iter().flatten().all(|b| !b.visible_stages().intersects(RT))\n}","typeGuard":"fn uses_rt_stages(v: wgt::ShaderStages) -> bool {\n    v.intersects(wgt::ShaderStages::RAY_GENERATION | wgt::ShaderStages::ANY_HIT | wgt::ShaderStages::CLOSEST_HIT | wgt::ShaderStages::MISS)\n}","tryCatchPattern":null,"preventionTips":["Check AdapterInfo::backend before enabling any ray-tracing feature on macOS","Keep RT-visible bindings in layouts only constructed for Vulkan/DX12","Run cross-backend test suites against Metal early in CI"],"tags":["rust","metal","unimplemented","ray-tracing"],"backgroundTag":"unimplemented-metal-ray-tracing","analyzedSha":"3e11ff59bf3f9795d285ecc045014089640d7248","analyzedAt":"2026-09-03T01:43:21.459Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T07:17:11.731Z"}