<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLBuffer/addDebugMarker(_:range:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "s:So9MTLBufferP5MetalE14addDebugMarker_5rangeySS_SnySiGtF"
  },
  "title" : "addDebugMarker(_:range:)"
}
-->

# addDebugMarker(_:range:)

Adds a debug marker string to a specific buffer range.

```
func addDebugMarker(_ marker: String, range: Range<Int>)
```

## Parameters

`marker`

A string that identifies the marked buffer range.

`range`

The range of bytes that you want to identify.

---

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)