optimizeContentsForGPUAccess(texture:slice:level:)
Encodes a command that improves the performance of GPU memory operations with a specific portion of a texture.
Declaration
func optimizeContentsForGPUAccess(texture: any MTLTexture, slice: Int, level: Int)Parameters
- texture:
A texture the command optimizes.
- slice:
A slice within
texture. - level:
A mipmap level within
texture.
Mentioned in
Discussion
This command can reduce the time it takes the GPU to access a texture. Apps typically run the command for:
Textures the GPU 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.