newReadback.lua 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. return {
  2. tag = 'buffer-transfer',
  3. summary = 'Read back the contents of the Buffer asynchronously.',
  4. description = [[
  5. Creates and returns a new `Readback` that will download the data in the Buffer from VRAM. Once
  6. the readback is complete, `Readback:getData` returns the data as a table, or `Readback:getBlob`
  7. returns the data as a `Blob`.
  8. ]],
  9. arguments = {
  10. offset = {
  11. type = 'number',
  12. default = '0',
  13. description = 'A byte offset to read from.'
  14. },
  15. extent = {
  16. type = 'number',
  17. default = 'nil',
  18. description = 'The number of bytes to read. If nil, reads the rest of the buffer.'
  19. }
  20. },
  21. returns = {
  22. readback = {
  23. type = 'Readback',
  24. description = 'A new Readback object.'
  25. }
  26. },
  27. variants = {
  28. {
  29. arguments = { 'offset', 'extent' },
  30. returns = { 'readback' }
  31. }
  32. },
  33. notes = [[
  34. The offset and extent arguments must be a multiple of the Buffer's stride (unless it was created
  35. without a format).
  36. ]],
  37. related = {
  38. 'Buffer:getData',
  39. 'Texture:newReadback'
  40. }
  41. }