Pass:copy
EditCopies 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
Name | Type | Default | Description |
table | table | A table to copy to the buffer. | |
bufferdst | Buffer | The buffer to copy to. | |
srcindex | number | 1 | The index of the first item to begin copying from. |
dstindex | number | 1 | The index of the first item in the buffer to begin copying to. |
count | number | nil | The number of items to copy. If nil, copies as many items as possible. |
Returns
Nothing
Copy a Blob to a Buffer.
Arguments
Name | Type | Default | Description |
blob | Blob | A blob to copy to the buffer. | |
bufferdst | Buffer | The buffer to copy to. | |
srcoffset | number | 0 | A byte offset to begin copying from. |
dstoffset | number | 0 | A byte offset in the buffer to begin copying to. |
size | number | nil | The number of bytes to copy. If nil, copies as many bytes as possible. |
Returns
Nothing
Copy a Buffer to a Buffer.
Arguments
Name | Type | Default | Description |
buffersrc | Buffer | A buffer to copy to the buffer. | |
bufferdst | Buffer | The buffer to copy to. | |
srcoffset | number | 0 | A byte offset to begin copying from. |
dstoffset | number | 0 | A byte offset in the buffer to begin copying to. |
size | number | nil | The number of bytes to copy. If nil, copies as many bytes as possible. |
Returns
Nothing
Copy an Image to a Texture.
Arguments
Name | Type | Default | Description |
image | Image | An image to copy to the texture. | |
texturedst | Texture | The texture to copy to. | |
srcx | number | 0 | The x offset of the region in the source texture to copy. |
srcy | number | 0 | The y offset of the region in the source texture to copy. |
dstx | number | 0 | The x offset of the region in the destination texture to copy to. |
dsty | number | 0 | The y offset of the region in the destination texture to copy to. |
width | number | nil | The width of the region to copy. If nil, makes the region as wide as possible. |
height | number | nil | The height of the region to copy. If nil, makes the region as tall as possible. |
srclayer | number | 1 | The index of the first layer in the source texture to copy. |
dstlayer | number | 1 | The index of the layer in the destination texture to copy to. |
layers | number | nil | The number of layers to copy. If nil, copies as many layers as possible. |
srclevel | number | 1 | The index of the mipmap level in the source texture to copy. |
dstlevel | number | 1 | The index of the mipmap level in the destination texture to copy to. |
Returns
Nothing
Copy a Texture to a Texture.
Arguments
Name | Type | Default | Description |
texturesrc | Texture | A texture to copy to the texture. | |
texturedst | Texture | The texture to copy to. | |
srcx | number | 0 | The x offset of the region in the source texture to copy. |
srcy | number | 0 | The y offset of the region in the source texture to copy. |
dstx | number | 0 | The x offset of the region in the destination texture to copy to. |
dsty | number | 0 | The y offset of the region in the destination texture to copy to. |
width | number | nil | The width of the region to copy. If nil, makes the region as wide as possible. |
height | number | nil | The height of the region to copy. If nil, makes the region as tall as possible. |
srclayer | number | 1 | The index of the first layer in the source texture to copy. |
dstlayer | number | 1 | The index of the layer in the destination texture to copy to. |
layers | number | nil | The number of layers to copy. If nil, copies as many layers as possible. |
srclevel | number | 1 | The index of the mipmap level in the source texture to copy. |
dstlevel | number | 1 | 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
Name | Type | Default | Description |
tally | Tally | A tally to copy to the buffer. | |
bufferdst | Buffer | The buffer to copy to. | |
srcindex | number | 1 | The index of the first item to begin copying from. |
dstoffset | number | 0 | A byte offset in the buffer to begin copying to. |
count | number | nil | The number of items to copy. If nil, copies as many items as possible. |
Returns
Nothing