Fix Vello-related GPU out-of-memory issues (#4446)

* Update vello

* Reuse vello image atlas slots across frames
This commit is contained in:
Timon
2026-08-27 15:19:00 +00:00
committed by GitHub
parent 681b38d3d6
commit 8c48d5acce
3 changed files with 20 additions and 13 deletions

View File

@@ -2535,8 +2535,13 @@ fn render_raster_gpu_item_to_vello(item: ItemRef<'_, Raster<GPU>>, scene: &mut S
let width = raster.data().width();
let height = raster.data().height();
let resource_override_index = context.resource_overrides.len();
// Stable across frames so vello reuses the atlas slot; high bit avoids Blob::new counter ids.
let blob_id = (resource_override_index as u64) << 40 | (width as u64) << 20 | height as u64 | 1 << 63;
let blob = peniko::Blob::from_raw_parts(LAZY_ARC_VEC_ZERO_U8.deref().clone(), blob_id);
let image = peniko::ImageBrush::new(peniko::ImageData {
data: peniko::Blob::new(LAZY_ARC_VEC_ZERO_U8.deref().clone()),
data: blob,
format: peniko::ImageFormat::Rgba8,
width,
height,