---
title: "init(width:height:depth:)"
framework: metal
role: symbol
role_heading: Initializer
path: "metal/mtlsize/init(width:height:depth:)"
---

# init(width:height:depth:)

Creates a size instance with values for its width, height, and depth properties.

## Declaration

```swift
init(width: Int, height: Int, depth: Int)
```

## Parameters

- `width`: A value for the x-axis dimension.
- `height`: A value for the y-axis dimension. Pass 1 for sizes with one dimension.
- `depth`: A value for the z-axis dimension. Pass 1 for sizes with one or two dimensions.

## See Also

### Creating a size instance

- [init()](metal/mtlsize/init().md)
- [MTLSizeMake(_:_:_:)](metal/mtlsizemake(_:_:_:).md)
