Type Property

pixelFormatView

An option for creating texture views.

Declaration

static var pixelFormatView: MTLTextureUsage { get }

Discussion

This option allows you to call either of these methods of the given texture to create a texture view:

Set this option if your texture view reinterprets the pixel format layout; for example, if your texture uses the MTLPixelFormat.rgba8Unorm pixel format and your texture view uses MTLPixelFormat.r32Uint.

Don’t set this option if your texture view doesn’t change pixel size or layout; for example, if your texture uses the MTLPixelFormat.rgba8Unorm pixel format and your texture view uses MTLPixelFormat.bgra8Unorm.

Don’t set this option if your texture view only converts between linear space and sRGB; for example, if your texture uses the MTLPixelFormat.rgba8Unorm pixel format and your texture view uses MTLPixelFormat.bgra8Unorm_srgb.

In iOS devices with GPU family 5, Metal doesn’t apply lossless compression to the given texture if you set this option.

See Also

Specifying Texture Usage Options

static var unknown: MTLTextureUsage

An option for a texture whose usage is unknown.

static var shaderRead: MTLTextureUsage

An option for reading or sampling from the texture in a shader.

static var shaderWrite: MTLTextureUsage

An option for writing to the texture in a shader.

static var renderTarget: MTLTextureUsage

An option for rendering to the texture in a render pass.