<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLSize/init(width:height:depth:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "s:So7MTLSizea5width6height5depthABSi_S2itcfc"
  },
  "title" : "init(width:height:depth:)"
}
-->

# init(width:height:depth:)

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

```
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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)