Shader:getWorkgroupSize
EditReturns the workgroup size of a compute shader. The workgroup size defines how many times a compute shader is invoked for each workgroup dispatched by Pass:compute.
x, y, z = Shader:getWorkgroupSize()Arguments
None
Returns
| Name | Type | Description |
| x | number | The x size of a workgroup. |
| y | number | The y size of a workgroup. |
| z | number | The z size of a workgroup. |
Notes
For example, if the workgroup size is 8x8x1 and 16x16x16 workgroups are dispatched, then the compute shader will run 16 * 16 * 16 * (8 * 8 * 1) = 262144 times.
The maximum workgroup size is hardware-specific, and is given by the workgroupSize and totalWorkgroupSize limit in lovr.graphics.getLimits.