Instance Property

framebufferOnly

A Boolean value that indicates whether the texture can only be used as a render target.

Required.

Declaration

@property(readonly, getter=isFramebufferOnly) BOOL framebufferOnly;

Discussion

The default is NO, which indicates the use of the texture is not restricted.

If YES, neither replaceRegion:mipmapLevel:slice:withBytes:bytesPerRow:bytesPerImage: nor getBytes:bytesPerRow:bytesPerImage:fromRegion:mipmapLevel:slice: can be used with this texture. Also, this texture can only be used as an attachment for MTLRenderPassDescriptor and cannot be a texture argument for MTLRenderCommandEncoder, MTLBlitCommandEncoder, or MTLComputeCommandEncoder.

Textures obtained from a CAMetalDrawable object may only be usable as attachments, depending on the value of framebufferOnly passed to their parent CAMetalLayer object. Textures created directly by the app do not have such restrictions.

See Also

Querying Texture Attributes

textureType

The dimension and arrangement of the texture image data.

Required.

pixelFormat

The format of pixels in the texture.

Required.

width

The width of the texture image for the base level mipmap, in pixels.

Required.

height

The height of the texture image for the base level mipmap, in pixels.

Required.

depth

The depth of the texture image for the base level mipmap, in pixels.

Required.

mipmapLevelCount

The number of mipmap levels in the texture.

Required.

arrayLength

The number of slices in the texture array.

Required.

sampleCount

The number of samples in each pixel.

Required.

usage

Options that determine how you can use the texture.

Required.

allowGPUOptimizedContents

A Boolean value indicating whether the GPU is allowed to adjust the contents of the texture to improve GPU performance.

Required.

shareable

A Boolean indicating whether this texture can be shared with other processes.

Required.

swizzle

The pattern that the GPU applies to pixels when you read or sample pixels from the texture.

Required.

MTLTextureType

The dimension of each image, including whether multiple images are arranged into an array or a cube.

MTLTextureUsage

An enumeration for the various options that determine how you can use a texture.