Contents

optimizeContents(forGPUAccess:slice:level:)

Encodes a command that modifies the contents of a texture instance to improve the performance of GPU accesses to its contents in a specific region.

Declaration

func optimizeContents(forGPUAccess texture: any MTLTexture, slice: Int, level: Int)

Parameters

  • texture:

    A Mtltexture the command optimizes for GPU access.

  • slice:

    A slice within texture.

  • level:

    A mipmap level within texture.

Discussion

Optimizing a texture for GPU access may affect the performance of CPU accesses, however, the data the CPU retrieves from the texture remains consistent.

You typically run this command for:

See Also

Encoding optimization commands