getWorkgroupSize.lua 854 B

1234567891011121314151617181920212223242526272829303132
  1. return {
  2. summary = 'Get the workgroup size of a compute shader.',
  3. description = [[
  4. Returns the workgroup size of a compute shader. The workgroup size defines how many times a
  5. compute shader is invoked for each workgroup dispatched by `Pass:compute`.
  6. ]],
  7. arguments = {},
  8. returns = {
  9. x = {
  10. type = 'number',
  11. description = 'The x size of a workgroup.'
  12. },
  13. y = {
  14. type = 'number',
  15. description = 'The y size of a workgroup.'
  16. },
  17. z = {
  18. type = 'number',
  19. description = 'The z size of a workgroup.'
  20. }
  21. },
  22. variants = {
  23. {
  24. arguments = {},
  25. returns = { 'x', 'y', 'z' }
  26. }
  27. },
  28. notes = [[
  29. For example, if the workgroup size is `8x8x1` and `16x16x16` workgroups are dispatched, then the
  30. compute shader will run `16 * 16 * 16 * (8 * 8 * 1) = 262144` times.
  31. ]]
  32. }