<!--
{
  "availability" : [
    "macOS: 26.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CompositorServices",
  "identifier" : "/documentation/CompositorServices/LayerRenderer/Drawable/View/TextureMap-swift.struct/viewport",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Compositor Services",
      "CompositorServices"
    ],
    "preciseIdentifier" : "c:@F@cp_view_texture_map_get_viewport"
  },
  "title" : "viewport"
}
-->

# viewport

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

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

## 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.

---

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)