---
title: "imageblockMemoryLength(forDimensions:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlrenderpipelinestate/imageblockmemorylength(fordimensions:)"
---

# imageblockMemoryLength(forDimensions:)

Returns the length of an imageblock’s memory for the specified imageblock dimensions.

## Declaration

```swift
func imageblockMemoryLength(forDimensions imageblockDimensions: MTLSize) -> Int
```

## Parameters

- `imageblockDimensions`: An doc://com.apple.metal/documentation/Metal/MTLSize instance that represent the dimensions of an imageblock.

## Discussion

Discussion The imageblock dimensions need to match a valid tile size, such as one of the following: 32 x 32 32 x 16 16 x 16 The GPU partitions tile memory between imageblocks and threadgroup memory, important: The total memory allocations for imageblocks and threadgroup memory can’t exceed the tile memory limit for the GPU device. For information about identifying tile memory limits for GPU devices, see either of the following: Metal Feature Set Tables (PDF) Metal Feature Set Tables (Numbers)

## See Also

### Checking tile shader memory requirements

- [maxTotalThreadsPerThreadgroup](metal/mtlrenderpipelinestate/maxtotalthreadsperthreadgroup.md)
- [threadgroupSizeMatchesTileSize](metal/mtlrenderpipelinestate/threadgroupsizematchestilesize.md)
- [imageblockSampleLength](metal/mtlrenderpipelinestate/imageblocksamplelength.md)
