<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalPerformanceShaders",
  "identifier" : "/documentation/MetalPerformanceShaders/MPSMatrixDescriptor",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Metal Performance Shaders"
    ],
    "preciseIdentifier" : "c:objc(cs)MPSMatrixDescriptor"
  },
  "title" : "MPSMatrixDescriptor"
}
-->

# MPSMatrixDescriptor

A description of attributes used to create an MPS matrix.

```
class MPSMatrixDescriptor
```

## Overview

Matrix data is assumed to be stored in row-major order.

## Topics

### Initializers

[`init(rows:columns:matrices:rowBytes:matrixBytes:dataType:)`](/documentation/MetalPerformanceShaders/MPSMatrixDescriptor/init(rows:columns:matrices:rowBytes:matrixBytes:dataType:))

[`init(rows:columns:rowBytes:dataType:)`](/documentation/MetalPerformanceShaders/MPSMatrixDescriptor/init(rows:columns:rowBytes:dataType:))

### Methods

[`init(dimensions:columns:rowBytes:dataType:)`](/documentation/MetalPerformanceShaders/MPSMatrixDescriptor/init(dimensions:columns:rowBytes:dataType:))

Creates a matrix descriptor with the specified dimensions and data type.

[`rowBytes(fromColumns:dataType:)`](/documentation/MetalPerformanceShaders/MPSMatrixDescriptor/rowBytes(fromColumns:dataType:))

Determines the recommended matrix row stride, in bytes, for a given number of columns.

[`rowBytes(forColumns:dataType:)`](/documentation/MetalPerformanceShaders/MPSMatrixDescriptor/rowBytes(forColumns:dataType:))

### Properties

[`rows`](/documentation/MetalPerformanceShaders/MPSMatrixDescriptor/rows)

The number of rows in the matrix.

[`columns`](/documentation/MetalPerformanceShaders/MPSMatrixDescriptor/columns)

The number of columns in the matrix.

[`dataType`](/documentation/MetalPerformanceShaders/MPSMatrixDescriptor/dataType)

The type of the values in the matrix.

[`MPSDataType`](/documentation/MetalPerformanceShaders/MPSDataType)

A value to specify a type of data.

[`rowBytes`](/documentation/MetalPerformanceShaders/MPSMatrixDescriptor/rowBytes)

The stride, in bytes, between corresponding elements of consecutive rows in the matrix.

[`matrices`](/documentation/MetalPerformanceShaders/MPSMatrixDescriptor/matrices)

[`matrixBytes`](/documentation/MetalPerformanceShaders/MPSMatrixDescriptor/matrixBytes)



---

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)