Contents

isFramebufferOnly

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

Declaration

var isFramebufferOnly: Bool { get }

Discussion

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

If true, neither replace(region:mipmapLevel:slice:withBytes:bytesPerRow:bytesPerImage:) nor getBytes(_:bytesPerRow:bytesPerImage:from: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 you obtain from a CAMetalDrawable instance are only usable as attachments, depending on the value of framebufferOnly passed to their parent CAMetalLayer instance. These restrictions don’t apply to textures that your app creates directly.

See Also

Querying texture attributes