Browse Source

Fix readback docs;

bjorn 1 year ago
parent
commit
d97c746040

+ 3 - 3
api/init.lua

@@ -10291,7 +10291,7 @@ return {
             },
             },
             {
             {
               name = "transfer",
               name = "transfer",
-              description = "Whether the texture can be used in a transfer pass."
+              description = "Whether the texture can be used for transfer operations like `Texture:setPixels`, `Texture:blit`, etc."
             }
             }
           }
           }
         },
         },
@@ -22425,7 +22425,7 @@ return {
         {
         {
           name = "Readback",
           name = "Readback",
           summary = "An asynchronous read of a GPU resource.",
           summary = "An asynchronous read of a GPU resource.",
-          description = "Readbacks track the progress of an asynchronous read of a `Buffer` or `Texture`.  Once a Readback is created in a transfer pass, and the transfer pass is submitted, the Readback can be polled for completion or the CPU can wait for it to finish using `Readback:wait`.",
+          description = "Readbacks track the progress of an asynchronous read of a `Buffer` or `Texture`.  The Readback can be polled for completion or the CPU with `Readback:isComplete`, or you can wait for it to finish using `Readback:wait`.",
           key = "Readback",
           key = "Readback",
           module = "lovr.graphics",
           module = "lovr.graphics",
           constructors = {
           constructors = {
@@ -22530,7 +22530,7 @@ return {
               description = "Blocks the CPU until the Readback is finished on the GPU.",
               description = "Blocks the CPU until the Readback is finished on the GPU.",
               key = "Readback:wait",
               key = "Readback:wait",
               module = "lovr.graphics",
               module = "lovr.graphics",
-              notes = "If the transfer pass that created the readback has not been submitted yet, no wait will occur and this function will return `false`.",
+              notes = "If `lovr.graphics.submit` or `lovr.graphics.wait` has not been called since the readback was created, the readback has not been submitted yet, so no wait will occur and this function will return `false`.",
               variants = {
               variants = {
                 {
                 {
                   arguments = {},
                   arguments = {},

+ 3 - 3
api/lovr/graphics/Readback/init.lua

@@ -1,9 +1,9 @@
 return {
 return {
   summary = 'An asynchronous read of a GPU resource.',
   summary = 'An asynchronous read of a GPU resource.',
   description = [[
   description = [[
-    Readbacks track the progress of an asynchronous read of a `Buffer` or `Texture`.  Once a
-    Readback is created in a transfer pass, and the transfer pass is submitted, the Readback can be
-    polled for completion or the CPU can wait for it to finish using `Readback:wait`.
+    Readbacks track the progress of an asynchronous read of a `Buffer` or `Texture`.  The Readback
+    can be polled for completion or the CPU with `Readback:isComplete`, or you can wait for it to
+    finish using `Readback:wait`.
   ]],
   ]],
   constructors = {
   constructors = {
     'Buffer:newReadback',
     'Buffer:newReadback',

+ 3 - 2
api/lovr/graphics/Readback/wait.lua

@@ -15,7 +15,8 @@ return {
     }
     }
   },
   },
   notes = [[
   notes = [[
-    If the transfer pass that created the readback has not been submitted yet, no wait will occur
-    and this function will return `false`.
+    If `lovr.graphics.submit` or `lovr.graphics.wait` has not been called since the readback was
+    created, the readback has not been submitted yet, so no wait will occur and this function will
+    return `false`.
   ]]
   ]]
 }
 }

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

@@ -29,7 +29,10 @@ return {
     },
     },
     {
     {
       name = 'transfer',
       name = 'transfer',
-      description = 'Whether the texture can be used in a transfer pass.'
+      description = [[
+        Whether the texture can be used for transfer operations like `Texture:setPixels`,
+        `Texture:blit`, etc.
+      ]]
     }
     }
   }
   }
 }
 }