<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 10.11.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLBuffer/didModifyRange(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "s:So9MTLBufferP5MetalE14didModifyRangeyySnySiGF"
  },
  "title" : "didModifyRange(_:)"
}
-->

# didModifyRange(_:)

Informs the GPU that the CPU has modified a section of the buffer.

```
func didModifyRange(_ range: Range<Int>)
```

## Parameters

`range`

The range of bytes that have been modified.

## Discussion

If you write information to a buffer created with the [`MTLStorageMode.managed`](/documentation/Metal/MTLStorageMode/managed) storage mode, you need to call this method to inform the GPU that the information has changed. If you execute GPU commands that read the data without calling this method first, the behavior is undefined.

---

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)