<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLAccelerationStructureTriangleGeometryDescriptor/triangleCount",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(cs)MTLAccelerationStructureTriangleGeometryDescriptor(py)triangleCount"
  },
  "title" : "triangleCount"
}
-->

# triangleCount

The number of triangles in the buffers.

```
var triangleCount: Int { get set }
```

## Discussion

If the triangle descriptor contains an index buffer,
then the index buffer needs to provide indices for this many triangles.
If the triangle descriptor doesn’t provide an index buffer,
then the vertex buffer provides 3 vertices for each triangle.

---

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)