Selaa lähdekoodia

Remove some deprecated functions that were removed in v0.18.0;

bjorn 2 kuukautta sitten
vanhempi
commit
8bfce6c947

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 130 - 110
api/init.lua


+ 0 - 49
api/lovr/graphics/Buffer/getPointer.lua

@@ -1,49 +0,0 @@
-return {
-  deprecated = true,
-  tag = 'buffer-transfer',
-  summary = 'Get a writable pointer to the Buffer\'s memory.',
-  description = [[
-    Returns a pointer to GPU memory and schedules a copy from this pointer to the buffer's data. The
-    data in the pointer will replace the data in the buffer.  This is intended for use with the
-    LuaJIT FFI or for passing to C libraries.
-  ]],
-  arguments = {
-    offset = {
-      type = 'number',
-      default = '0',
-      description = 'A byte offset in the buffer to write to.'
-    },
-    extent = {
-      type = 'number',
-      default = 'nil',
-      description = 'The number of bytes to replace.  If nil, writes to the rest of the buffer.'
-    }
-  },
-  returns = {
-    pointer = {
-      type = 'lightuserdata',
-      description = 'A pointer to the Buffer\'s memory.'
-    }
-  },
-  variants = {
-    {
-      arguments = { 'offset', 'extent' },
-      returns = { 'pointer' }
-    }
-  },
-  notes = [[
-    The pointer remains valid until the next call to `lovr.graphics.submit`, during which the data
-    in the pointer will be uploaded to the buffer.
-
-    The initial contents of the pointer are undefined.
-
-    Special care should be taken when writing data:
-
-    - Reading data from the pointer will be very slow on some systems, and should be avoided.
-    - It is better to write data to the pointer sequentially.  Random access may be slower.
-  ]],
-  related = {
-    'Blob:getPointer',
-    'Buffer:mapData'
-  }
-}

+ 1 - 2
api/lovr/graphics/Buffer/init.lua

@@ -46,8 +46,7 @@ return {
     buffer with offsets (or multiple buffers).
   ]],
   constructors = {
-    'lovr.graphics.newBuffer',
-    'lovr.graphics.getBuffer'
+    'lovr.graphics.newBuffer'
   },
   sections = {
     {

+ 0 - 22
api/lovr/graphics/Buffer/isTemporary.lua

@@ -1,22 +0,0 @@
-return {
-  tag = 'buffer-metadata',
-  deprecated = 'Temporary buffers have been removed, this function always returns false.',
-  summary = 'Check if the Buffer is temporary.',
-  description = 'Returns whether the Buffer is temporary.',
-  arguments = {},
-  returns = {
-    temporary = {
-      type = 'boolean',
-      description = 'Whether the Buffer is temporary.'
-    }
-  },
-  variants = {
-    {
-      arguments = {},
-      returns = { 'temporary' }
-    }
-  },
-  related = {
-    'lovr.graphics.getBuffer'
-  }
-}

+ 1 - 2
api/lovr/graphics/Buffer/mapData.lua

@@ -42,7 +42,6 @@ return {
     - It is better to write data to the pointer sequentially.  Random access may be slower.
   ]],
   related = {
-    'Blob:getPointer',
-    'Buffer:getPointer'
+    'Blob:getPointer'
   }
 }

+ 0 - 19
api/lovr/graphics/Pass/getSampleCount.lua

@@ -1,19 +0,0 @@
-return {
-  deprecated = true,
-  tag = 'canvas',
-  summary = 'Get the antialiasing setting of a render pass.',
-  description = 'Returns the antialiasing setting of a render pass.',
-  arguments = {},
-  returns = {
-    samples = {
-      type = 'number',
-      description = 'The number of samples used for rendering.  Currently, will be 1 or 4.'
-    }
-  },
-  variants = {
-    {
-      arguments = {},
-      returns = { 'samples' }
-    }
-  }
-}

+ 0 - 25
api/lovr/graphics/Pass/getTarget.lua

@@ -1,25 +0,0 @@
-return {
-  deprecated = true,
-  tag = 'canvas',
-  summary = 'Get the textures a render pass is rendering to.',
-  description = 'Returns the textures a render pass is rendering to.',
-  arguments = {},
-  returns = {
-    target = {
-      type = 'table',
-      description = [[
-        A table of the color textures targeted by the pass, with an additional `depth` key if the
-        pass has a depth texture.
-      ]]
-    }
-  },
-  variants = {
-    {
-      arguments = {},
-      returns = { 'target' }
-    }
-  },
-  related = {
-    'Pass:getClear'
-  }
-}

+ 0 - 22
api/lovr/graphics/Pass/getType.lua

@@ -1,22 +0,0 @@
-return {
-  deprecated = true,
-  tag = 'pass-misc',
-  summary = 'Get the type of the Pass.',
-  description = [[
-    Returns the type of the pass (render, compute, or transfer).  The type restricts what kinds of
-    functions can be called on the pass.
-  ]],
-  arguments = {},
-  returns = {
-    type = {
-      type = 'PassType',
-      description = 'The type of the Pass.'
-    }
-  },
-  variants = {
-    {
-      arguments = {},
-      returns = { 'type' }
-    }
-  }
-}

+ 1 - 2
api/lovr/graphics/Pass/init.lua

@@ -22,8 +22,7 @@ return {
   constructors = {
     'lovr.graphics.newPass',
     'lovr.graphics.getWindowPass',
-    'lovr.headset.getPass',
-    'lovr.graphics.getPass'
+    'lovr.headset.getPass'
   },
   sections = {
     {

+ 0 - 42
api/lovr/graphics/PassType.lua

@@ -1,42 +0,0 @@
-return {
-  deprecated = true,
-  summary = 'Different types of Passes.',
-  description = [[
-    The three different types of `Pass` objects.  Each Pass has a single type, which determines the
-    type of work it does and which functions can be called on it.
-  ]],
-  values = {
-    {
-      name = 'render',
-      description = [[
-        A render pass renders graphics to a set of up to four color textures and an optional depth
-        texture.  The textures all need to have the same dimensions and sample counts.  The textures
-        can have multiple layers, and all rendering work will be broadcast to each layer.  Each
-        layer can use a different camera pose, which is used for stereo rendering.
-      ]]
-    },
-    {
-      name = 'compute',
-      description = [[
-        A compute pass runs compute shaders.  Compute passes usually only call `Pass:setShader`,
-        `Pass:send`, and `Pass:compute`.  All of the compute work in a single compute pass is run
-        in parallel, so multiple compute passes should be used if one compute pass needs to happen
-        after a different one.
-      ]]
-    },
-    {
-      name = 'transfer',
-      description = [[
-        A transfer pass copies data to and from GPU memory in `Buffer` and `Texture` objects.
-        Transfer passes use `Pass:copy`, `Pass:clear`, `Pass:blit`, `Pass:mipmap`, and `Pass:read`.
-        Similar to compute passes, all the work in a transfer pass happens in parallel, so multiple
-        passes should be used if the transfers need to be ordered.
-      ]]
-    }
-  },
-  related = {
-    'lovr.graphics.getPass',
-    'lovr.graphics.submit',
-    'Pass:getType'
-  }
-}

+ 1 - 1
api/lovr/graphics/Texture/getSampleCount.lua

@@ -21,6 +21,6 @@ return {
   },
   related = {
     'lovr.graphics.newTexture',
-    'Pass:getSampleCount'
+    'Pass:setCanvas'
   }
 }

+ 0 - 190
api/lovr/graphics/getBuffer.lua

@@ -1,190 +0,0 @@
-return {
-  deprecated = true,
-  tag = 'graphics-objects',
-  summary = 'Get a temporary Buffer.',
-  description = 'Returns a temporary Buffer.',
-  arguments = {
-    size = {
-      type = 'number',
-      description = 'The size of the Buffer, in bytes.'
-    },
-    length = {
-      type = 'number',
-      default = '1',
-      description = 'The length of the Buffer.'
-    },
-    data = {
-      type = 'table',
-      description = [[
-        The initial data to put into the Buffer.  The length of the Buffer will be determined by the
-        contents of the table.  The contents can be a mix of tables, numbers, and vectors, but the
-        length calculation requires each field to consistently use one type of data.
-      ]]
-    },
-    blob = {
-      type = 'Blob',
-      description = [[
-        A Blob with the initial contents of the Buffer.  The size of the Blob will be used to
-        determine the length of the Buffer.
-      ]]
-    },
-    type = {
-      type = 'DataType',
-      description = 'The type of each item in the Buffer.'
-    },
-    format = {
-      type = 'table',
-      description = 'A list of fields in the Buffer.',
-      table = {
-        {
-          name = 'layout',
-          type = 'DataLayout',
-          default = 'packed',
-          description = 'How to lay out the Buffer fields in memory.'
-        },
-        {
-          name = 'stride',
-          type = 'number',
-          description = [[
-            The stride of the Buffer, in bytes.  When `nil`, the stride will be automatically
-            computed based on the fields.  The stride can not be zero or smaller than the max byte
-            occupied by one of the fields.  The layout of the Buffer may adjust the stride.
-          ]]
-        }
-      }
-    }
-  },
-  returns = {
-    buffer = {
-      type = 'Buffer',
-      description = 'The new Buffer.'
-    }
-  },
-  variants = {
-    {
-      arguments = { 'size' },
-      returns = { 'buffer' }
-    },
-    {
-      arguments = { 'blob' },
-      returns = { 'buffer' }
-    },
-    {
-      arguments = { 'format', 'length' },
-      returns = { 'buffer' }
-    },
-    {
-      arguments = { 'format', 'data' },
-      returns = { 'buffer' }
-    },
-    {
-      arguments = { 'format', 'blob' },
-      returns = { 'buffer' }
-    },
-    {
-      arguments = { 'type', 'length' },
-      returns = { 'buffer' }
-    },
-    {
-      arguments = { 'type', 'data' },
-      returns = { 'buffer' }
-    },
-    {
-      arguments = { 'type', 'blob' },
-      returns = { 'buffer' }
-    },
-    {
-      deprecated = true,
-      arguments = { 'length', 'type' },
-      returns = { 'buffer' }
-    },
-    {
-      deprecated = true,
-      arguments = { 'data', 'type' },
-      returns = { 'buffer' }
-    },
-    {
-      deprecated = true,
-      arguments = { 'length', 'format' },
-      returns = { 'buffer' }
-    },
-    {
-      deprecated = true,
-      arguments = { 'data', 'format' },
-      returns = { 'buffer' }
-    },
-    {
-      deprecated = true,
-      arguments = { 'blob', 'type' },
-      returns = { 'buffer' }
-    },
-    {
-      deprecated = true,
-      arguments = { 'blob', 'format' },
-      returns = { 'buffer' }
-    }
-  },
-  notes = [[
-    The format table can contain a list of `DataType`s or a list of tables to provide extra
-    information about each field.  Each inner table has the following keys:
-
-    - `type` is the `DataType` of the field and is required.
-    - `name` is the name of the field, used to match table keys and vertex attribute names.
-    - `offset` is the byte offset of the field.  Any fields with a `nil` offset will be placed next
-      to each other sequentially in memory, subject to any padding required by the Buffer's layout.
-      In practice this means that you probably want to provide an `offset` for either all of the
-      fields or none of them.
-    - `length` is the array size of the field.
-
-    As a shorthand, the name, type, and optionally the length of a field can be provided as a list
-    instead of using keys.
-
-    If no table or Blob is used to define the initial Buffer contents, its data will be undefined.
-  ]],
-  example = {
-    description = 'Examples of different buffer formats.',
-    code = [[
-      -- 2 matrices
-      lovr.graphics.getBuffer('mat4', 2)
-
-      -- 3 integers, with initial data
-      lovr.graphics.getBuffer('int', { 1, 2, 3 })
-
-      -- a simple mesh:
-      lovr.graphics.getBuffer({
-        { name = 'VertexPosition', type = 'vec3' },
-        { name = 'VertexColor', type = 'color' }
-      }, 4)
-
-      -- a uniform buffer with vec3's, using the std140 packing
-      lovr.graphics.getBuffer({ 'vec3', layout = 'std140' }, data)
-
-      -- a uniform buffer with key-value fields
-      lovr.graphics.getBuffer({
-        { 'AmbientColor', 'vec3' },
-        { 'LightPosition', 'vec3' },
-        { 'LightType', 'u32' },
-        { 'LightColor', 'vec4' },
-        layout = 'std140'
-      })
-
-      -- a buffer with nested structure and array types
-      lovr.graphics.getBuffer({
-        { 'globals', {
-          { 'ObjectCount', 'int' },
-          { 'WorldSize', 'vec2' },
-          { 'Scale', 'float' }
-        }},
-        { 'materials', {
-          { 'Color', 'vec4' },
-          { 'Glow', 'vec3' },
-          { 'Roughness', 'float' }
-        }, length = 32 },
-        layout = 'std430'
-      })
-
-      -- a buffer using a variable from a shader:
-      lovr.graphics.getBuffer(shader:getBufferFormat('transforms'))
-    ]]
-  }
-}

+ 0 - 110
api/lovr/graphics/getPass.lua

@@ -1,110 +0,0 @@
-return {
-  tag = 'graphics-objects',
-  deprecated = [[
-    Temporary passes have been removed.  This function was replaced by `lovr.graphics.newPass`.
-  ]],
-  summary = 'Get a temporary Pass.',
-  description = 'Creates and returns a temporary Pass object.',
-  arguments = {
-    type = {
-      type = 'PassType',
-      description = 'The type of pass to create.'
-    },
-    texture = {
-      type = 'Texture',
-      description = 'The texture the render pass will render to.  Ignored for non-render passes.'
-    },
-    canvas = {
-      type = 'table',
-      description = [[
-        Render pass configuration.  Up to 4 textures can be provided in table keys 1 through 4.
-        Ignored for non-render passes.
-      ]],
-      table = {
-        {
-          name = 'depth',
-          type = 'table',
-          description = [[
-            Depth/stencil buffer configuration.  In addition to a table, it can be a `Texture`, a
-            `TextureFormat`, or `false` to disable the depth buffer.
-          ]],
-          table = {
-            {
-              name = 'format',
-              type = 'TextureFormat',
-              default = [['d32f']],
-              description = [[
-                The format of the depth buffer texture, which must be a depth format (the ones that
-                start with `d`).  LÖVR will create or reuse an internal depth buffer with this
-                format.
-              ]]
-            },
-            {
-              name = 'texture',
-              type = 'Texture',
-              description = 'A Texture to use as the depth buffer.  Takes precedence over `format`.'
-            }
-          }
-        },
-        {
-          name = 'samples',
-          type = 'number',
-          default = '4',
-          description = [[
-            The number of multisamples to use.  Can be 4 for antialiasing, or 1 to disable
-            antialiasing.
-          ]]
-        }
-      }
-    }
-  },
-  returns = {
-    pass = {
-      type = 'Pass',
-      description = 'The new Pass.'
-    }
-  },
-  variants = {
-    {
-      description = 'Create a compute pass.',
-      arguments = { 'type' },
-      returns = { 'pass' }
-    },
-    {
-      description = 'Create a render pass.',
-      arguments = { 'type', 'texture' },
-      returns = { 'pass' }
-    },
-    {
-      description = 'Create a render pass, with options.',
-      arguments = { 'type', 'canvas' },
-      returns = { 'pass' }
-    }
-  },
-  notes = [[
-    Fun facts about render passes:
-
-    - Textures must have been created with the `render` `TextureUsage`.
-    - Textures must have the same dimensions, layer counts, and sample counts.
-    - When rendering to textures with multiple layers, each draw will be broadcast to all layers.
-      Render passes have multiple "views" (cameras), and each layer uses a corresponding view,
-      allowing each layer to be rendered from a different viewpoint.  This enables fast stereo
-      rendering, but can also be used to efficiently render to cubemaps.  The `ViewIndex` variable
-      can also be used in shaders to set up any desired per-view behavior.
-    - Mipmaps will automatically be generated for textures at the end of the render pass.
-    - It's okay to have zero color textures, but in this case there must be a depth texture.
-    - It's possible to render to a specific mipmap level of a Texture, or a subset of its layers, by
-      rendering to texture views, see `lovr.graphics.newTextureView`.
-
-    For `compute` passes, all of the commands in the pass act as though they run in parallel.  This
-    means that writing to the same element of a buffer twice, or writing to it and reading from it
-    again is not guaranteed to work properly on all GPUs.  If compute or transfers need to be
-    sequenced, multiple passes should be used.  It is, however, completely fine to read and write to
-    non-overlapping regions of the same buffer or texture.
-  ]],
-  related = {
-    'lovr.graphics.submit',
-    'lovr.graphics.getWindowPass',
-    'lovr.headset.getPass'
-  }
-}

+ 0 - 30
api/lovr/graphics/newBuffer.lua

@@ -91,36 +91,6 @@ return {
     {
       arguments = { 'type', 'blob' },
       returns = { 'buffer' }
-    },
-    {
-      deprecated = true,
-      arguments = { 'length', 'type' },
-      returns = { 'buffer' }
-    },
-    {
-      deprecated = true,
-      arguments = { 'data', 'type' },
-      returns = { 'buffer' }
-    },
-    {
-      deprecated = true,
-      arguments = { 'length', 'format' },
-      returns = { 'buffer' }
-    },
-    {
-      deprecated = true,
-      arguments = { 'data', 'format' },
-      returns = { 'buffer' }
-    },
-    {
-      deprecated = true,
-      arguments = { 'blob', 'type' },
-      returns = { 'buffer' }
-    },
-    {
-      deprecated = true,
-      arguments = { 'blob', 'format' },
-      returns = { 'buffer' }
     }
   },
   notes = [[

+ 0 - 26
api/lovr/headset/getDisplayFrequencies.lua

@@ -1,26 +0,0 @@
-return {
-  tag = 'headset',
-  deprecated = 'Replaced by `lovr.headset.getRefreshRates`.',
-  summary = 'Get the list of refresh rates supported by the display.',
-  description = [[
-    Returns a table with all the refresh rates supported by the headset display, in Hz.
-  ]],
-  arguments = {},
-  returns = {
-    frequencies = {
-      type = 'table',
-      description = [[
-        A flat table of the refresh rates supported by the headset display, nil if not supported.
-      ]]
-    }
-  },
-  variants = {
-    {
-      arguments = {},
-      returns = { 'frequencies' }
-    }
-  },
-  related = {
-    'lovr.headset.setDisplayFrequency'
-  }
-}

+ 0 - 19
api/lovr/headset/getDisplayFrequency.lua

@@ -1,19 +0,0 @@
-return {
-  tag = 'headset',
-  deprecated = 'Replaced by `lovr.headset.getRefreshRate`.',
-  summary = 'Get the refresh rate of the display.',
-  description = 'Returns the refresh rate of the headset display, in Hz.',
-  arguments = {},
-  returns = {
-    frequency = {
-      type = 'number',
-      description = 'The frequency of the display, or `nil` if I have no idea what it is.'
-    }
-  },
-  variants = {
-    {
-      arguments = {},
-      returns = { 'frequency' }
-    }
-  }
-}

+ 0 - 25
api/lovr/headset/getOriginType.lua

@@ -1,25 +0,0 @@
-return {
-  tag = 'playArea',
-  deprecated = 'Replaced by `lovr.headset.isSeated`.',
-  summary = 'Get the type of tracking origin of the headset.',
-  description = [[
-    Returns the type of origin used for the tracking volume.  The different types of origins are
-    explained on the `HeadsetOrigin` page.
-  ]],
-  arguments = {},
-  returns = {
-    origin = {
-      type = 'HeadsetOrigin',
-      description = 'The type of origin.'
-    }
-  },
-  variants = {
-    {
-      arguments = {},
-      returns = { 'origin' }
-    }
-  },
-  related = {
-    'HeadsetOrigin'
-  }
-}

+ 0 - 28
api/lovr/headset/setDisplayFrequency.lua

@@ -1,28 +0,0 @@
-return {
-  tag = 'headset',
-  deprecated = 'Replaced by `lovr.headset.setRefreshRate`.',
-  summary = 'Set the display refresh rate.',
-  description = 'Sets the display refresh rate, in Hz.',
-  arguments = {
-    frequency = {
-      type = 'number',
-      description = 'The new refresh rate, in Hz.',
-    }
-  },
-  returns = {
-    success = {
-      type = 'boolean',
-      description = 'Whether the display refresh rate was successfully set.'
-    }
-  },
-  variants = {
-    {
-      arguments = { 'frequency' },
-      returns = { 'success' }
-    }
-  },
-  notes = [[
-    Changing the display refresh-rate also changes the frequency of lovr.update() and lovr.draw() as
-    they depend on the display frequency.
-  ]]
-}

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä