Contents

setTextureView(texture:descriptor:index:)

Creates a new lightweight texture view.

Declaration

func setTextureView(texture: any MTLTexture, descriptor: MTLTextureViewDescriptor, index: Int) -> MTLResourceID

Parameters

  • texture:

    An Mtltexture instance for which to create a new lightweight texture view.

  • descriptor:

    A descriptor specifying properties of the texture view to create.

  • index:

    An index of a slot in the texture pool into which this method writes the new texture view.

Return Value

The MTLResourceID of a newly created texture view in this pool.

Discussion

This method creates a lightweight texture view over a texture according to a descriptor you provide. It then associates the texture view with a slot in this texture view pool at the index you specify.