gfx-rs/wgpu · error
ray tracing pipelines not yet implemented
Error message
ray tracing pipelines not yet implemented
What it means
The DX12 HAL does not implement ray tracing pipelines; get_raytracing_pipeline_group_data is a hard stub that panics with 'ray tracing pipelines not yet implemented'. Any call into the ray-tracing pipeline API on this backend is guaranteed to panic.
Source
Thrown at wgpu-hal/src/dx12/device.rs:2314
_desc: &crate::RayTracingPipelineDescriptor<
super::PipelineLayout,
super::ShaderModule,
super::PipelineCache,
>,
) -> Result<<Self::A as crate::Api>::RayTracingPipeline, crate::PipelineError> {
unreachable!("ray tracing pipelines not yet implemented")
}
unsafe fn destroy_ray_tracing_pipeline(&self, _pipeline: super::RayTracingPipeline) {
unreachable!("ray tracing pipelines not yet implemented")
}
unsafe fn get_raytracing_pipeline_group_data(
&self,
_pipeline: &super::RayTracingPipeline,
_groups: core::ops::Range<u32>,
) -> Result<Vec<u8>, crate::DeviceError> {
unimplemented!("ray tracing pipelines not yet implemented")
}
unsafe fn create_pipeline_cache(
&self,
_desc: &crate::PipelineCacheDescriptor<'_>,
) -> Result<super::PipelineCache, crate::PipelineCacheError> {
Ok(super::PipelineCache)
}
unsafe fn destroy_pipeline_cache(&self, _: super::PipelineCache) {}
unsafe fn create_query_set(
&self,
desc: &wgt::QuerySetDescriptor<crate::Label>,
) -> Result<super::QuerySet, crate::DeviceError> {
let (heap_ty, raw_ty) = match desc.ty {
wgt::QueryType::Occlusion => (
Direct3D12::D3D12_QUERY_HEAP_TYPE_OCCLUSION,
Direct3D12::D3D12_QUERY_TYPE_BINARY_OCCLUSION,View on GitHub (pinned to 3e11ff59bf)
Solutions
- Use the Vulkan backend (or another backend with ray tracing implemented) for ray tracing workloads
- Check backend ray tracing support before calling any ray-tracing API (feature/back capability probe)
- Implement the DX12 path with ID3D12Device5 RayTracingPipeline subobjects if you control the fork
- Downgrade to compute-based ray tracing (BVH traversal in compute shaders) when targeting DX12
Example fix
// before let groups = device.get_raytracing_pipeline_group_data(&pipeline, 0..n); // panics on dx12 // after assert!(matches!(backend, Backend::Vulkan), "ray tracing only supported on vulkan"); let groups = device.get_raytracing_pipeline_group_data(&pipeline, 0..n);
Defensive patterns
Strategy: fallback
Validate before calling
// before using any ray tracing API, confirm backend support: let rt_supported = matches!(backend, wgpu::Backend::Vulkan); // dx12/metal/gles lack it
Type guard
fn supports_ray_tracing(b: wgpu::Backend) -> bool { matches!(b, wgpu::Backend::Vulkan) } Try / catch
// hal methods panic, not Result; wrap usage behind a capability check:
if !supports_ray_tracing(backend) { return Err("ray tracing unavailable on this backend"); } Prevention
- Never call ray-tracing hal APIs on the DX12 backend
- Probe backend/feature support at init and fail fast
- Track wgpu-hal releases for DX12 ray tracing implementation
- Provide compute-shader ray tracing fallback
When it happens
Trigger: Calling get_raytracing_pipeline_group_data (part of the hal ray-tracing pipeline surface) on a Dx12 device — e.g. while creating/inspecting shader binding table group data for a ray tracing pipeline.
Common situations: Trying to use ray tracing through wgpu-hal's experimental API on DX12; assuming feature parity with the Vulkan backend; enabling ray tracing feature flags without checking backend support.
Related errors
- Feature `MESH_SHADING` not enabled
- {:?} is not enabled for this backend
- metal does not support vertex ray hit return
- not implemented
- not implemented
AI-assisted analysis of gfx-rs/wgpu@3e11ff59bf (2026-09-03).
Data as JSON: /api/errors/327bff9a3283cb58.
Report an issue: GitHub.