<!--
{
  "availability" : [
    "macOS: 26.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CompositorServices",
  "identifier" : "/documentation/CompositorServices/cp_view_texture_map_t",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "Compositor Services"
    ],
    "preciseIdentifier" : "c:@T@cp_view_texture_map_t"
  },
  "title" : "cp_view_texture_map_t"
}
-->

# cp_view_texture_map_t

A type that provides details about the textures associated with a view.

```
typedef struct cp_view_texture_map * cp_view_texture_map_t;
```

## Discussion

A texture map helps you locate the content for a specific view within a texture. Texture maps are especially important when a layer uses a single texture to manage multiple views. For example, a head-mounted display might store the images for both the left and right eyes in a single texture. Pass this type to other functions to get specific details about the current texture, such as its view bounds or its index into a texture array.

## Topics

### Getting the viewport

[`var viewport: MTLViewport`](/documentation/CompositorServices/LayerRenderer/Drawable/View/TextureMap-swift.struct/viewport)

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

### Getting the texture indices

[`var sliceIndex: Int`](/documentation/CompositorServices/LayerRenderer/Drawable/View/TextureMap-swift.struct/sliceIndex)

The index of the view’s texture in an array-based texture type.

[`var textureIndex: Int`](/documentation/CompositorServices/LayerRenderer/Drawable/View/TextureMap-swift.struct/textureIndex)

The index of the view’s textures in the drawable.



---

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)