diff --git a/wgpu-hal/src/dx12/device.rs b/wgpu-hal/src/dx12/device.rs index 7e14818572..c4d93caefc 100644 --- a/wgpu-hal/src/dx12/device.rs +++ b/wgpu-hal/src/dx12/device.rs @@ -20,7 +20,10 @@ impl super::Device { library: &Arc, dx12_shader_compiler: wgt::Dx12Compiler, ) -> Result { - let mem_allocator = super::suballocation::create_allocator_wrapper(&raw)?; + let mut mem_allocator = None; + if private_caps.suballocation_supported { + mem_allocator = super::suballocation::create_allocator_wrapper(&raw)?; + } let dxc_container = match dx12_shader_compiler { wgt::Dx12Compiler::Dxc { diff --git a/wgpu-hal/src/dx12/suballocation.rs b/wgpu-hal/src/dx12/suballocation.rs index 5def070814..5412aa3796 100644 --- a/wgpu-hal/src/dx12/suballocation.rs +++ b/wgpu-hal/src/dx12/suballocation.rs @@ -67,6 +67,7 @@ mod allocation { let is_cpu_read = desc.usage.contains(crate::BufferUses::MAP_READ); let is_cpu_write = desc.usage.contains(crate::BufferUses::MAP_WRITE); + // It's a workaround for Intel Xe drivers. if !device.private_caps.suballocation_supported { let heap_properties = d3d12_ty::D3D12_HEAP_PROPERTIES { Type: d3d12_ty::D3D12_HEAP_TYPE_CUSTOM, @@ -156,6 +157,7 @@ mod allocation { raw_desc: d3d12_ty::D3D12_RESOURCE_DESC, resource: &mut WeakPtr, ) -> Result<(HRESULT, Option), crate::DeviceError> { + // It's a workaround for Intel Xe drivers. if !device.private_caps.suballocation_supported { let heap_properties = d3d12_ty::D3D12_HEAP_PROPERTIES { Type: d3d12_ty::D3D12_HEAP_TYPE_CUSTOM,