---
title: MTLRegion
framework: metal
role: symbol
role_heading: Structure
path: metal/mtlregion
---

# MTLRegion

The bounds for a subset of an instance’s elements.

## Declaration

```swift
struct MTLRegion
```

## Mentioned in

Converting between pixel regions and sparse tile regions

## Overview

Overview Metal has many instance 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 instances. The origin is the front upper-left corner of the region, and its extents go towards the back lower-right corner. Conceptually, when using an MTLRegion instance to describe a subset of an instance, treat the instance as a 3D array of elements, even if it has fewer dimensions. For a 2D instance, set the z coordinate of the origin to 0 and the depth to 1. For a 1D instance, set the y and z coordinates of the origin to 0 and the height and depth to 1.

## Topics

### Creating regions

- [init()](metal/mtlregion/init().md)
- [init(origin:size:)](metal/mtlregion/init(origin:size:).md)
- [MTLRegionMake1D(_:_:)](metal/mtlregionmake1d(_:_:).md)
- [MTLRegionMake2D(_:_:_:_:)](metal/mtlregionmake2d(_:_:_:_:).md)
- [MTLRegionMake3D(_:_:_:_:_:_:)](metal/mtlregionmake3d(_:_:_:_:_:_:).md)

### Getting and setting region information

- [origin](metal/mtlregion/origin.md)
- [size](metal/mtlregion/size.md)

## Relationships

### Conforms To

- [BitwiseCopyable](swift/bitwisecopyable.md)
- [Sendable](swift/sendable.md)

## See Also

### Indirect compute commands

- [MTLIndirectComputeCommand](metal/mtlindirectcomputecommand.md)
- [MTLSize](metal/mtlsize.md)
- [MTLOrigin](metal/mtlorigin.md)
- [MTLStageInRegionIndirectArguments](metal/mtlstageinregionindirectarguments.md)
- [MTLDispatchThreadgroupsIndirectArguments](metal/mtldispatchthreadgroupsindirectarguments.md)
