copy(from:to:)
Encodes a command that copies data from one texture to another.
Declaration
func copy(from sourceTexture: any MTLTexture, to destinationTexture: any MTLTexture)Parameters
- sourceTexture:
A texture the command copies data from.
- destinationTexture:
Another texture the command copies the data to that has the same pixel format and sample count as
sourceTexture.
Mentioned in
Discussion
The textures can be different sizes as long as the larger texture has a mipmap level that’s the same size as the smaller texture’s level 0 mipmap.
The command copies all identical mipmap sizes. If both textures are arrays, the command copies as many texture slices (array elements) as possible.