---
title: "didModifyRange(_:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtlbuffer/didmodifyrange(_:)"
---

# didModifyRange(_:)

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

## Declaration

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

## Parameters

- `range`: The range of bytes that have been modified.

## Discussion

Discussion If you write information to a buffer created with the 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.
