Pass:copy

Edit

Copies data to or between Buffer and Texture objects. This can only be called on a transfer pass, which can be created with lovr.graphics.getPass.







Copy a table to a Buffer.

Arguments

NameTypeDefaultDescription
tabletable A table to copy to the buffer.
bufferdstBuffer The buffer to copy to.
srcindexnumber1 The index of the first item to begin copying from.
dstindexnumber1 The index of the first item in the buffer to begin copying to.
countnumbernil The number of items to copy. If nil, copies as many items as possible.

Returns

Nothing

Copy a Blob to a Buffer.

Arguments

NameTypeDefaultDescription
blobBlob A blob to copy to the buffer.
bufferdstBuffer The buffer to copy to.
srcoffsetnumber0 A byte offset to begin copying from.
dstoffsetnumber0 A byte offset in the buffer to begin copying to.
sizenumbernil The number of bytes to copy. If nil, copies as many bytes as possible.

Returns

Nothing

Copy a Buffer to a Buffer.

Arguments

NameTypeDefaultDescription
buffersrcBuffer A buffer to copy to the buffer.
bufferdstBuffer The buffer to copy to.
srcoffsetnumber0 A byte offset to begin copying from.
dstoffsetnumber0 A byte offset in the buffer to begin copying to.
sizenumbernil The number of bytes to copy. If nil, copies as many bytes as possible.

Returns

Nothing

Copy an Image to a Texture.

Arguments

NameTypeDefaultDescription
imageImage An image to copy to the texture.
texturedstTexture The texture to copy to.
srcxnumber0 The x offset of the region in the source texture to copy.
srcynumber0 The y offset of the region in the source texture to copy.
dstxnumber0 The x offset of the region in the destination texture to copy to.
dstynumber0 The y offset of the region in the destination texture to copy to.
widthnumbernil The width of the region to copy. If nil, makes the region as wide as possible.
heightnumbernil The height of the region to copy. If nil, makes the region as tall as possible.
srclayernumber1 The index of the first layer in the source texture to copy.
dstlayernumber1 The index of the layer in the destination texture to copy to.
layersnumbernil The number of layers to copy. If nil, copies as many layers as possible.
srclevelnumber1 The index of the mipmap level in the source texture to copy.
dstlevelnumber1 The index of the mipmap level in the destination texture to copy to.

Returns

Nothing

Copy a Texture to a Texture.

Arguments

NameTypeDefaultDescription
texturesrcTexture A texture to copy to the texture.
texturedstTexture The texture to copy to.
srcxnumber0 The x offset of the region in the source texture to copy.
srcynumber0 The y offset of the region in the source texture to copy.
dstxnumber0 The x offset of the region in the destination texture to copy to.
dstynumber0 The y offset of the region in the destination texture to copy to.
widthnumbernil The width of the region to copy. If nil, makes the region as wide as possible.
heightnumbernil The height of the region to copy. If nil, makes the region as tall as possible.
srclayernumber1 The index of the first layer in the source texture to copy.
dstlayernumber1 The index of the layer in the destination texture to copy to.
layersnumbernil The number of layers to copy. If nil, copies as many layers as possible.
srclevelnumber1 The index of the mipmap level in the source texture to copy.
dstlevelnumber1 The index of the mipmap level in the destination texture to copy to.

Returns

Nothing

Copy a Tally to a Buffer. The size of each item depends on what the tally is measuring:

  • time tally slots are a single 4-byte unsigned integer.
  • shader tally slots are four 4-byte unsigned integers (16 bytes).
  • pixel tally slots are a single 4-byte unsigned integer.

Arguments

NameTypeDefaultDescription
tallyTally A tally to copy to the buffer.
bufferdstBuffer The buffer to copy to.
srcindexnumber1 The index of the first item to begin copying from.
dstoffsetnumber0 A byte offset in the buffer to begin copying to.
countnumbernil The number of items to copy. If nil, copies as many items as possible.

Returns

Nothing

See also