Integrate Vello for vector rendering (#1802)

* Start integrating vello into render pipeline

Cache vello render creation

Implement viewport navigation

Close vello path

Add transform parameter to vello render pass

* Fix render node types

* Fix a bunch of bugs in the path translation

* Avoid panic on empty document

* Fix rendering of holes

* Implement image rendering

* Implement graph recompilation afer editor api change

* Implement preferences toggle for using vello as the renderer

* Make surface creation optional

* Feature gate vello usages

* Implement skeleton for radial gradient

* Rename vello preference

* Fix some gradients

* Only update monitor nodes on graph recompile

* Fix warnings + remove dead code

* Update everything except for thumbnails after a node graph evaluation

* Fix missing click targets for Image frames

* Improve perfamance by removing unecessary widget updates

* Fix node graph paning

* Fix thumbnail loading

* Implement proper hash for vector modification

* Fix test and warnings

* Code review

* Fix dep

* Remove warning

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Dennis Kobert
2024-07-22 01:56:29 -07:00
committed by GitHub
co-authored by Keavon Chambers
parent 8e774efe9d
commit ab71d26d84
41 changed files with 805 additions and 758 deletions
Generated
+89 -259
View File
@@ -570,6 +570,7 @@ version = "0.4.0"
dependencies = [
"dyn-any",
"glam",
"kurbo",
"log",
"serde",
]
@@ -1232,17 +1233,6 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991"
[[package]]
name = "d3d12"
version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3e3d747f100290a1ca24b752186f61f6637e1deffe3bf6320de6fcb29510a307"
dependencies = [
"bitflags 2.6.0",
"libloading 0.8.4",
"winapi",
]
[[package]]
name = "d3d12"
version = "0.20.0"
@@ -1683,9 +1673,12 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
[[package]]
name = "font-types"
version = "0.4.3"
version = "0.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b7f6040d337bd44434ab21fc6509154edf2cece88b23758d9d64654c4e7730b"
checksum = "34fd7136aca682873d859ef34494ab1a7d3f57ecd485ed40eb6437ee8c85aa29"
dependencies = [
"bytemuck",
]
[[package]]
name = "fontconfig-parser"
@@ -2036,9 +2029,9 @@ dependencies = [
[[package]]
name = "gif"
version = "0.12.0"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "80792593675e051cf94a4b111980da2ba60d4a83e43e0048c5693baab3977045"
checksum = "3fb2d69b19215e18bb912fa30f7ce15846e301408695e44e0ef719f1da9e19f2"
dependencies = [
"color_quant",
"weezl",
@@ -2243,17 +2236,6 @@ dependencies = [
"wgpu-executor",
]
[[package]]
name = "gpu-descriptor"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc11df1ace8e7e564511f53af41f3e42ddc95b56fd07b3f4445d2a6048bc682c"
dependencies = [
"bitflags 2.6.0",
"gpu-descriptor-types 0.1.2",
"hashbrown 0.14.5",
]
[[package]]
name = "gpu-descriptor"
version = "0.3.0"
@@ -2261,19 +2243,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c08c1f623a8d0b722b8b99f821eb0ba672a1618f0d3b16ddbee1cedd2dd8557"
dependencies = [
"bitflags 2.6.0",
"gpu-descriptor-types 0.2.0",
"gpu-descriptor-types",
"hashbrown 0.14.5",
]
[[package]]
name = "gpu-descriptor-types"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6bf0b36e6f090b7e1d8a4b49c0cb81c1f8376f72198c65dd3ad9ff3556b8b78c"
dependencies = [
"bitflags 2.6.0",
]
[[package]]
name = "gpu-descriptor-types"
version = "0.2.0"
@@ -2348,7 +2321,7 @@ dependencies = [
"serde_json",
"tokio",
"wasm-bindgen",
"wgpu 0.20.1",
"wgpu",
"wgpu-executor",
]
@@ -2364,7 +2337,7 @@ dependencies = [
"half",
"image 0.25.1",
"js-sys",
"kurbo 0.11.0 (git+https://github.com/linebender/kurbo.git)",
"kurbo",
"log",
"node-macro",
"num-derive",
@@ -2377,6 +2350,7 @@ dependencies = [
"spirv-std",
"tokio",
"usvg",
"vello",
"wasm-bindgen",
"web-sys",
]
@@ -2417,7 +2391,7 @@ dependencies = [
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
"wgpu 0.20.1",
"wgpu",
"wgpu-executor",
"wgpu-types 0.17.0",
"winit",
@@ -2505,7 +2479,7 @@ dependencies = [
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
"wgpu 0.20.1",
"wgpu",
]
[[package]]
@@ -3090,7 +3064,7 @@ dependencies = [
"num-traits",
"once_cell",
"serde",
"wgpu 0.20.1",
"wgpu",
"wgpu-executor",
]
@@ -3262,39 +3236,11 @@ dependencies = [
"selectors",
]
[[package]]
name = "kurbo"
version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd85a5776cd9500c2e2059c8c76c3b01528566b7fcbaf8098b55a33fc298849b"
dependencies = [
"arrayvec",
]
[[package]]
name = "kurbo"
version = "0.10.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1618d4ebd923e97d67e7cd363d80aef35fe961005cbbbb3d2dad8bdd1bc63440"
dependencies = [
"arrayvec",
"smallvec",
]
[[package]]
name = "kurbo"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e5aa9f0f96a938266bdb12928a67169e8d22c6a786fda8ed984b85e6ba93c3c"
dependencies = [
"arrayvec",
"smallvec",
]
[[package]]
name = "kurbo"
version = "0.11.0"
source = "git+https://github.com/linebender/kurbo.git#c9843e8d4a6cd376922c827055eeb43e653f14d0"
dependencies = [
"arrayvec",
"serde",
@@ -3528,21 +3474,6 @@ dependencies = [
"autocfg",
]
[[package]]
name = "metal"
version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c43f73953f8cbe511f021b58f18c3ce1c3d1ae13fe953293e13345bf83217f25"
dependencies = [
"bitflags 2.6.0",
"block",
"core-graphics-types",
"foreign-types 0.5.0",
"log",
"objc",
"paste",
]
[[package]]
name = "metal"
version = "0.28.0"
@@ -3601,26 +3532,6 @@ dependencies = [
"windows-sys 0.48.0",
]
[[package]]
name = "naga"
version = "0.19.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50e3524642f53d9af419ab5e8dd29d3ba155708267667c2f3f06c88c9e130843"
dependencies = [
"bit-set",
"bitflags 2.6.0",
"codespan-reporting",
"hexf-parse",
"indexmap 2.2.6",
"log",
"num-traits",
"rustc-hash 1.1.0",
"spirv",
"termcolor",
"thiserror",
"unicode-xid",
]
[[package]]
name = "naga"
version = "0.20.0"
@@ -4187,9 +4098,9 @@ dependencies = [
[[package]]
name = "openssl"
version = "0.10.64"
version = "0.10.66"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f"
checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1"
dependencies = [
"bitflags 2.6.0",
"cfg-if",
@@ -4219,9 +4130,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
[[package]]
name = "openssl-sys"
version = "0.9.102"
version = "0.9.103"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2"
checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6"
dependencies = [
"cc",
"libc",
@@ -4356,7 +4267,7 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c28d7294093837856bb80ad191cc46a2fcec8a30b43b7a3b0285325f0a917a9"
dependencies = [
"kurbo 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"kurbo",
"smallvec",
]
@@ -4489,7 +4400,7 @@ version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7"
dependencies = [
"siphasher",
"siphasher 0.3.11",
]
[[package]]
@@ -4498,7 +4409,7 @@ version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096"
dependencies = [
"siphasher",
"siphasher 0.3.11",
]
[[package]]
@@ -4507,7 +4418,7 @@ version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b"
dependencies = [
"siphasher",
"siphasher 0.3.11",
]
[[package]]
@@ -4928,10 +4839,11 @@ dependencies = [
[[package]]
name = "read-fonts"
version = "0.15.6"
version = "0.19.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "17ea23eedb4d938031b6d4343222444608727a6aa68ec355e13588d9947ffe92"
checksum = "e8b8af39d1f23869711ad4cea5e7835a20daa987f80232f7f2a2374d648ca64d"
dependencies = [
"bytemuck",
"font-types",
]
@@ -5116,9 +5028,9 @@ dependencies = [
[[package]]
name = "resvg"
version = "0.39.0"
version = "0.41.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16a15c715c5a88eedff8cd54e2821f39f6ee4345964fd48986c0615d5a24cbe5"
checksum = "c2327ced609dadeed3e9702fec3e6b2ddd208758a9268d13e06566c6101ba533"
dependencies = [
"gif",
"jpeg-decoder",
@@ -5295,16 +5207,16 @@ checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6"
[[package]]
name = "rustybuzz"
version = "0.12.1"
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0ae5692c5beaad6a9e22830deeed7874eae8a4e3ba4076fb48e12c56856222c"
checksum = "88117946aa1bfb53c2ae0643ceac6506337f44887f8c9fbfb43587b1cc52ba49"
dependencies = [
"bitflags 2.6.0",
"bytemuck",
"smallvec",
"ttf-parser 0.20.0",
"unicode-bidi-mirroring 0.1.0",
"unicode-ccc 0.1.2",
"unicode-bidi-mirroring 0.2.0",
"unicode-ccc 0.2.0",
"unicode-properties",
"unicode-script",
]
@@ -5668,11 +5580,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d"
[[package]]
name = "skrifa"
version = "0.15.5"
name = "siphasher"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eff28ee3b66d43060ef9a327e0f18e4c1813f194120156b4d4524fac3ba8ce22"
checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d"
[[package]]
name = "skrifa"
version = "0.19.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ab45fb68b53576a43d4fc0e9ec8ea64e29a4d2cc7f44506964cb75f288222e9"
dependencies = [
"bytemuck",
"read-fonts",
]
@@ -5959,12 +5878,12 @@ checksum = "20e16a0f46cf5fd675563ef54f26e83e20f2366bcf027bcb3cc3ed2b98aaf2ca"
[[package]]
name = "svgtypes"
version = "0.14.0"
version = "0.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59d7618f12b51be8171a7cfdda1e7a93f79cbc57c4e7adf89a749cf671125241"
checksum = "fae3064df9b89391c9a76a0425a69d124aee9c5c28455204709e72c39868a43c"
dependencies = [
"kurbo 0.10.4",
"siphasher",
"kurbo",
"siphasher 1.0.1",
]
[[package]]
@@ -6832,9 +6751,9 @@ checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75"
[[package]]
name = "unicode-bidi-mirroring"
version = "0.1.0"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56d12260fb92d52f9008be7e4bca09f584780eb2266dc8fecc6a192bec561694"
checksum = "23cb788ffebc92c5948d0e997106233eeb1d8b9512f93f41651f52b6c5f5af86"
[[package]]
name = "unicode-bidi-mirroring"
@@ -6844,9 +6763,9 @@ checksum = "64af057ad7466495ca113126be61838d8af947f41d93a949980b2389a118082f"
[[package]]
name = "unicode-ccc"
version = "0.1.2"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc2520efa644f8268dce4dcd3050eaa7fc044fca03961e9998ac7e2e92b77cf1"
checksum = "1df77b101bcc4ea3d78dafc5ad7e4f58ceffe0b2b16bf446aeb50b6cb4157656"
[[package]]
name = "unicode-ccc"
@@ -6925,22 +6844,22 @@ dependencies = [
[[package]]
name = "usvg"
version = "0.39.0"
version = "0.41.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e753216e7c0e49048a0c986ed9ad7284451844a21107374392aaa107ec805c9c"
checksum = "5c704361d822337cfc00387672c7b59eaa72a1f0744f62b2a68aa228a0c6927d"
dependencies = [
"base64 0.21.7",
"base64 0.22.1",
"data-url",
"flate2",
"fontdb",
"imagesize",
"kurbo 0.9.5",
"kurbo",
"log",
"pico-args",
"roxmltree",
"rustybuzz 0.12.1",
"rustybuzz 0.13.0",
"simplecss",
"siphasher",
"siphasher 1.0.1",
"strict-num",
"svgtypes",
"tiny-skia-path",
@@ -6985,29 +6904,46 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
[[package]]
name = "vello"
version = "0.1.0"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9a4b96a2d6d6effa67868b4436560e3a767f71f0e043df007587c5d6b2e8b7a"
checksum = "d08e6dd8a058d02acc1dff78487a0fa34c79bd9b85c01123d97b9134bfd48b24"
dependencies = [
"bytemuck",
"futures-intrusive",
"log",
"peniko",
"raw-window-handle 0.6.2",
"skrifa",
"static_assertions",
"thiserror",
"vello_encoding",
"wgpu 0.19.4",
"vello_shaders",
"wgpu",
]
[[package]]
name = "vello_encoding"
version = "0.1.0"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c5b6c6ec113c9b6ee1e1894ccef1b5559373aead718b7442811f2fefff7d423"
checksum = "77306d1ae01e2ef6a2e5dfd6f81696556ddee3e15f6a7422f360759672a0fd90"
dependencies = [
"bytemuck",
"guillotiere",
"peniko",
"skrifa",
"smallvec",
]
[[package]]
name = "vello_shaders"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f3f31e3763e09febb449533238551bca5203aff4513324c8558b4c0b1c546fb"
dependencies = [
"bytemuck",
"naga",
"thiserror",
"vello_encoding",
]
[[package]]
@@ -7387,31 +7323,6 @@ version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082"
[[package]]
name = "wgpu"
version = "0.19.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cbd7311dbd2abcfebaabf1841a2824ed7c8be443a0f29166e5d3c6a53a762c01"
dependencies = [
"arrayvec",
"cfg-if",
"cfg_aliases 0.1.1",
"js-sys",
"log",
"naga 0.19.2",
"parking_lot",
"profiling",
"raw-window-handle 0.6.2",
"smallvec",
"static_assertions",
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
"wgpu-core 0.19.4",
"wgpu-hal 0.19.4",
"wgpu-types 0.19.2",
]
[[package]]
name = "wgpu"
version = "0.20.1"
@@ -7424,7 +7335,7 @@ dependencies = [
"document-features",
"js-sys",
"log",
"naga 0.20.0",
"naga",
"parking_lot",
"profiling",
"raw-window-handle 0.6.2",
@@ -7433,37 +7344,11 @@ dependencies = [
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
"wgpu-core 0.21.1",
"wgpu-hal 0.21.1",
"wgpu-core",
"wgpu-hal",
"wgpu-types 0.20.0",
]
[[package]]
name = "wgpu-core"
version = "0.19.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28b94525fc99ba9e5c9a9e24764f2bc29bad0911a7446c12f446a8277369bf3a"
dependencies = [
"arrayvec",
"bit-vec",
"bitflags 2.6.0",
"cfg_aliases 0.1.1",
"codespan-reporting",
"indexmap 2.2.6",
"log",
"naga 0.19.2",
"once_cell",
"parking_lot",
"profiling",
"raw-window-handle 0.6.2",
"rustc-hash 1.1.0",
"smallvec",
"thiserror",
"web-sys",
"wgpu-hal 0.19.4",
"wgpu-types 0.19.2",
]
[[package]]
name = "wgpu-core"
version = "0.21.1"
@@ -7479,7 +7364,7 @@ dependencies = [
"document-features",
"indexmap 2.2.6",
"log",
"naga 0.20.0",
"naga",
"once_cell",
"parking_lot",
"profiling",
@@ -7488,7 +7373,7 @@ dependencies = [
"smallvec",
"thiserror",
"web-sys",
"wgpu-hal 0.21.1",
"wgpu-hal",
"wgpu-types 0.20.0",
]
@@ -7512,56 +7397,12 @@ dependencies = [
"nvtx",
"serde",
"spirv",
"vello",
"web-sys",
"wgpu 0.20.1",
"wgpu",
"winit",
]
[[package]]
name = "wgpu-hal"
version = "0.19.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc1a4924366df7ab41a5d8546d6534f1f33231aa5b3f72b9930e300f254e39c3"
dependencies = [
"android_system_properties",
"arrayvec",
"ash",
"bit-set",
"bitflags 2.6.0",
"block",
"cfg_aliases 0.1.1",
"core-graphics-types",
"d3d12 0.19.0",
"glow",
"glutin_wgl_sys",
"gpu-alloc",
"gpu-allocator",
"gpu-descriptor 0.2.4",
"hassle-rs",
"js-sys",
"khronos-egl",
"libc",
"libloading 0.8.4",
"log",
"metal 0.27.0",
"naga 0.19.2",
"ndk-sys 0.5.0+25.2.9519653",
"objc",
"once_cell",
"parking_lot",
"profiling",
"range-alloc",
"raw-window-handle 0.6.2",
"renderdoc-sys",
"rustc-hash 1.1.0",
"smallvec",
"thiserror",
"wasm-bindgen",
"web-sys",
"wgpu-types 0.19.2",
"winapi",
]
[[package]]
name = "wgpu-hal"
version = "0.21.1"
@@ -7576,20 +7417,20 @@ dependencies = [
"block",
"cfg_aliases 0.1.1",
"core-graphics-types",
"d3d12 0.20.0",
"d3d12",
"glow",
"glutin_wgl_sys",
"gpu-alloc",
"gpu-allocator",
"gpu-descriptor 0.3.0",
"gpu-descriptor",
"hassle-rs",
"js-sys",
"khronos-egl",
"libc",
"libloading 0.8.4",
"log",
"metal 0.28.0",
"naga 0.20.0",
"metal",
"naga",
"ndk-sys 0.5.0+25.2.9519653",
"objc",
"once_cell",
@@ -7618,17 +7459,6 @@ dependencies = [
"web-sys",
]
[[package]]
name = "wgpu-types"
version = "0.19.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b671ff9fb03f78b46ff176494ee1ebe7d603393f42664be55b64dc8d53969805"
dependencies = [
"bitflags 2.6.0",
"js-sys",
"web-sys",
]
[[package]]
name = "wgpu-types"
version = "0.20.0"