Shader:getWorkgroupSize

Edit

Returns 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

NameTypeDescription
xnumber The x size of a workgroup.
ynumber The y size of a workgroup.
znumber 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.

See also