optimizeContentsForCPUAccess(texture:)
Encodes a command that improves the performance of CPU memory operations with a texture.
Declaration
func optimizeContentsForCPUAccess(texture: any MTLTexture)Parameters
- texture:
A texture the command optimizes.
Mentioned in
Discussion
This command can reduce the time it takes the CPU to access a texture. Apps typically run the command for:
Textures the CPU accesses for an extended period of time
Textures with a storageMode property that’s MTLStorageMode.shared or MTLStorageMode.managed
When a blit pass runs this command, the GPU only applies lossless changes to the texture’s underlying data.