mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Fix Vello-related GPU out-of-memory issues (#4446)
* Update vello * Reuse vello image atlas slots across frames
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user