getFeatures.lua 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. return {
  2. tag = 'graphics-misc',
  3. summary = 'Get the supported GPU features.',
  4. description = 'Returns a table indicating which features are supported by the GPU.',
  5. arguments = {},
  6. returns = {
  7. features = {
  8. type = 'table',
  9. description = '',
  10. table = {
  11. {
  12. name = 'textureBC',
  13. type = 'boolean',
  14. description = [[
  15. Whether `TextureFormat`s starting with `bc` are supported. This will almost always be
  16. `true` on desktop GPUs and will almost always be `false` on mobile GPUs.
  17. ]]
  18. },
  19. {
  20. name = 'textureASTC',
  21. type = 'boolean',
  22. description = [[
  23. Whether `TextureFormat`s beginning with `astc` are supported. This will almost always
  24. be `true` on mobile GPUs and will almost always be `false` on desktop GPUs.
  25. ]]
  26. },
  27. {
  28. name = 'wireframe',
  29. type = 'boolean',
  30. description = [[
  31. When supported, `Pass:setWireframe` will work, otherwise it will do nothing. This will
  32. always be `true` when using Vulkan, and will always be `false` when using WebGPU.
  33. ]]
  34. },
  35. {
  36. name = 'depthClamp',
  37. type = 'boolean',
  38. description = [[
  39. When supported, `Pass:setDepthClamp` will work, otherwise it will do nothing.
  40. ]]
  41. },
  42. {
  43. name = 'depthResolve',
  44. type = 'boolean',
  45. description = [[
  46. When supported, multisampled render passes can use a non-multisampled depth texture.
  47. Otherwise, the depth texture sample count needs to match the render pass sample count.
  48. ]]
  49. },
  50. {
  51. name = 'indirectDrawFirstInstance',
  52. type = 'boolean',
  53. description = [[
  54. Whether indirect draws can set the firstInstance property of buffer memory to something
  55. other than zero.
  56. ]]
  57. },
  58. {
  59. name = 'float64',
  60. type = 'boolean',
  61. description = 'Whether shader code can use doubles.'
  62. },
  63. {
  64. name = 'int64',
  65. type = 'boolean',
  66. description = 'Whether shader code can use signed and unsigned 64-bit integers.'
  67. },
  68. {
  69. name = 'int16',
  70. type = 'boolean',
  71. description = 'Whether shader code can use signed and unsigned 16-bit integers.'
  72. }
  73. }
  74. }
  75. },
  76. variants = {
  77. {
  78. arguments = {},
  79. returns = { 'features' }
  80. }
  81. },
  82. related = {
  83. 'lovr.graphics.isFormatSupported',
  84. 'lovr.graphics.getDevice',
  85. 'lovr.graphics.getLimits'
  86. }
  87. }