Browse Source

Anisotropy; Compute limits;

bjorn 4 years ago
parent
commit
a5e2ddc38a

+ 0 - 7
api/lovr/graphics/FilterMode.lua

@@ -16,13 +16,6 @@ return {
     {
       name = 'trilinear',
       description = 'Smooth pixel sampling, with smooth sampling across mipmap levels.'
-    },
-    {
-      name = 'anisotropic',
-      description = [[
-        Anisotropic texture filtering.  The level of anisotropy can also be specified when setting
-        this filter mode.  Gives the best results but is also slower.
-      ]]
     }
   },
   related = {

+ 1 - 4
api/lovr/graphics/Texture/getFilter.lua

@@ -11,10 +11,7 @@ return {
     {
       name = 'anisotropy',
       type = 'number',
-      description = [[
-        If the filtering mode is "anisotropic", returns the level of anisotropy.  Otherwise, this
-        will be nil.
-      ]]
+      description = 'The level of anisotropic filtering.'
     }
   }
 }

+ 5 - 2
api/lovr/graphics/Texture/setFilter.lua

@@ -10,15 +10,18 @@ return {
     {
       name = 'anisotropy',
       type = 'number',
-      description = 'The level of anisotropy to use when using anisotropic filtering.'
+      description = 'The level of anisotropy to use.'
     }
   },
   returns = {},
   notes = [[
     The default setting for new textures can be set with `lovr.graphics.setDefaultFilter`.
+
+    The maximum supported anisotropy level can be queried using `lovr.graphics.getLimits`.
   ]],
   related = {
     'lovr.graphics.getDefaultFilter',
-    'lovr.graphics.setDefaultFilter'
+    'lovr.graphics.setDefaultFilter',
+    'lovr.graphics.getLimits'
   }
 }

+ 6 - 1
api/lovr/graphics/compute.lua

@@ -36,7 +36,12 @@ return {
     }
   },
   returns = {},
-  notes = 'Only compute shaders created with `lovr.graphics.newComputeShader` can be used here.',
+  notes = [[
+    Only compute shaders created with `lovr.graphics.newComputeShader` can be used here.
+
+    There are GPU-specific limits on the `x`, `y`, and `z` values which can be queried in the
+    `compute` entry of `lovr.graphics.getLimits`.
+  ]],
   related = {
     'lovr.graphics.newComputeShader',
     'lovr.graphics.getShader',

+ 1 - 4
api/lovr/graphics/getDefaultFilter.lua

@@ -15,10 +15,7 @@ return {
     {
       name = 'anisotropy',
       type = 'number',
-      description = [[
-        If the filtering mode is "anisotropic", returns the level of anisotropy.  Otherwise, this
-        will be nil.
-      ]]
+      description = 'The level of anisotropy.'
     }
   },
   notes = 'The default filter is `trilinear`.',

+ 8 - 0
api/lovr/graphics/getLimits.lua

@@ -36,6 +36,14 @@ return {
           name = 'texturesize',
           type = 'number',
           description = 'The maximum width or height of textures, in pixels.'
+        },
+        {
+          name = 'compute',
+          type = 'table',
+          description = [[
+            A table of three numbers indicating the maximum number of compute threads that can be
+            run with `lovr.graphics.compute`.
+          ]]
         }
       }
     }

+ 8 - 6
api/lovr/graphics/setDefaultFilter.lua

@@ -14,16 +14,18 @@ return {
     {
       name = 'anisotropy',
       type = 'number',
-      description = [[
-        If the filtering mode is "anisotropic", returns the level of anisotropy.  Otherwise, this
-        will be nil.
-      ]]
+      description = 'The level of anisotropy to use.'
     }
   },
   returns = {},
-  notes = 'The default filter is `trilinear`.',
+  notes = [[
+    The default filter is `trilinear`.
+
+    The maximum supported anisotropy level can be queried using `lovr.graphics.getLimits`.
+  ]],
   related = {
     'Texture:getFilter',
-    'Texture:setFilter'
+    'Texture:setFilter',
+    'lovr.graphics.getLimits'
   }
 }