Browse Source

Adjust indirect docs formatting;

bjorn 6 months ago
parent
commit
8d3760a809
2 changed files with 16 additions and 18 deletions
  1. 1 1
      api/init.lua
  2. 15 17
      api/lovr/graphics/Pass/mesh.lua

+ 1 - 1
api/init.lua

@@ -20232,7 +20232,7 @@ return {
                   returns = {}
                 },
                 {
-                  description = "Perform indirect draws by specifying a `draws` command buffer. This allows for the drawing of instanced geometry to be orchestrated by a compute shader that writes to the `draws` buffer. The `draws` buffer contains one or more commands that define how to draw instances. The `stride` is autodetected if not specified (20 for indexed geometry and 16 for non-indexed geometry).\n\nThe `draws` buffer needs to use one of these formats: ``Lua { -- drawing with vertices and indices\n  { name = 'indexCount', type = 'u32' },\n  { name = 'instanceCount', type = 'u32' },\n  { name = 'firstIndex', type = 'u32' },\n  { name = 'vertexOffset', type = 'i32' },\n  { name = 'firstInstance', type = 'u32' } }\n``` ``Lua { -- drawing with vertices; indices = nil\n  { name = 'vertexCount', type = 'u32' },\n  { name = 'instanceCount', type = 'u32' },\n  { name = 'firstVertex', type = 'u32' },\n  { name = 'firstInstance', type = 'u32' } }\n```",
+                  description = "Perform indirect draws by specifying a `draws` command buffer. This allows for the drawing of instanced geometry to be orchestrated by a compute shader that writes to the `draws` buffer. The `draws` buffer contains one or more commands that define how to draw instances. The `stride` is autodetected if not specified (20 for indexed geometry and 16 for non-indexed geometry).\n\nThe `draws` buffer needs to use one of these formats:\n\n    { -- drawing with vertices and indices\n      { name = 'indexCount', type = 'u32' },\n      { name = 'instanceCount', type = 'u32' },\n      { name = 'firstIndex', type = 'u32' },\n      { name = 'vertexOffset', type = 'i32' },\n      { name = 'firstInstance', type = 'u32' }\n    }\n\n    { -- drawing with vertices; indices = nil\n      { name = 'vertexCount', type = 'u32' },\n      { name = 'instanceCount', type = 'u32' },\n      { name = 'firstVertex', type = 'u32' },\n      { name = 'firstInstance', type = 'u32' }\n    }",
                   arguments = {
                     {
                       name = "vertices",

+ 15 - 17
api/lovr/graphics/Pass/mesh.lua

@@ -170,23 +170,21 @@ return {
         non-indexed geometry).
 
         The `draws` buffer needs to use one of these formats:
-        ``Lua
-        { -- drawing with vertices and indices
-          { name = 'indexCount', type = 'u32' },
-          { name = 'instanceCount', type = 'u32' },
-          { name = 'firstIndex', type = 'u32' },
-          { name = 'vertexOffset', type = 'i32' },
-          { name = 'firstInstance', type = 'u32' }
-        }
-        ```
-        ``Lua
-        { -- drawing with vertices; indices = nil
-          { name = 'vertexCount', type = 'u32' },
-          { name = 'instanceCount', type = 'u32' },
-          { name = 'firstVertex', type = 'u32' },
-          { name = 'firstInstance', type = 'u32' }
-        }
-        ```
+
+            { -- drawing with vertices and indices
+              { name = 'indexCount', type = 'u32' },
+              { name = 'instanceCount', type = 'u32' },
+              { name = 'firstIndex', type = 'u32' },
+              { name = 'vertexOffset', type = 'i32' },
+              { name = 'firstInstance', type = 'u32' }
+            }
+
+            { -- drawing with vertices; indices = nil
+              { name = 'vertexCount', type = 'u32' },
+              { name = 'instanceCount', type = 'u32' },
+              { name = 'firstVertex', type = 'u32' },
+              { name = 'firstInstance', type = 'u32' }
+            }
       ]],
       arguments = { 'vertices', 'indices', 'draws', 'drawcount', 'offset', 'stride' },
       returns = {}