Pass:copy

Copies data to or between Buffer and Texture objects. This function must be called on a transfer pass.


Copy a table to a Buffer.

Pass:copy(table, bufferdst, srcindex, dstindex, count)

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.

Pass:copy(blob, bufferdst, srcoffset, dstoffset, size)

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.

Pass:copy(buffersrc, bufferdst, srcoffset, dstoffset, size)

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.

Pass:copy(image, texturedst, srcx, srcy, dstx, dsty, width, height, srclayer, dstlayer, layers, srclevel, dstlevel)

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.

Pass:copy(texturesrc, texturedst, srcx, srcy, dstx, dsty, width, height, srclayer, dstlayer, layers, srclevel, dstlevel)

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:

Pass:copy(tally, bufferdst, srcindex, dstoffset, count)

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