Contents

MTLDataType

The parameter type options for GPU functions, such as shaders and compute kernels.

Declaration

enum MTLDataType

Overview

Metal reports or accepts this type in several reflection and configuration contexts, such as:

Normalized integer types

Color types with Snorm in the name are normalized signed integer types. For these types, values in the range [-1.0, 1.0] map to [MIN_INT, MAX_INT], where MIN_INT is the most negative integer and MAX_INT is the most positive integer for the number of bits in the storage size. Positive values and zero distribute uniformly in the range [0.0, 1.0], and negative integer values greater than (MIN_INT + 1) distribute uniformly in the range (-1.0, 0.0).

Color types with Unorm in the name are normalized unsigned integer types. For these types, values in the range [0.0, 1.0] map to [0, MAX_UINT], where MAX_UINT is the largest unsigned integer for the number of bits in the storage size.

Metal stores data in little-endian byte order, with the least-significant byte at the lowest memory address. Formats with multibyte components also store each component in little-endian byte order.

Topics

64-bit integer types

64-bit color integer types

32-bit floating-point types

32-bit floating-point matrix types

32-bit color floating-point types

32-bit color integer types

32-bit integer types

16-bit floating-point types

16-bit floating-point matrix types

16-bit brain floating-point types

16-bit integer types

16-bit color integer types

8-bit integer types

8-bit color integer types

Boolean types

Resource types

Collection types

Sentinel values

Swift support

See Also

Shader types