setTallyBuffer.lua 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. return {
  2. tag = 'tally',
  3. summary = 'Set the Buffer that tally results will be written to.',
  4. description = [[
  5. Sets the Buffer where tally results will be written to. Each time the render pass finishes, the
  6. results of all the tallies will be copied to the Buffer at the specified offset. The buffer can
  7. be used in a later pass in a compute shader, or the data in the buffer can be read back using
  8. e.g. `Buffer:newReadback`.
  9. ]],
  10. arguments = {
  11. buffer = {
  12. type = 'Buffer',
  13. description = 'The buffer.'
  14. },
  15. offset = {
  16. type = 'number',
  17. description = 'A byte offset where results will be written. Must be a multiple of 4.'
  18. }
  19. },
  20. returns = {},
  21. variants = {
  22. {
  23. arguments = { 'buffer', 'offset' },
  24. returns = {}
  25. },
  26. {
  27. description = 'Unset the tally buffer.',
  28. arguments = {},
  29. returns = {}
  30. }
  31. },
  32. notes = [[
  33. Each tally result is a 4-byte unsigned integer with the number of samples that passed the depth
  34. and stencil tests.
  35. If the buffer doesn't have enough room to store all the tallies, the number of tallies copied
  36. will be clamped to the minimum number that will fit.
  37. ]],
  38. related = {
  39. 'Pass:beginTally',
  40. 'Pass:finishTally'
  41. }
  42. }