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

# cp_drawable_get_texture_count

Returns the number of color and depth textures available in the drawable.

```
size_t cp_drawable_get_texture_count(cp_drawable_t drawable);
```

## Parameters

`drawable`

The drawable for a frame.

## Return Value

The number of textures available for drawing. For example, a return value of `2` indicates there are two color textures and two depth textures available.

## Discussion

Use the returned value as the maximum number of textures to retrieve from the [`cp_drawable_get_color_texture`](/documentation/CompositorServices/cp_drawable_get_color_texture) or [`cp_drawable_get_depth_texture`](/documentation/CompositorServices/cp_drawable_get_depth_texture) functions.

---

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)