Contents

MTLPixelFormat.bgra10_xr

A 64-bit extended-range pixel format with four fixed-point components of 10-bit blue, 10-bit green, 10-bit red, and 10-bit alpha.

Declaration

case bgra10_xr

Discussion

Pixel components are in blue, green, red, and alpha order, from least significant bit to most significant bit (little-endian order). Each component is a 16-bit chunk arranged as follows:

  • The 10 most-significant bits (bits 6–15) store the component’s data.

  • The 6 least-significant bits (bits 0–5) are padding, and their value is 0.

[Image]

The blue, green, and red components are linearly encoded in a transform from [0,2^10) to [-0.752941, 1.25098]. The formula used in this linear encoding is shader_float = (xr10_value - 384) / 510.0f.

The alpha component is always clamped to a [0.0, 1.0] range in sampling, rendering, and writing operations, despite supporting values outside this range.

To display wide color values on devices with wide color displays, set this pixel format on the colorPixelFormat property of an MTKView or the pixelFormat property of a CAMetalLayer.

See Also

Extended range and wide color pixel formats