getOffset.lua 642 B

12345678910111213141516171819202122232425
  1. return {
  2. summary = 'Get the byte offset of a variable in the ShaderBlock.',
  3. description = [[
  4. Returns the byte offset of a variable in a ShaderBlock. This is useful if you want to manually
  5. send binary data to the ShaderBlock using a `Blob` in `ShaderBlock:send`.
  6. ]],
  7. arguments = {
  8. {
  9. name = 'field',
  10. type = 'string',
  11. description = 'The name of the variable to get the offset of.'
  12. }
  13. },
  14. returns = {
  15. {
  16. name = 'offset',
  17. type = 'number',
  18. description = 'The byte offset of the variable.'
  19. }
  20. },
  21. related = {
  22. 'ShaderBlock:getSize',
  23. 'lovr.graphics.newShaderBlock'
  24. }
  25. }