Skip to content

Multithreading support status in wgpu #4814

Answered by cwfitzgerald
lisyarus asked this question in Q&A
Discussion options

You must be logged in to vote

General rule of thumb: if the method takes &mut self in rust, it must not be called at the same time as any other methods on the type. If it takes &self, it may be called at the same time as any other &self method.

What this means is, all wgpu types may be used across threads, except command encoders and renderpass encoders. These must be guarded by a mutex if you were to use the same encoder on multiple threads at the same time. You can however use multiple command encoders from different threads.

This is actually getting standardized as part of webgpu.h standardization.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lisyarus
Comment options

Answer selected by lisyarus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants