Skip to content

Why choose a workgroup size of 64 by default for compute shaders? #195

Answered by greggman
BassP97 asked this question in Q&A
Discussion options

You must be logged in to vote

This is advice comes from here

https://codelabs.developers.google.com/your-first-webgpu-app#7

Note: For more advanced uses of compute shaders, the workgroup size becomes more important. Shader invocations within a single workgroup are allowed to share faster memory and use certain types of synchronization primitives. You don't need any of that, though, since your shader executions are fully independent.

You could make the workgroup size (1 x 1 x 1), and it would still work correctly, but that also restricts how well the GPU can run the shader in parallel. Picking something bigger helps the GPU divide the work better.

There is a theoretical ideal workgroup size for every GPU, but it's dep…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by BassP97
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