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

This commit is contained in:
Timon
2026-09-15 23:46:36 +02:00
committed by Dennis Kobert
parent e8af7dd8c2
commit 7d56b2f8d3
3 changed files with 20 additions and 13 deletions

21
Cargo.lock generated
View File

@@ -1672,9 +1672,9 @@ dependencies = [
[[package]]
name = "font-types"
version = "0.12.2"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a7299a780854a6d391be2ae1c8521c9368471b559dbfd6a8dbd9f407eaff100"
checksum = "75382bc7392ef10aad10935f92fc3db36d2d4dad0e5d96d8d65e04f89a07ec39"
dependencies = [
"bytemuck",
]
@@ -4790,7 +4790,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "046a7d674daf459825b32f5062056d6882db0d2f5a479fbd76ccfc870ac18709"
dependencies = [
"bytemuck",
"font-types 0.12.2",
"font-types 0.12.3",
"once_cell",
]
@@ -6655,8 +6655,9 @@ dependencies = [
[[package]]
name = "vello"
version = "0.9.0"
source = "git+https://github.com/linebender/vello.git?rev=7073a85d61ee099d1d3595651ddf92302b074348#7073a85d61ee099d1d3595651ddf92302b074348"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af76ceb17b2869be23598baef40a9c8db4de86b87c60510c3bc245559275a617"
dependencies = [
"bytemuck",
"futures-intrusive",
@@ -6673,8 +6674,9 @@ dependencies = [
[[package]]
name = "vello_encoding"
version = "0.9.0"
source = "git+https://github.com/linebender/vello.git?rev=7073a85d61ee099d1d3595651ddf92302b074348#7073a85d61ee099d1d3595651ddf92302b074348"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e31cd622201690d8dfe9fd8fea8d1ae59db1bfeea414856a617d1d03438418c"
dependencies = [
"bytemuck",
"guillotiere",
@@ -6685,8 +6687,9 @@ dependencies = [
[[package]]
name = "vello_shaders"
version = "0.9.0"
source = "git+https://github.com/linebender/vello.git?rev=7073a85d61ee099d1d3595651ddf92302b074348#7073a85d61ee099d1d3595651ddf92302b074348"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "abf943bd2920bfd22928a9c1bad39866f7ffcc1109b6ed924ab52773e3868a83"
dependencies = [
"bytemuck",
"log",

View File

@@ -166,9 +166,8 @@ url = "2.5"
tokio = { version = "1.29", features = ["fs", "macros", "io-std", "rt", "rt-multi-thread"] }
# Linebender ecosystem (BEGIN)
kurbo = { version = "0.13", features = ["serde"] }
# TODO: Return to crates.io versions once a release after 0.9 ships the ramp bake's `interpolation_alpha_space` support
vello = { git = "https://github.com/linebender/vello.git", rev = "7073a85d61ee099d1d3595651ddf92302b074348" }
vello_encoding = { git = "https://github.com/linebender/vello.git", rev = "7073a85d61ee099d1d3595651ddf92302b074348" }
vello = "0.10"
vello_encoding = "0.10"
resvg = "0.47"
usvg = "0.47"
simplecss = "0.2"

View File

@@ -2510,8 +2510,13 @@ fn render_raster_gpu_vello<S: LaneSource<Element = Raster<GPU>> + BoundingBox>(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,