---
title: viewport
framework: compositorservices
role: symbol
role_heading: Instance Property
path: compositorservices/layerrenderer/drawable/view/texturemap-swift.struct/viewport
---

# viewport

The portion of the texture that the view uses to draw its content.

## Declaration

```swift
var viewport: MTLViewport { get }
```

## Discussion

Discussion This retrieves the size of the view and its location within the texture. If the layer dedicates a separate texture to each view, the texture bounds and view bounds match. However, if the layer uses a shared or layered texture, the view’s location or other slice index might differ.

## See Also

### Getting the view’s texture map

- [textureMap](compositorservices/layerrenderer/drawable/view/texturemap-swift.property.md)
- [textureIndex](compositorservices/layerrenderer/drawable/view/texturemap-swift.struct/textureindex.md)
- [sliceIndex](compositorservices/layerrenderer/drawable/view/texturemap-swift.struct/sliceindex.md)
