send.lua 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. return {
  2. summary = 'Update a variable in the ShaderBlock.',
  3. description = 'Updates a variable in the ShaderBlock.',
  4. arguments = {
  5. variable = {
  6. type = 'string',
  7. description = 'The name of the variable to update.'
  8. },
  9. value = {
  10. type = '*',
  11. description = 'The new value of the uniform.'
  12. },
  13. blob = {
  14. type = 'Blob',
  15. description = 'A Blob to replace the block data with.'
  16. },
  17. offset = {
  18. type = 'number',
  19. default = '0',
  20. description = 'A byte offset into the Blob to start writing from.'
  21. },
  22. extent = {
  23. type = 'number',
  24. default = 'nil',
  25. description = 'The number of bytes to write. If `nil`, writes as many bytes as possible.'
  26. }
  27. },
  28. returns = {
  29. bytes = {
  30. type = 'number',
  31. description = 'How many bytes were copied to the block.'
  32. }
  33. },
  34. variants = {
  35. {
  36. arguments = { 'variable', 'value' },
  37. returns = {}
  38. },
  39. {
  40. arguments = { 'blob', 'offset', 'extent' },
  41. returns = { 'bytes' }
  42. }
  43. },
  44. notes = [[
  45. For scalar or vector types, use tables of numbers or `vec3`s for each vector.
  46. For matrix types, use tables of numbers or `mat4` objects.
  47. `Blob`s can also be used to pass arbitrary binary data to individual variables.
  48. ]],
  49. related = {
  50. 'Shader:send',
  51. 'Shader:sendBlock',
  52. 'ShaderBlock:getShaderCode',
  53. 'ShaderBlock:getOffset',
  54. 'ShaderBlock:getSize'
  55. }
  56. }