{"record":{"id":"b8c3779637754069","repo":"gfx-rs/wgpu","slug":"feature-experimental-ray-tracing-not-enabled","errorCode":null,"errorMessage":"Feature `EXPERIMENTAL_RAY_TRACING` not enabled","messagePattern":"Feature `EXPERIMENTAL_RAY_TRACING` not enabled","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"wgpu-hal/src/vulkan/command.rs","lineNumber":1429,"sourceCode":"        if self.rpass_debug_marker_active {\n            unsafe { self.end_debug_marker() };\n            self.rpass_debug_marker_active = false\n        }\n    }\n\n    unsafe fn trace_rays(\n        &mut self,\n        count: [u32; 3],\n        ray_generation_group_data: crate::PipelineGroupData<super::Buffer>,\n        miss_group_data: crate::PipelineGroupData<super::Buffer>,\n        intersection_group_data: crate::PipelineGroupData<super::Buffer>,\n    ) {\n        let ray_tracing_functions = self\n            .device\n            .extension_fns\n            .ray_tracing\n            .as_ref()\n            .expect(\"Feature `EXPERIMENTAL_RAY_TRACING` not enabled\");\n\n        let ray_tracing_pipeline_functions = self\n            .device\n            .extension_fns\n            .ray_tracing_pipelines\n            .as_ref()\n            .expect(\"Feature `EXPERIMENTAL_RAY_TRACING_PIPELINES` not enabled\");\n\n        let get_device_address = |buffer: &super::Buffer| unsafe {\n            ray_tracing_functions\n                .buffer_device_address\n                .get_buffer_device_address(\n                    &vk::BufferDeviceAddressInfo::default().buffer(buffer.raw),\n                )\n        };\n\n        unsafe {\n            ray_tracing_pipeline_functions.cmd_trace_rays(","sourceCodeStart":1411,"sourceCodeEnd":1447,"githubUrl":"https://github.com/gfx-rs/wgpu/blob/3e11ff59bf3f9795d285ecc045014089640d7248/wgpu-hal/src/vulkan/command.rs#L1411-L1447","documentation":"`trace_rays` expects `device.extension_fns.ray_tracing` to be present, using `.expect(\"Feature `EXPERIMENTAL_RAY_TRACING` not enabled\")`. Note the different feature name: this is gated on wgpu's `EXPERIMENTAL_RAY_TRACING` flag. Dispatching a ray tracing pipeline without that experimental feature enabled at device creation — or without the Vulkan ray tracing functions loaded — panics here.","triggerScenarios":"Calling `trace_rays` (vkCmdTraceRays path) on a device created without `Features::EXPERIMENTAL_RAY_TRACING` in required_features, or where `extension_fns.ray_tracing` is None (extensions/functions not available).","commonSituations":"Using wgpu's experimental ray tracing pipeline API while forgetting the EXPERIMENTAL_RAY_TRACING feature bit (distinct from the stable RAY_TRACING one); adapters/driver combos where ray tracing extensions fail to load; code updated for the new feature name but devices still created with the old set.","solutions":["Add `Features::EXPERIMENTAL_RAY_TRACING` to required_features when creating the device","Re-check which feature flag your wgpu version requires (RAY_TRACING vs EXPERIMENTAL_RAY_TRACING) and match it to the API you call","Verify adapter support for VK_KHR_ray_tracing_pipeline and that the version of wgpu you use exposes the experimental feature","Fall back to compute-based ray tracing if the adapter lacks RT support"],"exampleFix":"// before\nlet device = adapter.create_device(&DeviceDescriptor {\n    required_features: wgpu::Features::RAY_TRACING,\n    ..Default::default()\n})?;\n// after: experimental pipelines need the experimental flag\nlet device = adapter.create_device(&DeviceDescriptor {\n    required_features: wgpu::Features::EXPERIMENTAL_RAY_TRACING,\n    ..Default::default()\n})?;","handlingStrategy":"validation","validationCode":"if !adapter.features().contains(wgpu::Features::EXPERIMENTAL_RAY_TRACING) {\n    return Err(Error::ExperimentalRayTracingUnsupported);\n}\nlet device = adapter.create_device(&DeviceDescriptor {\n    required_features: wgpu::Features::EXPERIMENTAL_RAY_TRACING,\n    ..Default::default()\n})?;","typeGuard":"fn supports_experimental_ray_tracing(features: wgpu::Features) -> bool {\n    features.contains(wgpu::Features::EXPERIMENTAL_RAY_TRACING)\n}","tryCatchPattern":"// check before dispatching rays; do not rely on catching the panic:\nif !device.features().contains(wgpu::Features::EXPERIMENTAL_RAY_TRACING) {\n    return Err(Error::ExperimentalRayTracingUnsupported);\n}\nencoder.trace_rays(...);","preventionTips":["Enable Features::EXPERIMENTAL_RAY_TRACING (not just RAY_TRACING) when using trace_rays","Track wgpu changelogs: experimental feature names change between versions","Check adapter features and driver support for VK_KHR_ray_tracing_pipeline","Provide a compute-shader fallback when experimental RT is unavailable"],"tags":["vulkan","ray-tracing","feature-not-enabled","panic"],"backgroundTag":"required-feature-not-enabled","analyzedSha":"3e11ff59bf3f9795d285ecc045014089640d7248","analyzedAt":"2026-09-03T01:43:21.459Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T07:17:11.731Z"}