Newbie question about @workgroup_size

Hello everyone. I’m new to webGPU and compute shaders and want to ask how to determine size of workgroup and what these values are used for. Also, do the values of @workgroup_size correspond the values (x, y, z) I pass to the computerShader.dispatch or computerShader.dispatchWhenReady methods, and if so, how? Thank you for your attention.

These resources can help you understand workgroups in compute shaders:

Note that compute shaders are not WebGPU-specific, so any resource about them that you find on the web should also be relevant to WebGPU.

3 Likes