---
title: "minimumLinearTextureAlignment(for:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtldevice/minimumlineartexturealignment(for:)"
---

# minimumLinearTextureAlignment(for:)

Returns the minimum alignment the GPU device requires to create a linear texture from a buffer.

## Declaration

```swift
func minimumLinearTextureAlignment(for format: MTLPixelFormat) -> Int
```

## Parameters

- `format`: An doc://com.apple.metal/documentation/Metal/MTLPixelFormat instance that can’t be any of the depth, stencil, or compressed pixel formats.

## Mentioned in

Developing Metal apps that run in Simulator

## Discussion

Discussion Metal aligns linear textures to their minimum alignment value, which directly affects the makeTexture(descriptor:offset:bytesPerRow:) method’s offset and bytesPerRow parameters.

## See Also

### Creating textures

- [makeTexture(descriptor:)](metal/mtldevice/maketexture(descriptor:).md)
- [makeTexture(descriptor:iosurface:plane:)](metal/mtldevice/maketexture(descriptor:iosurface:plane:).md)
- [makeSharedTexture(descriptor:)](metal/mtldevice/makesharedtexture(descriptor:).md)
- [makeSharedTexture(handle:)](metal/mtldevice/makesharedtexture(handle:).md)
- [minimumTextureBufferAlignment(for:)](metal/mtldevice/minimumtexturebufferalignment(for:).md)
