wgpu::CommandEncoder, wgpu::RenderPassEncoder, wgpu::ComputePassEncoder, wgpu::RenderBundleEncoder are the recording interfaces.
The only thing safe to do multithreaded is after making a command encoder, record certain types of commands on it on another thread, and then call CommandEncoder::Finish() to get a wgpu::CommandBuffer. You need to synchronize access to the queue if you want to submit the wgpu::CommandBuffer on the main thread.
Types of commands you should not record multithreaded:
- Indirect draw commands - that will not be thread-safe since internally it allocates extra buffers.