<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.4.0 -",
    "macOS: 10.15.4 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLRasterizationRateLayerDescriptor/initWithSampleCount:horizontal:vertical:",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(cs)MTLRasterizationRateLayerDescriptor(im)initWithSampleCount:horizontal:vertical:"
  },
  "title" : "initWithSampleCount:horizontal:vertical:"
}
-->

# initWithSampleCount:horizontal:vertical:

Initializes the layer map with the provided grid size and rasterization rates.

```
- (instancetype) initWithSampleCount:(MTLSize) sampleCount horizontal:(const float *) horizontal vertical:(const float *) vertical;
```

## Parameters

`sampleCount`

The size of the grid. Specify the width and height to determine the number of columns and rows in the layer map. The initializer ignores the depth component.

`horizontal`

The rasterization rates for the layer map’s columns. There needs to be at least as many samples as the width you specified in `sampleCount`.

`vertical`

The rasterization rates for the layer map’s columns. There needs to be at least as many samples as the height you specified in `sampleCount`.

## Return Value

A layer descriptor with a grid of the specified size. The layer descriptor copies the  rasterization rates.

---

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)