---
title: "prepareRender(_:from:to:at:)"
framework: coreimage
role: symbol
role_heading: Instance Method
path: "coreimage/cicontext/preparerender(_:from:to:at:)"
---

# prepareRender(_:from:to:at:)

An optional call to warm up a CIContext so that subsequent calls to render with the same arguments run more efficiently.

## Declaration

```swift
func prepareRender(_ image: CIImage, from fromRect: CGRect, to destination: CIRenderDestination, at atPoint: CGPoint) throws
```

## Parameters

- `image`: doc://com.apple.coreimage/documentation/CoreImage/CIImage to prepare to render.
- `fromRect`: A doc://com.apple.documentation/documentation/CoreFoundation/CGRect defining the region to render.
- `destination`: The doc://com.apple.coreimage/documentation/CoreImage/CIRenderDestination to which you are preparing to render.
- `atPoint`: The doc://com.apple.documentation/documentation/CoreFoundation/CGPoint at which you are preparing to render.

## Discussion

Discussion By making this call, the Core Image framework ensures that any needed kernels are compiled, and any intermediate buffers are allocated and marked volatile up front.

## See Also

### Customizing Render Destination

- [startTask(toClear:)](coreimage/cicontext/starttask(toclear:).md)
- [startTask(toRender:from:to:at:)](coreimage/cicontext/starttask(torender:from:to:at:).md)
- [startTask(toRender:to:)](coreimage/cicontext/starttask(torender:to:).md)
