isFormatSupported.lua 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. return {
  2. tag = 'graphics-misc',
  3. summary = 'Check if a Texture format is supported.',
  4. description = 'Returns the type of operations the GPU supports for a texture format, if any.',
  5. arguments = {
  6. format = {
  7. type = 'TextureFormat',
  8. description = 'The texture format to query.'
  9. },
  10. ['...features'] = {
  11. type = 'TextureFeature',
  12. description = [[
  13. Zero or more features to check. If no features are given, this function will return whether
  14. the GPU supports *any* feature for this format. Otherwise, this function will only return
  15. true if *all* of the input features are supported.
  16. ]]
  17. }
  18. },
  19. returns = {
  20. linear = {
  21. type = 'boolean',
  22. description = [[
  23. Whether the GPU supports these operations for textures with this format, when created with
  24. the `linear` flag set to `true`.
  25. ]]
  26. },
  27. srgb = {
  28. type = 'boolean',
  29. description = [[
  30. Whether the GPU supports these operations for textures with this format, when created with
  31. the `linear` flag set to `false`.
  32. ]]
  33. }
  34. },
  35. variants = {
  36. {
  37. arguments = { 'format', '...features' },
  38. returns = { 'linear', 'srgb' }
  39. }
  40. },
  41. related = {
  42. 'lovr.graphics.getDevice',
  43. 'lovr.graphics.getFeatures',
  44. 'lovr.graphics.getLimits'
  45. }
  46. }