Browse Source

Pass:send mentions offset/extent arguments for buffers;

bjorn 2 years ago
parent
commit
0f705f4781
2 changed files with 40 additions and 2 deletions
  1. 24 0
      api/init.lua
  2. 16 2
      api/lovr/graphics/Pass/send.lua

+ 24 - 0
api/init.lua

@@ -14415,6 +14415,18 @@ return {
                       name = "buffer",
                       name = "buffer",
                       type = "Buffer",
                       type = "Buffer",
                       description = "The Buffer to assign."
                       description = "The Buffer to assign."
+                    },
+                    {
+                      name = "offset",
+                      type = "number",
+                      description = "An offset from the start of the buffer where data will be read, in bytes.",
+                      default = "0"
+                    },
+                    {
+                      name = "extent",
+                      type = "number",
+                      description = "The number of bytes that will be available for reading.  If zero, as much data as possible will be bound, depending on the offset, buffer size, and the `uniformBufferRange` or `storageBufferRange` limit.",
+                      default = "0"
                     }
                     }
                   },
                   },
                   returns = {}
                   returns = {}
@@ -14475,6 +14487,18 @@ return {
                       name = "buffer",
                       name = "buffer",
                       type = "Buffer",
                       type = "Buffer",
                       description = "The Buffer to assign."
                       description = "The Buffer to assign."
+                    },
+                    {
+                      name = "offset",
+                      type = "number",
+                      description = "An offset from the start of the buffer where data will be read, in bytes.",
+                      default = "0"
+                    },
+                    {
+                      name = "extent",
+                      type = "number",
+                      description = "The number of bytes that will be available for reading.  If zero, as much data as possible will be bound, depending on the offset, buffer size, and the `uniformBufferRange` or `storageBufferRange` limit.",
+                      default = "0"
                     }
                     }
                   },
                   },
                   returns = {}
                   returns = {}

+ 16 - 2
api/lovr/graphics/Pass/send.lua

@@ -18,6 +18,20 @@ return {
       type = 'Buffer',
       type = 'Buffer',
       description = 'The Buffer to assign.'
       description = 'The Buffer to assign.'
     },
     },
+    offset = {
+      type = 'number',
+      default = '0',
+      description = 'An offset from the start of the buffer where data will be read, in bytes.'
+    },
+    extent = {
+      type = 'number',
+      default = '0',
+      description = [[
+        The number of bytes that will be available for reading.  If zero, as much data as possible
+        will be bound, depending on the offset, buffer size, and the `uniformBufferRange` or
+        `storageBufferRange` limit.
+      ]]
+    },
     texture = {
     texture = {
       type = 'Texture',
       type = 'Texture',
       description = 'The Texture to assign.'
       description = 'The Texture to assign.'
@@ -34,7 +48,7 @@ return {
   returns = {},
   returns = {},
   variants = {
   variants = {
     {
     {
-      arguments = { 'name', 'buffer' },
+      arguments = { 'name', 'buffer', 'offset', 'extent' },
       returns = {}
       returns = {}
     },
     },
     {
     {
@@ -50,7 +64,7 @@ return {
       returns = {}
       returns = {}
     },
     },
     {
     {
-      arguments = { 'binding', 'buffer' },
+      arguments = { 'binding', 'buffer', 'offset', 'extent' },
       returns = {}
       returns = {}
     },
     },
     {
     {