Browse Source

ShaderBlock:send blob variant range args;

bjorn 4 years ago
parent
commit
c4b4c81baf
2 changed files with 25 additions and 3 deletions
  1. 13 1
      api/init.lua
  2. 12 2
      api/lovr/graphics/ShaderBlock/send.lua

+ 13 - 1
api/init.lua

@@ -6583,7 +6583,19 @@ return {
                     {
                       name = "blob",
                       type = "Blob",
-                      description = "A Blob to replace the entire block with."
+                      description = "A Blob to replace the block data with."
+                    },
+                    {
+                      name = "offset",
+                      type = "number",
+                      description = "A byte offset into the Blob to start writing from.",
+                      default = "0"
+                    },
+                    {
+                      name = "extent",
+                      type = "number",
+                      description = "The number of bytes to write.  If `nil`, writes as many bytes as possible.",
+                      default = "nil"
                     }
                   },
                   returns = {

+ 12 - 2
api/lovr/graphics/ShaderBlock/send.lua

@@ -12,7 +12,17 @@ return {
     },
     blob = {
       type = 'Blob',
-      description = 'A Blob to replace the entire block with.'
+      description = 'A Blob to replace the block data with.'
+    },
+    offset = {
+      type = 'number',
+      default = '0',
+      description = 'A byte offset into the Blob to start writing from.'
+    },
+    extent = {
+      type = 'number',
+      default = 'nil',
+      description = 'The number of bytes to write.  If `nil`, writes as many bytes as possible.'
     }
   },
   returns = {
@@ -27,7 +37,7 @@ return {
       returns = {}
     },
     {
-      arguments = { 'blob' },
+      arguments = { 'blob', 'offset', 'extent' },
       returns = { 'bytes' }
     }
   },