# register_effect_prewarm

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/rendering/composition/effects/function-register_effect_prewarm/

**function** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
fn register_effect_prewarm(name: &str, effect: impl Into<super::GraphicsEffect>, animatable_properties: &[&str]) -> Result<(), super::CompositionEffectFactoryError>
```

Registers `effect` (with its animatable properties, as for
`Compositor::create_effect_factory_with_properties`)
under `name` for the prewarm of the GPU programs: after a frame, each
composition target that has not drawn it yet draws it once offscreen,
with the values of the description, at its scaling, so that the GPU
backend makes its programs before the first frame that shows it.

The source parameters of the effect are drawn as an image (they are
bound to brushes only when the effect is used). A name that is
registered already keeps its effect. Fails as the factory of the effect
would.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/rendering/composition/effects/effect_prewarm.rs#L148)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
