1.7 KiB
1.7 KiB
Implicit Device Synchronization
implicit-device-sync
is an experimental feature that offers multithreading support for dawn_native
.
Additional functionality:
wgpu::Device
and most of its child objects are safe to be used on multiple threads, including:wgpu::Queue
.wgpu::BindGroup
.wgpu::BindGroupLayout
.wgpu::Buffer
. See Notes.wgpu::Texture
.wgpu::TextureView
.wgpu::ComputePipeline
.wgpu::RenderPipeline
.wgpu::PipelineLayout
.wgpu::Sampler
.wgpu::ShaderModule
.wgpu::SwapChain
.
- These objects are not safe to be used concurrently:
wgpu:CommandEncoder
.wgpu:ComputePassEncoder
.wgpu:RenderPassEncoder
.wgpu:RenderBundleEncoder
.- Except that the creation, referencing, releasing and destruction of these objects are guaranteed to be thread safe.
Notes:
- This feature is experimental, meaning currently it has some limitations:
- For
wgpu::Buffer
to be safe on multiple threads. Proper manual synchronization must be done by users to ensure that the buffer is not currently being mapped and being used by any render/compute pass encoder at the same time on different threads. - Enabling this feature will disable the compatibility between
wgpu::BindGroupLayout
. That means the two differentwgpu::BindGroupLayout
objects created with equivalentwgpu::BindGroupLayoutDescriptor
won't be considered "group-equivalent" anymore. You can only use awgpu::BindGroup
with awgpu::RenderPipeline
/wgpu::ComputePipeline
if they are both created with the samewgpu::BindGroupLayout
.- Consider using
wgpu::RenderPipeline::GetBindGroupLayout()
/wgpu::ComputePipeline::GetBindGroupLayout()
when creating awgpu::BindGroup
.
- Consider using
- For