The bounds for a subset of an object's elements.
- iOS 8.0+
- macOS 10.11+
- Mac Catalyst 13.0+
- tvOS 9.0+
Metal has many object types that represent arrays of discrete elements. For example, a texture has an array of pixel elements, and a thread grid has an array of computational threads. Use
MTLRegion instances to describe subsets of these objects.
The origin is the front upper-left corner of the region, and its extents go towards the back lower-right corner. Conceptually, when using a
MTLRegion instance to describe a subset of an object, treat the object as a 3D array of elements, even if it has fewer dimensions. For a 2D object, set the z coordinate of the origin to
0 and the depth to
1. For a 1D object, set the y and z coordinates of the origin to
0 and the height and depth to