| author | |
| committer | |
| log | 448a673c23c6d2c5e6bc7c1b4751faa5761cd5d8 |
| tree | a5970d0aa913c33d0309ea23d5859b11854e3599 |
| parent | ff950de2d8df46a71fe6ad45cbb5b20c133047e2 |
| signature | Signed by SSH key SHA256:52mNGHRsVFBDED9IAX5pe+LRWUefqTbxEReunq21QvU |
- model: mlua is native-only; wasm32 gets a pure-Rust Lua-subset evaluator
(math/trig, iif/and/or, node refs, Point/Text) checked against mlua in a parity test
- engine: cpal/symphonia native-only, audio/export/RAM prefetcher compiled out on wasm32,
unused theme dep dropped, MediaCache::insert_virtual_bytes shadows the filesystem for
stills and sequences (matched by trailing path components)
- web: standalone crate, canvas present pass, transport, node picker, flow graph,
.comp / folder drop, built-in demo.comp, build.sh
Assisted-by: claude-sonnet-5.516 files changed, 4470 insertions(+), 301 deletions(-)
Cargo.lock+1-1| ... | ... | @@ -1021,7 +1021,7 @@ dependencies = [ |
| 1021 | 1021 | "pollster", |
| 1022 | 1022 | "rustybuzz", |
| 1023 | 1023 | "symphonia", |
| 1024 | "theme", | |
| 1024 | "web-time", | |
| 1025 | 1025 | "wgpu", |
| 1026 | 1026 | "zeno", |
| 1027 | 1027 | ] |
crates/engine/Cargo.toml+7-3| ... | ... | @@ -10,7 +10,6 @@ path = "src/bin/render_check.rs" |
| 10 | 10 | |
| 11 | 11 | [dependencies] |
| 12 | 12 | bytemuck.workspace = true |
| 13 | cpal = "0.15" | |
| 14 | 13 | exr = "1.74" |
| 15 | 14 | fontdb.workspace = true |
| 16 | 15 | image.workspace = true |
| ... | ... | @@ -18,10 +17,15 @@ model.workspace = true |
| 18 | 17 | png.workspace = true |
| 19 | 18 | pollster.workspace = true |
| 20 | 19 | rustybuzz.workspace = true |
| 21 | symphonia = { version = "0.5", default-features = false, features = ["wav", "mp3", "flac", "ogg", "aac", "isomp4", "pcm"] } | |
| 22 | theme.workspace = true | |
| 23 | 20 | wgpu.workspace = true |
| 24 | 21 | zeno.workspace = true |
| 25 | 22 | |
| 23 | [target.'cfg(not(target_arch = "wasm32"))'.dependencies] | |
| 24 | cpal = "0.15" | |
| 25 | symphonia = { version = "0.5", default-features = false, features = ["wav", "mp3", "flac", "ogg", "aac", "isomp4", "pcm"] } | |
| 26 | ||
| 27 | [target.'cfg(target_arch = "wasm32")'.dependencies] | |
| 28 | web-time = "1" | |
| 29 | ||
| 26 | 30 | [target.'cfg(target_os = "macos")'.build-dependencies] |
| 27 | 31 | cc = "1" |
crates/engine/src/lib.rs+7-3| ... | ... | @@ -1,8 +1,10 @@ |
| 1 | #[cfg(not(target_arch = "wasm32"))] | |
| 1 | 2 | pub mod audio; |
| 2 | 3 | pub mod cache; |
| 3 | 4 | pub mod cryptomatte; |
| 4 | 5 | pub mod custom_shader; |
| 5 | 6 | pub mod eval; |
| 7 | #[cfg(not(target_arch = "wasm32"))] | |
| 6 | 8 | pub mod export; |
| 7 | 9 | pub mod media; |
| 8 | 10 | pub mod optflow; |
| ... | ... | @@ -12,14 +14,16 @@ pub mod ram_cache; |
| 12 | 14 | pub mod scene3d; |
| 13 | 15 | pub mod text_engine; |
| 14 | 16 | |
| 17 | #[cfg(not(target_arch = "wasm32"))] | |
| 15 | 18 | pub use audio::{AudioPlayer, AudioTrack}; |
| 16 | 19 | pub use cache::{ |
| 17 | 20 | CacheMode, CachedTexture, DEFAULT_VRAM_BUDGET_MB, EvalStats, GpuCache, NodeCache, TexturePool, |
| 18 | 21 | TexturePoolKey, TexturePoolStats, |
| 19 | 22 | }; |
| 20 | 23 | pub use eval::{DisplaySettings, Engine, create_texture}; |
| 24 | #[cfg(not(target_arch = "wasm32"))] | |
| 21 | 25 | pub use export::{ExportOptions, ExportProgress, ExportSummary, export_saver_png_sequence, select_saver}; |
| 22 | 26 | pub use profile::{FrameProfile, NodeProfileEntry}; |
| 23 | pub use ram_cache::{ | |
| 24 | DEFAULT_RAM_CACHE_MB, PrefetchJob, RamFrame, RamFrameCache, RamFrameKey, RamPrefetcher, | |
| 25 | }; | |
| 27 | pub use ram_cache::{DEFAULT_RAM_CACHE_MB, RamFrame, RamFrameCache, RamFrameKey}; | |
| 28 | #[cfg(not(target_arch = "wasm32"))] | |
| 29 | pub use ram_cache::{PrefetchJob, RamPrefetcher}; |
crates/engine/src/media.rs+104-4| ... | ... | @@ -18,7 +18,7 @@ use model::{ClipSpec, ClsEntry, PolyPoint}; |
| 18 | 18 | use std::collections::HashMap; |
| 19 | 19 | use std::path::{Path, PathBuf}; |
| 20 | 20 | use std::process::Command; |
| 21 | use std::sync::Arc; | |
| 21 | use std::sync::{Arc, RwLock}; | |
| 22 | 22 | |
| 23 | 23 | #[derive(Clone)] |
| 24 | 24 | pub struct DecodedImage { |
| ... | ... | @@ -50,6 +50,50 @@ impl DecodedImage { |
| 50 | 50 | |
| 51 | 51 | const MAX_VIDEO_DECODERS: usize = 12; |
| 52 | 52 | |
| 53 | struct VirtualFile { | |
| 54 | parts: Vec<String>, | |
| 55 | bytes: Arc<[u8]>, | |
| 56 | } | |
| 57 | ||
| 58 | /// In-memory files that shadow the filesystem for still and sequence loading, since `wasm32` has no `std::fs`. | |
| 59 | static VIRTUAL_FILES: RwLock<Vec<VirtualFile>> = RwLock::new(Vec::new()); | |
| 60 | ||
| 61 | fn path_parts(path: &Path) -> Vec<String> { | |
| 62 | path.to_string_lossy() | |
| 63 | .split(['/', '\\']) | |
| 64 | .filter(|p| !p.is_empty() && *p != ".") | |
| 65 | .map(str::to_owned) | |
| 66 | .collect() | |
| 67 | } | |
| 68 | ||
| 69 | /// Bytes of the virtual file sharing the longest run of trailing path components with `path`, so a | |
| 70 | /// comp's absolute `Loader` path still finds a file registered under a dropped folder's relative path. | |
| 71 | fn virtual_bytes(path: &Path) -> Option<Arc<[u8]>> { | |
| 72 | let files = VIRTUAL_FILES.read().ok()?; | |
| 73 | if files.is_empty() { | |
| 74 | return None; | |
| 75 | } | |
| 76 | let want = path_parts(path); | |
| 77 | let shared = |f: &VirtualFile| f.parts.iter().rev().zip(want.iter().rev()).take_while(|(a, b)| a == b).count(); | |
| 78 | files | |
| 79 | .iter() | |
| 80 | .map(|f| (shared(f), f)) | |
| 81 | .filter(|(n, _)| *n > 0) | |
| 82 | .max_by_key(|(n, _)| *n) | |
| 83 | .map(|(_, f)| Arc::clone(&f.bytes)) | |
| 84 | } | |
| 85 | ||
| 86 | fn path_exists(path: &Path) -> bool { | |
| 87 | virtual_bytes(path).is_some() || path.exists() | |
| 88 | } | |
| 89 | ||
| 90 | fn open_image(path: &Path) -> Option<image::DynamicImage> { | |
| 91 | match virtual_bytes(path) { | |
| 92 | Some(bytes) => image::load_from_memory(&bytes).ok(), | |
| 93 | None => image::open(path).ok(), | |
| 94 | } | |
| 95 | } | |
| 96 | ||
| 53 | 97 | #[derive(Clone, Debug, PartialEq, Eq, Hash)] |
| 54 | 98 | struct ImageCacheKey { |
| 55 | 99 | path: PathBuf, |
| ... | ... | @@ -84,6 +128,23 @@ impl MediaCache { |
| 84 | 128 | } |
| 85 | 129 | } |
| 86 | 130 | |
| 131 | /// Registers `bytes` as the file at `path` for every `MediaCache` in the process. | |
| 132 | pub fn insert_virtual_bytes(path: impl AsRef<Path>, bytes: impl Into<Arc<[u8]>>) { | |
| 133 | let parts = path_parts(path.as_ref()); | |
| 134 | let bytes = bytes.into(); | |
| 135 | let Ok(mut files) = VIRTUAL_FILES.write() else { return }; | |
| 136 | match files.iter_mut().find(|f| f.parts == parts) { | |
| 137 | Some(existing) => existing.bytes = bytes, | |
| 138 | None => files.push(VirtualFile { parts, bytes }), | |
| 139 | } | |
| 140 | } | |
| 141 | ||
| 142 | pub fn clear_virtual_bytes() { | |
| 143 | if let Ok(mut files) = VIRTUAL_FILES.write() { | |
| 144 | files.clear(); | |
| 145 | } | |
| 146 | } | |
| 147 | ||
| 87 | 148 | pub fn clear(&mut self) { |
| 88 | 149 | self.images.clear(); |
| 89 | 150 | self.lru.clear(); |
| ... | ... | @@ -271,7 +332,7 @@ impl MediaCache { |
| 271 | 332 | false, |
| 272 | 333 | )? |
| 273 | 334 | } else { |
| 274 | let dyn_img = image::open(&resolved).ok()?; | |
| 335 | let dyn_img = open_image(&resolved)?; | |
| 275 | 336 | let rgba_img = dyn_img.to_rgba8(); |
| 276 | 337 | let size = [rgba_img.width(), rgba_img.height()]; |
| 277 | 338 | let mut raw = rgba_img.into_raw(); |
| ... | ... | @@ -301,7 +362,7 @@ pub fn resolve_clip_path(clip: &ClipSpec, frame: i64) -> Option<PathBuf> { |
| 301 | 362 | let digits = &stem[digit_start..]; |
| 302 | 363 | let is_seq = len > 1 && (clip.start_frame >= 0 || !digits.is_empty()); |
| 303 | 364 | if !is_seq || digits.is_empty() { |
| 304 | return base.exists().then(|| base.to_path_buf()); | |
| 365 | return path_exists(base).then(|| base.to_path_buf()); | |
| 305 | 366 | } |
| 306 | 367 | |
| 307 | 368 | let seq_start = if clip.start_frame >= 0 { clip.start_frame } else { 0 }; |
| ... | ... | @@ -329,7 +390,7 @@ pub fn resolve_clip_path(clip: &ClipSpec, frame: i64) -> Option<PathBuf> { |
| 329 | 390 | format!("{prefix}{idx:0width$}.{ext}") |
| 330 | 391 | }; |
| 331 | 392 | let candidate = base.with_file_name(new_name); |
| 332 | candidate.exists().then_some(candidate) | |
| 393 | path_exists(&candidate).then_some(candidate) | |
| 333 | 394 | } |
| 334 | 395 | #[cfg(test)] |
| 335 | 396 | mod tests { |
| ... | ... | @@ -855,4 +916,43 @@ mod tests { |
| 855 | 916 | |
| 856 | 917 | let _ = std::fs::remove_dir_all(&dir); |
| 857 | 918 | } |
| 919 | ||
| 920 | #[test] | |
| 921 | fn virtual_bytes_load_a_sequence_by_trailing_path() { | |
| 922 | let png = |rgba: [u8; 4]| { | |
| 923 | let mut out = std::io::Cursor::new(Vec::new()); | |
| 924 | image::RgbaImage::from_pixel(2, 1, image::Rgba(rgba)) | |
| 925 | .write_to(&mut out, image::ImageFormat::Png) | |
| 926 | .unwrap(); | |
| 927 | out.into_inner() | |
| 928 | }; | |
| 929 | MediaCache::insert_virtual_bytes("vf_proj\\vf_seq.0001.png", png([255, 0, 0, 255])); | |
| 930 | MediaCache::insert_virtual_bytes("./vf_proj/vf_seq.0002.png", png([0, 255, 0, 255])); | |
| 931 | let clip = ClipSpec { | |
| 932 | filename: "/not/on/disk/vf_proj/vf_seq.0001.png".to_owned(), | |
| 933 | alternate_filename: None, | |
| 934 | start_frame: 1, | |
| 935 | length: Some(2), | |
| 936 | trim_in: 0, | |
| 937 | trim_out: 1, | |
| 938 | global_start: 0, | |
| 939 | global_end: 1, | |
| 940 | extend_first: 0, | |
| 941 | extend_last: 0, | |
| 942 | loop_clip: false, | |
| 943 | reverse: false, | |
| 944 | }; | |
| 945 | let mut cache = MediaCache::new(64); | |
| 946 | let (_, _, f0, from_disk) = cache.load_clip(&clip, 0, false, [None; 4]).unwrap(); | |
| 947 | let (_, _, f1, _) = cache.load_clip(&clip, 1, false, [None; 4]).unwrap(); | |
| 948 | assert!(from_disk); | |
| 949 | assert_eq!((f0.size, &f0.rgba[..4]), ([2, 1], &[255, 0, 0, 255][..])); | |
| 950 | assert_eq!(&f1.rgba[..4], &[0, 255, 0, 255]); | |
| 951 | ||
| 952 | MediaCache::insert_virtual_bytes("vf_proj/vf_seq.0002.png", png([0, 0, 255, 255])); | |
| 953 | let (_, _, f1, _) = MediaCache::new(64).load_clip(&clip, 1, false, [None; 4]).unwrap(); | |
| 954 | assert_eq!(&f1.rgba[..4], &[0, 0, 255, 255]); | |
| 955 | assert!(path_exists(Path::new("elsewhere/vf_seq.0002.png"))); | |
| 956 | assert!(!path_exists(Path::new("vf_proj/vf_seq.0003.png"))); | |
| 957 | } | |
| 858 | 958 | } |
crates/engine/src/ram_cache.rs+18-4| ... | ... | @@ -7,11 +7,19 @@ |
| 7 | 7 | //! - `RamPrefetcher` runs lookahead evaluation on a background thread with an atomic generation |
| 8 | 8 | //! counter so scrubbing or editing cancels stale pre-fetch work immediately. |
| 9 | 9 | |
| 10 | #[cfg(not(target_arch = "wasm32"))] | |
| 10 | 11 | use crate::eval::Engine; |
| 11 | use model::{Comp, NodeId}; | |
| 12 | #[cfg(not(target_arch = "wasm32"))] | |
| 13 | use model::Comp; | |
| 14 | use model::NodeId; | |
| 12 | 15 | use std::collections::HashMap; |
| 13 | use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; | |
| 14 | use std::sync::{Arc, Condvar, Mutex}; | |
| 16 | #[cfg(not(target_arch = "wasm32"))] | |
| 17 | use std::sync::atomic::AtomicBool; | |
| 18 | use std::sync::atomic::{AtomicU64, Ordering}; | |
| 19 | use std::sync::{Arc, Mutex}; | |
| 20 | #[cfg(not(target_arch = "wasm32"))] | |
| 21 | use std::sync::Condvar; | |
| 22 | #[cfg(not(target_arch = "wasm32"))] | |
| 15 | 23 | use std::thread::{self, JoinHandle}; |
| 16 | 24 | |
| 17 | 25 | /// Default RAM frame cache ceiling (1 GiB ≈ 130 full-res 1080p frames or ~520 half-res frames). |
| ... | ... | @@ -109,6 +117,7 @@ impl RamFrameCache { |
| 109 | 117 | self.cache_epoch.load(Ordering::Acquire) |
| 110 | 118 | } |
| 111 | 119 | |
| 120 | #[cfg(not(target_arch = "wasm32"))] | |
| 112 | 121 | pub(crate) fn epoch_arc(&self) -> Arc<AtomicU64> { |
| 113 | 122 | Arc::clone(&self.cache_epoch) |
| 114 | 123 | } |
| ... | ... | @@ -268,6 +277,7 @@ impl RamFrameCache { |
| 268 | 277 | } |
| 269 | 278 | |
| 270 | 279 | /// Parameters for a background lookahead pre-fetch window. |
| 280 | #[cfg(not(target_arch = "wasm32"))] | |
| 271 | 281 | #[derive(Clone)] |
| 272 | 282 | pub struct PrefetchJob { |
| 273 | 283 | pub comp: Comp, |
| ... | ... | @@ -280,6 +290,7 @@ pub struct PrefetchJob { |
| 280 | 290 | pub use_proxy_clips: bool, |
| 281 | 291 | } |
| 282 | 292 | |
| 293 | #[cfg(not(target_arch = "wasm32"))] | |
| 283 | 294 | struct WorkerSlot { |
| 284 | 295 | job: Option<(u64, PrefetchJob)>, |
| 285 | 296 | shutdown: bool, |
| ... | ... | @@ -290,6 +301,7 @@ struct WorkerSlot { |
| 290 | 301 | /// |
| 291 | 302 | /// Calling `request_lookahead` or `cancel` immediately increments an atomic generation |
| 292 | 303 | /// counter so any in-flight lookahead loop aborts before evaluating another frame. |
| 304 | #[cfg(not(target_arch = "wasm32"))] | |
| 293 | 305 | pub struct RamPrefetcher { |
| 294 | 306 | cache: RamFrameCache, |
| 295 | 307 | cache_epoch: Arc<AtomicU64>, |
| ... | ... | @@ -304,6 +316,7 @@ pub struct RamPrefetcher { |
| 304 | 316 | worker: Option<JoinHandle<()>>, |
| 305 | 317 | } |
| 306 | 318 | |
| 319 | #[cfg(not(target_arch = "wasm32"))] | |
| 307 | 320 | impl RamPrefetcher { |
| 308 | 321 | pub fn new(cache: RamFrameCache, worker_vram_budget_mb: u64) -> Self { |
| 309 | 322 | Self::init(None, cache, worker_vram_budget_mb.max(128), 512) |
| ... | ... | @@ -544,6 +557,7 @@ impl RamPrefetcher { |
| 544 | 557 | } |
| 545 | 558 | } |
| 546 | 559 | |
| 560 | #[cfg(not(target_arch = "wasm32"))] | |
| 547 | 561 | impl Drop for RamPrefetcher { |
| 548 | 562 | fn drop(&mut self) { |
| 549 | 563 | self.generation.fetch_add(1, Ordering::AcqRel); |
| ... | ... | @@ -574,7 +588,7 @@ impl Drop for RamPrefetcher { |
| 574 | 588 | } |
| 575 | 589 | } |
| 576 | 590 | |
| 577 | #[cfg(test)] | |
| 591 | #[cfg(all(test, not(target_arch = "wasm32")))] | |
| 578 | 592 | mod tests { |
| 579 | 593 | use super::*; |
| 580 | 594 | use std::time::{Duration, Instant}; |
crates/model/Cargo.toml+1-1| ... | ... | @@ -4,5 +4,5 @@ edition.workspace = true |
| 4 | 4 | version.workspace = true |
| 5 | 5 | publish.workspace = true |
| 6 | 6 | |
| 7 | [dependencies] | |
| 7 | [target.'cfg(not(target_arch = "wasm32"))'.dependencies] | |
| 8 | 8 | mlua.workspace = true |
crates/model/src/expr.rs+945-285| ... | ... | @@ -1,19 +1,8 @@ |
| 1 | //! Fusion SimpleExpression evaluator backed by `mlua` (Lua 5.4). | |
| 1 | //! Fusion SimpleExpression evaluation: `mlua` (Lua 5.4) natively, a pure-Rust subset on `wasm32`. | |
| 2 | 2 | //! |
| 3 | 3 | //! Supports Fusion globals (`time`, `iif`, `Point`, `Text`, `sin`/`cos`/`floor`/`ceil`/etc.) |
| 4 | 4 | //! and `NodeName.ParamName` lookups without requiring full Fusion runtime scripting. |
| 5 | 5 | |
| 6 | use mlua::{HookTriggers, Lua, LuaOptions, MultiValue, StdLib, Value, VmState}; | |
| 7 | use std::collections::HashMap; | |
| 8 | use std::sync::Arc; | |
| 9 | use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; | |
| 10 | ||
| 11 | /// VM instructions one expression evaluation may execute before it is aborted. | |
| 12 | const INSTRUCTION_BUDGET: u64 = 50_000; | |
| 13 | /// Hook granularity; the budget is enforced in steps of this many instructions. | |
| 14 | const HOOK_STEP: u32 = 1000; | |
| 15 | const MEMORY_LIMIT: usize = 16 * 1024 * 1024; | |
| 16 | ||
| 17 | 6 | /// An input readable from an expression. Text inputs surface as `{ Value = "..." }` tables that |
| 18 | 7 | /// also stringify, matching Fusion's `Node.StyledText.Value`. |
| 19 | 8 | #[derive(Clone, Debug, PartialEq)] |
| ... | ... | @@ -22,316 +11,987 @@ pub enum ExprValue { |
| 22 | 11 | Text(String), |
| 23 | 12 | } |
| 24 | 13 | |
| 25 | /// Expressions come from `.comp` files, so the VM is sandboxed: no `os`/`io`/`debug`/`package`, | |
| 26 | /// no code loading, and bounded instructions and memory per evaluation. | |
| 27 | pub struct ExprEngine { | |
| 28 | lua: Lua, | |
| 29 | instructions_used: Arc<AtomicU64>, | |
| 30 | /// Latched once the budget is exceeded so every later hook call also errors. | |
| 31 | aborted: Arc<AtomicBool>, | |
| 32 | } | |
| 14 | #[cfg(not(target_arch = "wasm32"))] | |
| 15 | mod lua { | |
| 16 | use super::ExprValue; | |
| 17 | use mlua::{HookTriggers, Lua, LuaOptions, MultiValue, StdLib, Value, VmState}; | |
| 18 | use std::collections::HashMap; | |
| 19 | use std::sync::Arc; | |
| 20 | use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; | |
| 33 | 21 | |
| 34 | impl Default for ExprEngine { | |
| 35 | fn default() -> Self { | |
| 36 | Self::new() | |
| 22 | /// VM instructions one expression evaluation may execute before it is aborted. | |
| 23 | const INSTRUCTION_BUDGET: u64 = 50_000; | |
| 24 | /// Hook granularity; the budget is enforced in steps of this many instructions. | |
| 25 | const HOOK_STEP: u32 = 1000; | |
| 26 | const MEMORY_LIMIT: usize = 16 * 1024 * 1024; | |
| 27 | ||
| 28 | /// Expressions come from `.comp` files, so the VM is sandboxed: no `os`/`io`/`debug`/`package`, | |
| 29 | /// no code loading, and bounded instructions and memory per evaluation. | |
| 30 | pub struct ExprEngine { | |
| 31 | lua: Lua, | |
| 32 | instructions_used: Arc<AtomicU64>, | |
| 33 | /// Latched once the budget is exceeded so every later hook call also errors. | |
| 34 | aborted: Arc<AtomicBool>, | |
| 37 | 35 | } |
| 38 | } | |
| 39 | 36 | |
| 40 | impl ExprEngine { | |
| 41 | pub fn new() -> Self { | |
| 42 | let lua = Lua::new_with(StdLib::MATH | StdLib::STRING | StdLib::TABLE, LuaOptions::default()) | |
| 43 | .expect("safe Lua stdlib subset loads"); | |
| 44 | // Install Fusion SimpleExpression standard library into global scope. | |
| 45 | let init = r#" | |
| 46 | abs = math.abs | |
| 47 | acos = math.acos | |
| 48 | asin = math.asin | |
| 49 | atan = math.atan | |
| 50 | atan2 = math.atan | |
| 51 | ceil = math.ceil | |
| 52 | cos = math.cos | |
| 53 | cosh = function(x) return (math.exp(x) + math.exp(-x)) * 0.5 end | |
| 54 | deg = math.deg | |
| 55 | exp = math.exp | |
| 56 | floor = math.floor | |
| 57 | fmod = math.fmod | |
| 58 | log = math.log | |
| 59 | log10 = function(x) return math.log(x, 10) end | |
| 60 | max = math.max | |
| 61 | min = math.min | |
| 62 | mod = math.fmod | |
| 63 | pi = math.pi | |
| 64 | pow = function(a, b) return a ^ b end | |
| 65 | rad = math.rad | |
| 66 | sin = math.sin | |
| 67 | sinh = function(x) return (math.exp(x) - math.exp(-x)) * 0.5 end | |
| 68 | sqrt = math.sqrt | |
| 69 | tan = math.tan | |
| 70 | tanh = function(x) local e = math.exp(2*x); return (e - 1) / (e + 1) end | |
| 71 | iif = function(cond, a, b) if cond and cond ~= 0 then return a else return b end end | |
| 72 | Point = function(x, y) return { X = x or 0, Y = y or 0, [1] = x or 0, [2] = y or 0 } end | |
| 73 | Text = function(s) return tostring(s or "") end | |
| 74 | clamp = function(x, lo, hi) if x < lo then return lo elseif x > hi then return hi else return x end end | |
| 75 | mix = function(a, b, t) return a + (b - a) * t end | |
| 76 | "#; | |
| 77 | let _ = lua.load(init).exec(); | |
| 78 | ||
| 79 | let globals = lua.globals(); | |
| 80 | // Stdlib tables become write-protected proxies so no evaluation can alter them for the next. | |
| 81 | let read_only = lua | |
| 82 | .create_function(|_, _: MultiValue| -> mlua::Result<()> { | |
| 83 | Err(mlua::Error::runtime("attempt to modify a read-only table")) | |
| 84 | }) | |
| 85 | .expect("function creates"); | |
| 86 | for name in ["math", "string", "table"] { | |
| 87 | let real: mlua::Table = globals.get(name).expect("stdlib table exists"); | |
| 88 | let proxy = lua.create_table().expect("table creates"); | |
| 89 | let mt = lua.create_table().expect("table creates"); | |
| 90 | mt.set("__index", real).expect("table sets"); | |
| 91 | mt.set("__newindex", read_only.clone()).expect("table sets"); | |
| 92 | proxy.set_metatable(Some(mt)); | |
| 93 | globals.set(name, proxy).expect("global sets"); | |
| 94 | } | |
| 95 | // `pcall`/`xpcall` would swallow the budget error; the rest reach shared tables or metatables. | |
| 96 | for name in [ | |
| 97 | "dofile", "loadfile", "load", "require", "collectgarbage", "os", "io", "debug", "package", | |
| 98 | "pcall", "xpcall", "rawget", "rawset", "rawequal", "getmetatable", "setmetatable", "_G", | |
| 99 | ] { | |
| 100 | let _ = globals.set(name, Value::Nil); | |
| 101 | } | |
| 102 | ||
| 103 | let instructions_used = Arc::new(AtomicU64::new(0)); | |
| 104 | let aborted = Arc::new(AtomicBool::new(false)); | |
| 105 | let counter = Arc::clone(&instructions_used); | |
| 106 | let latch = Arc::clone(&aborted); | |
| 107 | lua.set_hook(HookTriggers::new().every_nth_instruction(HOOK_STEP), move |_, _| { | |
| 108 | if latch.load(Ordering::Relaxed) | |
| 109 | || counter.fetch_add(u64::from(HOOK_STEP), Ordering::Relaxed) >= INSTRUCTION_BUDGET | |
| 110 | { | |
| 111 | latch.store(true, Ordering::Relaxed); | |
| 112 | Err(mlua::Error::runtime("expression instruction budget exceeded")) | |
| 37 | impl Default for ExprEngine { | |
| 38 | fn default() -> Self { | |
| 39 | Self::new() | |
| 40 | } | |
| 41 | } | |
| 42 | ||
| 43 | impl ExprEngine { | |
| 44 | pub fn new() -> Self { | |
| 45 | let lua = Lua::new_with(StdLib::MATH | StdLib::STRING | StdLib::TABLE, LuaOptions::default()) | |
| 46 | .expect("safe Lua stdlib subset loads"); | |
| 47 | // Install Fusion SimpleExpression standard library into global scope. | |
| 48 | let init = r#" | |
| 49 | abs = math.abs | |
| 50 | acos = math.acos | |
| 51 | asin = math.asin | |
| 52 | atan = math.atan | |
| 53 | atan2 = math.atan | |
| 54 | ceil = math.ceil | |
| 55 | cos = math.cos | |
| 56 | cosh = function(x) return (math.exp(x) + math.exp(-x)) * 0.5 end | |
| 57 | deg = math.deg | |
| 58 | exp = math.exp | |
| 59 | floor = math.floor | |
| 60 | fmod = math.fmod | |
| 61 | log = math.log | |
| 62 | log10 = function(x) return math.log(x, 10) end | |
| 63 | max = math.max | |
| 64 | min = math.min | |
| 65 | mod = math.fmod | |
| 66 | pi = math.pi | |
| 67 | pow = function(a, b) return a ^ b end | |
| 68 | rad = math.rad | |
| 69 | sin = math.sin | |
| 70 | sinh = function(x) return (math.exp(x) - math.exp(-x)) * 0.5 end | |
| 71 | sqrt = math.sqrt | |
| 72 | tan = math.tan | |
| 73 | tanh = function(x) local e = math.exp(2*x); return (e - 1) / (e + 1) end | |
| 74 | iif = function(cond, a, b) if cond and cond ~= 0 then return a else return b end end | |
| 75 | Point = function(x, y) return { X = x or 0, Y = y or 0, [1] = x or 0, [2] = y or 0 } end | |
| 76 | Text = function(s) return tostring(s or "") end | |
| 77 | clamp = function(x, lo, hi) if x < lo then return lo elseif x > hi then return hi else return x end end | |
| 78 | mix = function(a, b, t) return a + (b - a) * t end | |
| 79 | "#; | |
| 80 | let _ = lua.load(init).exec(); | |
| 81 | ||
| 82 | let globals = lua.globals(); | |
| 83 | // Stdlib tables become write-protected proxies so no evaluation can alter them for the next. | |
| 84 | let read_only = lua | |
| 85 | .create_function(|_, _: MultiValue| -> mlua::Result<()> { | |
| 86 | Err(mlua::Error::runtime("attempt to modify a read-only table")) | |
| 87 | }) | |
| 88 | .expect("function creates"); | |
| 89 | for name in ["math", "string", "table"] { | |
| 90 | let real: mlua::Table = globals.get(name).expect("stdlib table exists"); | |
| 91 | let proxy = lua.create_table().expect("table creates"); | |
| 92 | let mt = lua.create_table().expect("table creates"); | |
| 93 | mt.set("__index", real).expect("table sets"); | |
| 94 | mt.set("__newindex", read_only.clone()).expect("table sets"); | |
| 95 | proxy.set_metatable(Some(mt)); | |
| 96 | globals.set(name, proxy).expect("global sets"); | |
| 97 | } | |
| 98 | // `pcall`/`xpcall` would swallow the budget error; the rest reach shared tables or metatables. | |
| 99 | for name in [ | |
| 100 | "dofile", "loadfile", "load", "require", "collectgarbage", "os", "io", "debug", "package", | |
| 101 | "pcall", "xpcall", "rawget", "rawset", "rawequal", "getmetatable", "setmetatable", "_G", | |
| 102 | ] { | |
| 103 | let _ = globals.set(name, Value::Nil); | |
| 104 | } | |
| 105 | ||
| 106 | let instructions_used = Arc::new(AtomicU64::new(0)); | |
| 107 | let aborted = Arc::new(AtomicBool::new(false)); | |
| 108 | let counter = Arc::clone(&instructions_used); | |
| 109 | let latch = Arc::clone(&aborted); | |
| 110 | lua.set_hook(HookTriggers::new().every_nth_instruction(HOOK_STEP), move |_, _| { | |
| 111 | if latch.load(Ordering::Relaxed) | |
| 112 | || counter.fetch_add(u64::from(HOOK_STEP), Ordering::Relaxed) >= INSTRUCTION_BUDGET | |
| 113 | { | |
| 114 | latch.store(true, Ordering::Relaxed); | |
| 115 | Err(mlua::Error::runtime("expression instruction budget exceeded")) | |
| 116 | } else { | |
| 117 | Ok(VmState::Continue) | |
| 118 | } | |
| 119 | }); | |
| 120 | lua.set_memory_limit(MEMORY_LIMIT).expect("memory limit applies"); | |
| 121 | ||
| 122 | Self { lua, instructions_used, aborted } | |
| 123 | } | |
| 124 | ||
| 125 | /// Evaluates `expr` in a fresh environment with a fresh instruction budget. | |
| 126 | fn run( | |
| 127 | &self, | |
| 128 | expr: &str, | |
| 129 | time: f64, | |
| 130 | self_params: &HashMap<String, f64>, | |
| 131 | self_points: &HashMap<String, [f64; 2]>, | |
| 132 | env_nodes: &HashMap<String, HashMap<String, ExprValue>>, | |
| 133 | ) -> Option<Value> { | |
| 134 | let env = self.build_env(time, self_params, self_points, env_nodes).ok()?; | |
| 135 | self.instructions_used.store(0, Ordering::Relaxed); | |
| 136 | self.aborted.store(false, Ordering::Relaxed); | |
| 137 | self.lua.load(&Self::expr_chunk(expr)).set_environment(env).eval().ok() | |
| 138 | } | |
| 139 | ||
| 140 | fn expr_chunk(expr: &str) -> String { | |
| 141 | let trimmed = expr.trim_start(); | |
| 142 | if let Some(body) = trimmed.strip_prefix(':') { | |
| 143 | body.to_owned() | |
| 113 | 144 | } else { |
| 114 | Ok(VmState::Continue) | |
| 145 | format!("return ({expr})") | |
| 115 | 146 | } |
| 116 | }); | |
| 117 | lua.set_memory_limit(MEMORY_LIMIT).expect("memory limit applies"); | |
| 147 | } | |
| 118 | 148 | |
| 119 | Self { lua, instructions_used, aborted } | |
| 120 | } | |
| 149 | /// Evaluates a Fusion SimpleExpression returning a number. | |
| 150 | /// `env_nodes` provides `node_name -> (param_name -> value)` and `self_params` provides | |
| 151 | /// unqualified parameter names on the current node. | |
| 152 | pub fn eval_number( | |
| 153 | &self, | |
| 154 | expr: &str, | |
| 155 | time: f64, | |
| 156 | self_params: &HashMap<String, f64>, | |
| 157 | self_points: &HashMap<String, [f64; 2]>, | |
| 158 | env_nodes: &HashMap<String, HashMap<String, ExprValue>>, | |
| 159 | ) -> Option<f64> { | |
| 160 | let val = self.run(expr, time, self_params, self_points, env_nodes)?; | |
| 161 | match val { | |
| 162 | Value::Number(n) => Some(n), | |
| 163 | Value::Integer(i) => Some(i as f64), | |
| 164 | Value::Boolean(b) => Some(if b { 1.0 } else { 0.0 }), | |
| 165 | Value::String(s) => s.to_str().ok()?.trim().parse::<f64>().ok(), | |
| 166 | _ => None, | |
| 167 | } | |
| 168 | } | |
| 121 | 169 | |
| 122 | /// Evaluates `expr` in a fresh environment with a fresh instruction budget. | |
| 123 | fn run( | |
| 124 | &self, | |
| 125 | expr: &str, | |
| 126 | time: f64, | |
| 127 | self_params: &HashMap<String, f64>, | |
| 128 | self_points: &HashMap<String, [f64; 2]>, | |
| 129 | env_nodes: &HashMap<String, HashMap<String, ExprValue>>, | |
| 130 | ) -> Option<Value> { | |
| 131 | let env = self.build_env(time, self_params, self_points, env_nodes).ok()?; | |
| 132 | self.instructions_used.store(0, Ordering::Relaxed); | |
| 133 | self.aborted.store(false, Ordering::Relaxed); | |
| 134 | self.lua.load(&Self::expr_chunk(expr)).set_environment(env).eval().ok() | |
| 135 | } | |
| 170 | /// Evaluates a Fusion SimpleExpression returning a 2D point `[x, y]`. | |
| 171 | pub fn eval_point( | |
| 172 | &self, | |
| 173 | expr: &str, | |
| 174 | time: f64, | |
| 175 | self_params: &HashMap<String, f64>, | |
| 176 | self_points: &HashMap<String, [f64; 2]>, | |
| 177 | env_nodes: &HashMap<String, HashMap<String, ExprValue>>, | |
| 178 | ) -> Option<[f64; 2]> { | |
| 179 | let val = self.run(expr, time, self_params, self_points, env_nodes)?; | |
| 180 | if let Value::Table(t) = val { | |
| 181 | let x = t.get::<f64>("X").or_else(|_| t.get::<f64>(1)).ok()?; | |
| 182 | let y = t.get::<f64>("Y").or_else(|_| t.get::<f64>(2)).ok()?; | |
| 183 | return Some([x, y]); | |
| 184 | } | |
| 185 | None | |
| 186 | } | |
| 136 | 187 | |
| 137 | fn expr_chunk(expr: &str) -> String { | |
| 138 | let trimmed = expr.trim_start(); | |
| 139 | if let Some(body) = trimmed.strip_prefix(':') { | |
| 140 | body.to_owned() | |
| 141 | } else { | |
| 142 | format!("return ({expr})") | |
| 188 | /// Evaluates a Fusion SimpleExpression returning a string. | |
| 189 | pub fn eval_string( | |
| 190 | &self, | |
| 191 | expr: &str, | |
| 192 | time: f64, | |
| 193 | self_params: &HashMap<String, f64>, | |
| 194 | self_points: &HashMap<String, [f64; 2]>, | |
| 195 | env_nodes: &HashMap<String, HashMap<String, ExprValue>>, | |
| 196 | ) -> Option<String> { | |
| 197 | let val = self.run(expr, time, self_params, self_points, env_nodes)?; | |
| 198 | match val { | |
| 199 | Value::String(s) => Some(s.to_str().ok()?.to_owned()), | |
| 200 | Value::Number(n) => Some(format!("{n}")), | |
| 201 | Value::Integer(i) => Some(format!("{i}")), | |
| 202 | Value::Table(t) => t.get::<String>("Value").ok(), | |
| 203 | _ => None, | |
| 204 | } | |
| 205 | } | |
| 206 | ||
| 207 | fn build_env( | |
| 208 | &self, | |
| 209 | time: f64, | |
| 210 | self_params: &HashMap<String, f64>, | |
| 211 | self_points: &HashMap<String, [f64; 2]>, | |
| 212 | env_nodes: &HashMap<String, HashMap<String, ExprValue>>, | |
| 213 | ) -> mlua::Result<mlua::Table> { | |
| 214 | let env = self.lua.create_table()?; | |
| 215 | let mt = self.lua.create_table()?; | |
| 216 | mt.set("__index", self.lua.globals())?; | |
| 217 | env.set_metatable(Some(mt)); | |
| 218 | env.set("time", time)?; | |
| 219 | env.set("comp", self.lua.create_table()?)?; | |
| 220 | for (k, v) in self_params { | |
| 221 | env.set(k.as_str(), *v)?; | |
| 222 | } | |
| 223 | for (k, p) in self_points { | |
| 224 | let pt = self.lua.create_table()?; | |
| 225 | pt.set("X", p[0])?; | |
| 226 | pt.set("Y", p[1])?; | |
| 227 | pt.set(1, p[0])?; | |
| 228 | pt.set(2, p[1])?; | |
| 229 | env.set(k.as_str(), pt)?; | |
| 230 | } | |
| 231 | // Missing node fields default to 0 so expressions don't nil-crash. | |
| 232 | let zero_mt = self.lua.create_table()?; | |
| 233 | zero_mt.set("__index", self.lua.create_function(|_, _args: MultiValue| Ok(0.0_f64))?)?; | |
| 234 | let text_mt = self.lua.create_table()?; | |
| 235 | text_mt.set("__tostring", self.lua.create_function(|_, this: mlua::Table| this.get::<String>("Value"))?)?; | |
| 236 | for (node_name, params) in env_nodes { | |
| 237 | let nt = self.lua.create_table()?; | |
| 238 | for (pk, pv) in params { | |
| 239 | match pv { | |
| 240 | ExprValue::Number(n) => nt.set(pk.as_str(), *n)?, | |
| 241 | ExprValue::Text(s) => { | |
| 242 | let text = self.lua.create_table()?; | |
| 243 | text.set("Value", s.as_str())?; | |
| 244 | text.set_metatable(Some(text_mt.clone())); | |
| 245 | nt.set(pk.as_str(), text)?; | |
| 246 | } | |
| 247 | } | |
| 248 | } | |
| 249 | nt.set_metatable(Some(zero_mt.clone())); | |
| 250 | env.set(node_name.as_str(), nt)?; | |
| 251 | } | |
| 252 | Ok(env) | |
| 143 | 253 | } |
| 144 | 254 | } |
| 145 | 255 | |
| 146 | /// Evaluates a Fusion SimpleExpression returning a number. | |
| 147 | /// `env_nodes` provides `node_name -> (param_name -> value)` and `self_params` provides | |
| 148 | /// unqualified parameter names on the current node. | |
| 149 | pub fn eval_number( | |
| 150 | &self, | |
| 151 | expr: &str, | |
| 152 | time: f64, | |
| 153 | self_params: &HashMap<String, f64>, | |
| 154 | self_points: &HashMap<String, [f64; 2]>, | |
| 155 | env_nodes: &HashMap<String, HashMap<String, ExprValue>>, | |
| 156 | ) -> Option<f64> { | |
| 157 | let val = self.run(expr, time, self_params, self_points, env_nodes)?; | |
| 158 | match val { | |
| 159 | Value::Number(n) => Some(n), | |
| 160 | Value::Integer(i) => Some(i as f64), | |
| 161 | Value::Boolean(b) => Some(if b { 1.0 } else { 0.0 }), | |
| 162 | Value::String(s) => s.to_str().ok()?.trim().parse::<f64>().ok(), | |
| 163 | _ => None, | |
| 256 | #[cfg(test)] | |
| 257 | mod tests { | |
| 258 | use super::*; | |
| 259 | ||
| 260 | fn num(expr: &str) -> Option<f64> { | |
| 261 | let e = HashMap::new(); | |
| 262 | ExprEngine::new().eval_number(expr, 2.0, &HashMap::new(), &HashMap::new(), &e) | |
| 263 | } | |
| 264 | ||
| 265 | #[test] | |
| 266 | fn fusion_expressions_still_evaluate() { | |
| 267 | let v = num("time * 2 + math.sin(0.5)").unwrap(); | |
| 268 | assert!((v - (4.0 + 0.5_f64.sin())).abs() < 1e-12); | |
| 269 | assert_eq!(num("clamp(5, 0, 1)"), Some(1.0)); | |
| 270 | assert_eq!(num(":local a = 3; return a * time"), Some(6.0)); | |
| 271 | } | |
| 272 | ||
| 273 | #[test] | |
| 274 | fn os_io_and_loaders_are_unavailable() { | |
| 275 | let marker = std::env::temp_dir().join("fission_expr_sandbox_marker"); | |
| 276 | let _ = std::fs::remove_file(&marker); | |
| 277 | let cmd = format!("os.execute('touch {}')", marker.display()); | |
| 278 | assert_eq!(num(&format!(":{cmd}; return 1")), None); | |
| 279 | assert!(!marker.exists()); | |
| 280 | for src in [ | |
| 281 | "io.open('/etc/passwd')", | |
| 282 | "require('os')", | |
| 283 | "load('return 1')()", | |
| 284 | "dofile('/etc/passwd')", | |
| 285 | "debug.getinfo(1)", | |
| 286 | "package.loaded", | |
| 287 | "collectgarbage('count')", | |
| 288 | ] { | |
| 289 | assert_eq!(num(src), None, "{src}"); | |
| 290 | } | |
| 291 | } | |
| 292 | ||
| 293 | #[test] | |
| 294 | fn runaway_loops_and_allocations_error_out() { | |
| 295 | let engine = ExprEngine::new(); | |
| 296 | let e = HashMap::new(); | |
| 297 | let eval = |src: &str| engine.eval_number(src, 0.0, &HashMap::new(), &HashMap::new(), &e); | |
| 298 | assert_eq!(eval(":while true do end"), None); | |
| 299 | assert_eq!(eval(":local s = 'x'; while true do s = s .. s end"), None); | |
| 300 | assert_eq!(eval("string.rep('x', 1e9) and 1"), None); | |
| 301 | // Budget resets per evaluation, so the engine stays usable. | |
| 302 | assert_eq!(eval("1 + 1"), Some(2.0)); | |
| 303 | } | |
| 304 | ||
| 305 | #[test] | |
| 306 | fn pcall_cannot_swallow_the_budget() { | |
| 307 | let engine = ExprEngine::new(); | |
| 308 | let e = HashMap::new(); | |
| 309 | let eval = |src: &str| engine.eval_number(src, 0.0, &HashMap::new(), &HashMap::new(), &e); | |
| 310 | let start = std::time::Instant::now(); | |
| 311 | assert_eq!(eval(":while true do pcall(function() while true do end end) end"), None); | |
| 312 | assert_eq!(eval(":while true do xpcall(function() while true do end end, print) end"), None); | |
| 313 | assert!(start.elapsed() < std::time::Duration::from_millis(50), "{:?}", start.elapsed()); | |
| 314 | assert_eq!(eval("1 + 1"), Some(2.0)); | |
| 315 | } | |
| 316 | ||
| 317 | #[test] | |
| 318 | fn evaluations_cannot_mutate_shared_state() { | |
| 319 | let engine = ExprEngine::new(); | |
| 320 | let e = HashMap::new(); | |
| 321 | let eval = |src: &str| engine.eval_number(src, 0.0, &HashMap::new(), &HashMap::new(), &e); | |
| 322 | for src in [ | |
| 323 | ":math.floor = function() return 42 end; return 1", | |
| 324 | ":string.upper = function() return 42 end; return 1", | |
| 325 | ":table.insert = nil; return 1", | |
| 326 | ":_G.leak = 1; return 1", | |
| 327 | ":getmetatable('').__index.upper = nil; return 1", | |
| 328 | ":setmetatable(math, nil); return 1", | |
| 329 | ] { | |
| 330 | assert_eq!(eval(src), None, "{src}"); | |
| 331 | } | |
| 332 | assert_eq!(eval(":floor = function() return 42 end; return floor(1.5)"), Some(42.0)); | |
| 333 | assert_eq!(eval("floor(1.5)"), Some(1.0)); | |
| 334 | assert_eq!(eval("math.floor(1.5)"), Some(1.0)); | |
| 335 | assert_eq!(eval("leak"), None); | |
| 336 | let upper = engine.eval_string("('a'):upper()", 0.0, &HashMap::new(), &HashMap::new(), &e); | |
| 337 | assert_eq!(upper.as_deref(), Some("A")); | |
| 338 | assert_eq!(eval("string.len('abc') + select('#', table.unpack({1, 2}))"), Some(5.0)); | |
| 164 | 339 | } |
| 165 | 340 | } |
| 341 | } | |
| 166 | 342 | |
| 167 | /// Evaluates a Fusion SimpleExpression returning a 2D point `[x, y]`. | |
| 168 | pub fn eval_point( | |
| 169 | &self, | |
| 170 | expr: &str, | |
| 171 | time: f64, | |
| 172 | self_params: &HashMap<String, f64>, | |
| 173 | self_points: &HashMap<String, [f64; 2]>, | |
| 174 | env_nodes: &HashMap<String, HashMap<String, ExprValue>>, | |
| 175 | ) -> Option<[f64; 2]> { | |
| 176 | let val = self.run(expr, time, self_params, self_points, env_nodes)?; | |
| 177 | if let Value::Table(t) = val { | |
| 178 | let x = t.get::<f64>("X").or_else(|_| t.get::<f64>(1)).ok()?; | |
| 179 | let y = t.get::<f64>("Y").or_else(|_| t.get::<f64>(2)).ok()?; | |
| 180 | return Some([x, y]); | |
| 181 | } | |
| 182 | None | |
| 343 | #[cfg(not(target_arch = "wasm32"))] | |
| 344 | pub use lua::ExprEngine; | |
| 345 | #[cfg(target_arch = "wasm32")] | |
| 346 | pub use pure::ExprEngine; | |
| 347 | ||
| 348 | /// Lua-subset evaluator for targets without a C toolchain: literals, `+ - * / // % ^ ..`, | |
| 349 | /// comparisons, `and`/`or`/`not`, calls, `a.b` / `a[b]`, the Fusion globals and `math.*`. | |
| 350 | /// Statement bodies (`:local x = ...`) and method calls are unsupported and evaluate to `None`. | |
| 351 | #[cfg(any(target_arch = "wasm32", test))] | |
| 352 | mod pure { | |
| 353 | use super::ExprValue; | |
| 354 | use std::collections::HashMap; | |
| 355 | ||
| 356 | const MAX_DEPTH: usize = 64; | |
| 357 | const MATH_FNS: &[&str] = &[ | |
| 358 | "abs", "acos", "asin", "atan", "ceil", "cos", "deg", "exp", "floor", "fmod", "log", "max", "min", "rad", | |
| 359 | "sin", "sqrt", "tan", | |
| 360 | ]; | |
| 361 | const GLOBAL_FNS: &[&str] = &[ | |
| 362 | "atan2", "clamp", "cosh", "iif", "log10", "mix", "mod", "pow", "Point", "sinh", "tanh", "Text", | |
| 363 | "tonumber", "tostring", | |
| 364 | ]; | |
| 365 | ||
| 366 | #[derive(Clone, Debug, PartialEq)] | |
| 367 | enum Tok { | |
| 368 | Num(f64), | |
| 369 | Str(String), | |
| 370 | Name(String), | |
| 371 | Op(&'static str), | |
| 183 | 372 | } |
| 184 | 373 | |
| 185 | /// Evaluates a Fusion SimpleExpression returning a string. | |
| 186 | pub fn eval_string( | |
| 187 | &self, | |
| 188 | expr: &str, | |
| 189 | time: f64, | |
| 190 | self_params: &HashMap<String, f64>, | |
| 191 | self_points: &HashMap<String, [f64; 2]>, | |
| 192 | env_nodes: &HashMap<String, HashMap<String, ExprValue>>, | |
| 193 | ) -> Option<String> { | |
| 194 | let val = self.run(expr, time, self_params, self_points, env_nodes)?; | |
| 195 | match val { | |
| 196 | Value::String(s) => Some(s.to_str().ok()?.to_owned()), | |
| 197 | Value::Number(n) => Some(format!("{n}")), | |
| 198 | Value::Integer(i) => Some(format!("{i}")), | |
| 199 | Value::Table(t) => t.get::<String>("Value").ok(), | |
| 200 | _ => None, | |
| 374 | fn lex(src: &str) -> Option<Vec<Tok>> { | |
| 375 | const OPS: &[&str] = &[ | |
| 376 | "..", "==", "~=", "<=", ">=", "//", "+", "-", "*", "/", "%", "^", "<", ">", "(", ")", "[", "]", ",", ".", | |
| 377 | ]; | |
| 378 | let chars: Vec<char> = src.chars().collect(); | |
| 379 | let mut toks = Vec::new(); | |
| 380 | let mut i = 0; | |
| 381 | while i < chars.len() { | |
| 382 | let c = chars[i]; | |
| 383 | if c.is_whitespace() { | |
| 384 | i += 1; | |
| 385 | } else if c.is_ascii_digit() || (c == '.' && chars.get(i + 1).is_some_and(char::is_ascii_digit)) { | |
| 386 | let start = i; | |
| 387 | if c == '0' && matches!(chars.get(i + 1), Some('x' | 'X')) { | |
| 388 | i += 2; | |
| 389 | while chars.get(i).is_some_and(char::is_ascii_hexdigit) { | |
| 390 | i += 1; | |
| 391 | } | |
| 392 | let digits: String = chars[start + 2..i].iter().collect(); | |
| 393 | toks.push(Tok::Num(u64::from_str_radix(&digits, 16).ok()? as f64)); | |
| 394 | continue; | |
| 395 | } | |
| 396 | while chars.get(i).is_some_and(char::is_ascii_digit) { | |
| 397 | i += 1; | |
| 398 | } | |
| 399 | if chars.get(i) == Some(&'.') && chars.get(i + 1) != Some(&'.') { | |
| 400 | i += 1; | |
| 401 | while chars.get(i).is_some_and(char::is_ascii_digit) { | |
| 402 | i += 1; | |
| 403 | } | |
| 404 | } | |
| 405 | if matches!(chars.get(i), Some('e' | 'E')) { | |
| 406 | i += 1; | |
| 407 | if matches!(chars.get(i), Some('+' | '-')) { | |
| 408 | i += 1; | |
| 409 | } | |
| 410 | while chars.get(i).is_some_and(char::is_ascii_digit) { | |
| 411 | i += 1; | |
| 412 | } | |
| 413 | } | |
| 414 | toks.push(Tok::Num(chars[start..i].iter().collect::<String>().parse().ok()?)); | |
| 415 | } else if c.is_alphabetic() || c == '_' { | |
| 416 | let start = i; | |
| 417 | while chars.get(i).is_some_and(|c| c.is_alphanumeric() || *c == '_') { | |
| 418 | i += 1; | |
| 419 | } | |
| 420 | toks.push(Tok::Name(chars[start..i].iter().collect())); | |
| 421 | } else if c == '"' || c == '\'' { | |
| 422 | let mut s = String::new(); | |
| 423 | i += 1; | |
| 424 | loop { | |
| 425 | match *chars.get(i)? { | |
| 426 | q if q == c => break, | |
| 427 | '\\' => { | |
| 428 | i += 1; | |
| 429 | s.push(match *chars.get(i)? { | |
| 430 | 'n' => '\n', | |
| 431 | 't' => '\t', | |
| 432 | other => other, | |
| 433 | }); | |
| 434 | } | |
| 435 | other => s.push(other), | |
| 436 | } | |
| 437 | i += 1; | |
| 438 | } | |
| 439 | i += 1; | |
| 440 | toks.push(Tok::Str(s)); | |
| 441 | } else { | |
| 442 | let rest: String = chars[i..chars.len().min(i + 2)].iter().collect(); | |
| 443 | let op = OPS.iter().find(|op| rest.starts_with(**op))?; | |
| 444 | i += op.len(); | |
| 445 | toks.push(Tok::Op(op)); | |
| 446 | } | |
| 201 | 447 | } |
| 448 | Some(toks) | |
| 202 | 449 | } |
| 203 | 450 | |
| 204 | fn build_env( | |
| 205 | &self, | |
| 206 | time: f64, | |
| 207 | self_params: &HashMap<String, f64>, | |
| 208 | self_points: &HashMap<String, [f64; 2]>, | |
| 209 | env_nodes: &HashMap<String, HashMap<String, ExprValue>>, | |
| 210 | ) -> mlua::Result<mlua::Table> { | |
| 211 | let env = self.lua.create_table()?; | |
| 212 | let mt = self.lua.create_table()?; | |
| 213 | mt.set("__index", self.lua.globals())?; | |
| 214 | env.set_metatable(Some(mt)); | |
| 215 | env.set("time", time)?; | |
| 216 | env.set("comp", self.lua.create_table()?)?; | |
| 217 | for (k, v) in self_params { | |
| 218 | env.set(k.as_str(), *v)?; | |
| 219 | } | |
| 220 | for (k, p) in self_points { | |
| 221 | let pt = self.lua.create_table()?; | |
| 222 | pt.set("X", p[0])?; | |
| 223 | pt.set("Y", p[1])?; | |
| 224 | pt.set(1, p[0])?; | |
| 225 | pt.set(2, p[1])?; | |
| 226 | env.set(k.as_str(), pt)?; | |
| 227 | } | |
| 228 | // Missing node fields default to 0 so expressions don't nil-crash. | |
| 229 | let zero_mt = self.lua.create_table()?; | |
| 230 | zero_mt.set("__index", self.lua.create_function(|_, _args: MultiValue| Ok(0.0_f64))?)?; | |
| 231 | let text_mt = self.lua.create_table()?; | |
| 232 | text_mt.set("__tostring", self.lua.create_function(|_, this: mlua::Table| this.get::<String>("Value"))?)?; | |
| 233 | for (node_name, params) in env_nodes { | |
| 234 | let nt = self.lua.create_table()?; | |
| 235 | for (pk, pv) in params { | |
| 236 | match pv { | |
| 237 | ExprValue::Number(n) => nt.set(pk.as_str(), *n)?, | |
| 238 | ExprValue::Text(s) => { | |
| 239 | let text = self.lua.create_table()?; | |
| 240 | text.set("Value", s.as_str())?; | |
| 241 | text.set_metatable(Some(text_mt.clone())); | |
| 242 | nt.set(pk.as_str(), text)?; | |
| 451 | #[derive(Debug)] | |
| 452 | enum Ast { | |
| 453 | Nil, | |
| 454 | Bool(bool), | |
| 455 | Num(f64), | |
| 456 | Str(String), | |
| 457 | Name(String), | |
| 458 | Index(Box<Ast>, Box<Ast>), | |
| 459 | Call(Box<Ast>, Vec<Ast>), | |
| 460 | Neg(Box<Ast>), | |
| 461 | Not(Box<Ast>), | |
| 462 | Bin(&'static str, Box<Ast>, Box<Ast>), | |
| 463 | } | |
| 464 | ||
| 465 | struct Parser { | |
| 466 | toks: Vec<Tok>, | |
| 467 | pos: usize, | |
| 468 | depth: usize, | |
| 469 | } | |
| 470 | ||
| 471 | impl Parser { | |
| 472 | fn peek(&self) -> Option<&Tok> { | |
| 473 | self.toks.get(self.pos) | |
| 474 | } | |
| 475 | ||
| 476 | fn eat_op(&mut self, op: &str) -> bool { | |
| 477 | let hit = matches!(self.peek(), Some(Tok::Op(o)) if *o == op); | |
| 478 | self.pos += usize::from(hit); | |
| 479 | hit | |
| 480 | } | |
| 481 | ||
| 482 | fn binary_op(&self) -> Option<(&'static str, u8, u8)> { | |
| 483 | let op = match self.peek()? { | |
| 484 | Tok::Op(op) => *op, | |
| 485 | Tok::Name(n) if n == "and" => "and", | |
| 486 | Tok::Name(n) if n == "or" => "or", | |
| 487 | _ => return None, | |
| 488 | }; | |
| 489 | // Lua precedence, lowest first; `..` and `^` are right associative. | |
| 490 | let (left, right) = match op { | |
| 491 | "or" => (1, 2), | |
| 492 | "and" => (3, 4), | |
| 493 | "<" | ">" | "<=" | ">=" | "==" | "~=" => (5, 6), | |
| 494 | ".." => (9, 8), | |
| 495 | "+" | "-" => (10, 11), | |
| 496 | "*" | "/" | "//" | "%" => (12, 13), | |
| 497 | "^" => (16, 15), | |
| 498 | _ => return None, | |
| 499 | }; | |
| 500 | Some((op, left, right)) | |
| 501 | } | |
| 502 | ||
| 503 | fn expr(&mut self, min_bp: u8) -> Option<Ast> { | |
| 504 | self.depth += 1; | |
| 505 | let ast = if self.depth > MAX_DEPTH { None } else { self.binary(min_bp) }; | |
| 506 | self.depth -= 1; | |
| 507 | ast | |
| 508 | } | |
| 509 | ||
| 510 | fn binary(&mut self, min_bp: u8) -> Option<Ast> { | |
| 511 | let mut lhs = self.unary()?; | |
| 512 | while let Some((op, left, right)) = self.binary_op() { | |
| 513 | if left < min_bp { | |
| 514 | break; | |
| 515 | } | |
| 516 | self.pos += 1; | |
| 517 | let rhs = self.expr(right)?; | |
| 518 | lhs = Ast::Bin(op, Box::new(lhs), Box::new(rhs)); | |
| 519 | } | |
| 520 | Some(lhs) | |
| 521 | } | |
| 522 | ||
| 523 | fn unary(&mut self) -> Option<Ast> { | |
| 524 | if self.eat_op("-") { | |
| 525 | return Some(Ast::Neg(Box::new(self.expr(14)?))); | |
| 526 | } | |
| 527 | if matches!(self.peek(), Some(Tok::Name(n)) if n == "not") { | |
| 528 | self.pos += 1; | |
| 529 | return Some(Ast::Not(Box::new(self.expr(14)?))); | |
| 530 | } | |
| 531 | self.postfix() | |
| 532 | } | |
| 533 | ||
| 534 | fn postfix(&mut self) -> Option<Ast> { | |
| 535 | let mut node = match self.toks.get(self.pos)?.clone() { | |
| 536 | Tok::Num(n) => Ast::Num(n), | |
| 537 | Tok::Str(s) => Ast::Str(s), | |
| 538 | Tok::Name(n) => match n.as_str() { | |
| 539 | "nil" => Ast::Nil, | |
| 540 | "true" => Ast::Bool(true), | |
| 541 | "false" => Ast::Bool(false), | |
| 542 | "and" | "or" | "not" => return None, | |
| 543 | _ => Ast::Name(n), | |
| 544 | }, | |
| 545 | Tok::Op("(") => { | |
| 546 | self.pos += 1; | |
| 547 | let inner = self.expr(0)?; | |
| 548 | if !matches!(self.peek(), Some(Tok::Op(")"))) { | |
| 549 | return None; | |
| 550 | } | |
| 551 | inner | |
| 552 | } | |
| 553 | Tok::Op(_) => return None, | |
| 554 | }; | |
| 555 | self.pos += 1; | |
| 556 | loop { | |
| 557 | if self.eat_op(".") { | |
| 558 | let Some(Tok::Name(key)) = self.peek().cloned() else { return None }; | |
| 559 | self.pos += 1; | |
| 560 | node = Ast::Index(Box::new(node), Box::new(Ast::Str(key))); | |
| 561 | } else if self.eat_op("[") { | |
| 562 | let key = self.expr(0)?; | |
| 563 | if !self.eat_op("]") { | |
| 564 | return None; | |
| 565 | } | |
| 566 | node = Ast::Index(Box::new(node), Box::new(key)); | |
| 567 | } else if self.eat_op("(") { | |
| 568 | let mut args = Vec::new(); | |
| 569 | if !self.eat_op(")") { | |
| 570 | loop { | |
| 571 | args.push(self.expr(0)?); | |
| 572 | if self.eat_op(")") { | |
| 573 | break; | |
| 574 | } | |
| 575 | if !self.eat_op(",") { | |
| 576 | return None; | |
| 577 | } | |
| 578 | } | |
| 243 | 579 | } |
| 580 | node = Ast::Call(Box::new(node), args); | |
| 581 | } else { | |
| 582 | return Some(node); | |
| 244 | 583 | } |
| 245 | 584 | } |
| 246 | nt.set_metatable(Some(zero_mt.clone())); | |
| 247 | env.set(node_name.as_str(), nt)?; | |
| 248 | 585 | } |
| 249 | Ok(env) | |
| 250 | 586 | } |
| 251 | } | |
| 252 | 587 | |
| 253 | #[cfg(test)] | |
| 254 | mod tests { | |
| 255 | use super::*; | |
| 588 | #[derive(Clone, Debug, PartialEq)] | |
| 589 | enum Val<'a> { | |
| 590 | Nil, | |
| 591 | Bool(bool), | |
| 592 | Num(f64), | |
| 593 | Str(String), | |
| 594 | Point([f64; 2]), | |
| 595 | /// `{ Value = "..." }` that also stringifies. | |
| 596 | Text(String), | |
| 597 | Node(&'a HashMap<String, ExprValue>), | |
| 598 | Math, | |
| 599 | Func(&'static str), | |
| 600 | } | |
| 601 | ||
| 602 | impl Val<'_> { | |
| 603 | fn truthy(&self) -> bool { | |
| 604 | !matches!(self, Val::Nil | Val::Bool(false)) | |
| 605 | } | |
| 256 | 606 | |
| 257 | fn num(expr: &str) -> Option<f64> { | |
| 258 | let e = HashMap::new(); | |
| 259 | ExprEngine::new().eval_number(expr, 2.0, &HashMap::new(), &HashMap::new(), &e) | |
| 607 | /// Lua's arithmetic coercion: numbers and numeric strings. | |
| 608 | fn num(&self) -> Option<f64> { | |
| 609 | match self { | |
| 610 | Val::Num(n) => Some(*n), | |
| 611 | Val::Str(s) => s.trim().parse().ok(), | |
| 612 | _ => None, | |
| 613 | } | |
| 614 | } | |
| 615 | ||
| 616 | fn text(&self) -> Option<String> { | |
| 617 | match self { | |
| 618 | Val::Num(n) => Some(format!("{n}")), | |
| 619 | Val::Str(s) | Val::Text(s) => Some(s.clone()), | |
| 620 | _ => None, | |
| 621 | } | |
| 622 | } | |
| 260 | 623 | } |
| 261 | 624 | |
| 262 | #[test] | |
| 263 | fn fusion_expressions_still_evaluate() { | |
| 264 | let v = num("time * 2 + math.sin(0.5)").unwrap(); | |
| 265 | assert!((v - (4.0 + 0.5_f64.sin())).abs() < 1e-12); | |
| 266 | assert_eq!(num("clamp(5, 0, 1)"), Some(1.0)); | |
| 267 | assert_eq!(num(":local a = 3; return a * time"), Some(6.0)); | |
| 625 | struct Scope<'a> { | |
| 626 | time: f64, | |
| 627 | params: &'a HashMap<String, f64>, | |
| 628 | points: &'a HashMap<String, [f64; 2]>, | |
| 629 | nodes: &'a HashMap<String, HashMap<String, ExprValue>>, | |
| 268 | 630 | } |
| 269 | 631 | |
| 270 | #[test] | |
| 271 | fn os_io_and_loaders_are_unavailable() { | |
| 272 | let marker = std::env::temp_dir().join("fission_expr_sandbox_marker"); | |
| 273 | let _ = std::fs::remove_file(&marker); | |
| 274 | let cmd = format!("os.execute('touch {}')", marker.display()); | |
| 275 | assert_eq!(num(&format!(":{cmd}; return 1")), None); | |
| 276 | assert!(!marker.exists()); | |
| 277 | for src in [ | |
| 278 | "io.open('/etc/passwd')", | |
| 279 | "require('os')", | |
| 280 | "load('return 1')()", | |
| 281 | "dofile('/etc/passwd')", | |
| 282 | "debug.getinfo(1)", | |
| 283 | "package.loaded", | |
| 284 | "collectgarbage('count')", | |
| 285 | ] { | |
| 286 | assert_eq!(num(src), None, "{src}"); | |
| 632 | impl<'a> Scope<'a> { | |
| 633 | /// Nodes shadow points shadow params shadow `time` shadow the stdlib, as in the Lua env. | |
| 634 | fn name(&self, name: &str) -> Val<'a> { | |
| 635 | if let Some(node) = self.nodes.get(name) { | |
| 636 | Val::Node(node) | |
| 637 | } else if let Some(p) = self.points.get(name) { | |
| 638 | Val::Point(*p) | |
| 639 | } else if let Some(n) = self.params.get(name) { | |
| 640 | Val::Num(*n) | |
| 641 | } else if name == "time" { | |
| 642 | Val::Num(self.time) | |
| 643 | } else if name == "pi" { | |
| 644 | Val::Num(std::f64::consts::PI) | |
| 645 | } else if name == "math" { | |
| 646 | Val::Math | |
| 647 | } else if let Some(f) = MATH_FNS.iter().chain(GLOBAL_FNS).find(|f| **f == name) { | |
| 648 | Val::Func(f) | |
| 649 | } else { | |
| 650 | Val::Nil | |
| 651 | } | |
| 652 | } | |
| 653 | ||
| 654 | fn eval(&self, ast: &Ast) -> Option<Val<'a>> { | |
| 655 | Some(match ast { | |
| 656 | Ast::Nil => Val::Nil, | |
| 657 | Ast::Bool(b) => Val::Bool(*b), | |
| 658 | Ast::Num(n) => Val::Num(*n), | |
| 659 | Ast::Str(s) => Val::Str(s.clone()), | |
| 660 | Ast::Name(n) => self.name(n), | |
| 661 | Ast::Neg(a) => Val::Num(-self.eval(a)?.num()?), | |
| 662 | Ast::Not(a) => Val::Bool(!self.eval(a)?.truthy()), | |
| 663 | Ast::Index(base, key) => index(self.eval(base)?, self.eval(key)?)?, | |
| 664 | Ast::Call(callee, args) => { | |
| 665 | let Val::Func(name) = self.eval(callee)? else { return None }; | |
| 666 | let args = args.iter().map(|a| self.eval(a)).collect::<Option<Vec<_>>>()?; | |
| 667 | call(name, &args)? | |
| 668 | } | |
| 669 | Ast::Bin("and", a, b) => { | |
| 670 | let a = self.eval(a)?; | |
| 671 | if a.truthy() { self.eval(b)? } else { a } | |
| 672 | } | |
| 673 | Ast::Bin("or", a, b) => { | |
| 674 | let a = self.eval(a)?; | |
| 675 | if a.truthy() { a } else { self.eval(b)? } | |
| 676 | } | |
| 677 | Ast::Bin(op, a, b) => binary(op, self.eval(a)?, self.eval(b)?)?, | |
| 678 | }) | |
| 287 | 679 | } |
| 288 | 680 | } |
| 289 | 681 | |
| 290 | #[test] | |
| 291 | fn runaway_loops_and_allocations_error_out() { | |
| 292 | let engine = ExprEngine::new(); | |
| 293 | let e = HashMap::new(); | |
| 294 | let eval = |src: &str| engine.eval_number(src, 0.0, &HashMap::new(), &HashMap::new(), &e); | |
| 295 | assert_eq!(eval(":while true do end"), None); | |
| 296 | assert_eq!(eval(":local s = 'x'; while true do s = s .. s end"), None); | |
| 297 | assert_eq!(eval("string.rep('x', 1e9) and 1"), None); | |
| 298 | // Budget resets per evaluation, so the engine stays usable. | |
| 299 | assert_eq!(eval("1 + 1"), Some(2.0)); | |
| 682 | fn index<'a>(base: Val<'a>, key: Val<'a>) -> Option<Val<'a>> { | |
| 683 | Some(match (base, key) { | |
| 684 | (Val::Node(fields), key) => match key { | |
| 685 | Val::Str(k) => match fields.get(&k) { | |
| 686 | Some(ExprValue::Number(n)) => Val::Num(*n), | |
| 687 | Some(ExprValue::Text(s)) => Val::Text(s.clone()), | |
| 688 | None => Val::Num(0.0), | |
| 689 | }, | |
| 690 | _ => Val::Num(0.0), | |
| 691 | }, | |
| 692 | (Val::Text(s), Val::Str(k)) if k == "Value" => Val::Str(s), | |
| 693 | (Val::Text(_), _) => Val::Nil, | |
| 694 | (Val::Point(p), Val::Str(k)) if k == "X" => Val::Num(p[0]), | |
| 695 | (Val::Point(p), Val::Str(k)) if k == "Y" => Val::Num(p[1]), | |
| 696 | (Val::Point(p), Val::Num(1.0)) => Val::Num(p[0]), | |
| 697 | (Val::Point(p), Val::Num(2.0)) => Val::Num(p[1]), | |
| 698 | (Val::Point(_), _) => Val::Nil, | |
| 699 | (Val::Math, Val::Str(k)) => match k.as_str() { | |
| 700 | "pi" => Val::Num(std::f64::consts::PI), | |
| 701 | "huge" => Val::Num(f64::INFINITY), | |
| 702 | _ => MATH_FNS.iter().find(|f| **f == k).map_or(Val::Nil, |f| Val::Func(f)), | |
| 703 | }, | |
| 704 | _ => return None, | |
| 705 | }) | |
| 300 | 706 | } |
| 301 | 707 | |
| 302 | #[test] | |
| 303 | fn pcall_cannot_swallow_the_budget() { | |
| 304 | let engine = ExprEngine::new(); | |
| 305 | let e = HashMap::new(); | |
| 306 | let eval = |src: &str| engine.eval_number(src, 0.0, &HashMap::new(), &HashMap::new(), &e); | |
| 307 | let start = std::time::Instant::now(); | |
| 308 | assert_eq!(eval(":while true do pcall(function() while true do end end) end"), None); | |
| 309 | assert_eq!(eval(":while true do xpcall(function() while true do end end, print) end"), None); | |
| 310 | assert!(start.elapsed() < std::time::Duration::from_millis(50), "{:?}", start.elapsed()); | |
| 311 | assert_eq!(eval("1 + 1"), Some(2.0)); | |
| 708 | fn binary<'a>(op: &str, a: Val<'a>, b: Val<'a>) -> Option<Val<'a>> { | |
| 709 | use std::cmp::Ordering; | |
| 710 | let ordering = |a: &Val, b: &Val| match (a, b) { | |
| 711 | (Val::Num(a), Val::Num(b)) => a.partial_cmp(b).map(Some), | |
| 712 | (Val::Str(a), Val::Str(b)) => Some(Some(a.cmp(b))), | |
| 713 | _ => None, | |
| 714 | }; | |
| 715 | Some(match op { | |
| 716 | "==" => Val::Bool(a == b), | |
| 717 | "~=" => Val::Bool(a != b), | |
| 718 | "<" => Val::Bool(ordering(&a, &b)?.is_some_and(|o| o == Ordering::Less)), | |
| 719 | "<=" => Val::Bool(ordering(&a, &b)?.is_some_and(|o| o != Ordering::Greater)), | |
| 720 | ">" => Val::Bool(ordering(&a, &b)?.is_some_and(|o| o == Ordering::Greater)), | |
| 721 | ">=" => Val::Bool(ordering(&a, &b)?.is_some_and(|o| o != Ordering::Less)), | |
| 722 | ".." => Val::Str(a.text()? + &b.text()?), | |
| 723 | _ => { | |
| 724 | let (a, b) = (a.num()?, b.num()?); | |
| 725 | Val::Num(match op { | |
| 726 | "+" => a + b, | |
| 727 | "-" => a - b, | |
| 728 | "*" => a * b, | |
| 729 | "/" => a / b, | |
| 730 | "//" => (a / b).floor(), | |
| 731 | "%" => a - (a / b).floor() * b, | |
| 732 | "^" => a.powf(b), | |
| 733 | _ => return None, | |
| 734 | }) | |
| 735 | } | |
| 736 | }) | |
| 312 | 737 | } |
| 313 | 738 | |
| 739 | fn call<'a>(name: &str, args: &[Val<'a>]) -> Option<Val<'a>> { | |
| 740 | let arg = |i: usize| args.get(i).and_then(Val::num); | |
| 741 | let unary: Option<fn(f64) -> f64> = match name { | |
| 742 | "abs" => Some(f64::abs), | |
| 743 | "acos" => Some(f64::acos), | |
| 744 | "asin" => Some(f64::asin), | |
| 745 | "ceil" => Some(f64::ceil), | |
| 746 | "cos" => Some(f64::cos), | |
| 747 | "cosh" => Some(f64::cosh), | |
| 748 | "deg" => Some(f64::to_degrees), | |
| 749 | "exp" => Some(f64::exp), | |
| 750 | "floor" => Some(f64::floor), | |
| 751 | "log10" => Some(f64::log10), | |
| 752 | "rad" => Some(f64::to_radians), | |
| 753 | "sin" => Some(f64::sin), | |
| 754 | "sinh" => Some(f64::sinh), | |
| 755 | "sqrt" => Some(f64::sqrt), | |
| 756 | "tan" => Some(f64::tan), | |
| 757 | "tanh" => Some(f64::tanh), | |
| 758 | _ => None, | |
| 759 | }; | |
| 760 | if let Some(f) = unary { | |
| 761 | return Some(Val::Num(f(arg(0)?))); | |
| 762 | } | |
| 763 | Some(match name { | |
| 764 | "atan" | "atan2" => Val::Num(match arg(1) { | |
| 765 | Some(x) => arg(0)?.atan2(x), | |
| 766 | None => arg(0)?.atan(), | |
| 767 | }), | |
| 768 | "fmod" | "mod" => Val::Num(arg(0)? % arg(1)?), | |
| 769 | "pow" => Val::Num(arg(0)?.powf(arg(1)?)), | |
| 770 | "log" => Val::Num(match arg(1) { | |
| 771 | Some(2.0) => arg(0)?.log2(), | |
| 772 | Some(10.0) => arg(0)?.log10(), | |
| 773 | Some(base) => arg(0)?.ln() / base.ln(), | |
| 774 | None => arg(0)?.ln(), | |
| 775 | }), | |
| 776 | "max" | "min" => { | |
| 777 | let mut nums = (0..args.len()).map(arg); | |
| 778 | let first = nums.next()??; | |
| 779 | let pick = if name == "max" { f64::max } else { f64::min }; | |
| 780 | Val::Num(nums.try_fold(first, |acc, n| n.map(|n| pick(acc, n)))?) | |
| 781 | } | |
| 782 | "iif" => { | |
| 783 | let cond = args.first()?; | |
| 784 | let pass = cond.truthy() && cond.num() != Some(0.0); | |
| 785 | args.get(if pass { 1 } else { 2 }).cloned().unwrap_or(Val::Nil) | |
| 786 | } | |
| 787 | "clamp" => { | |
| 788 | let (x, lo, hi) = (arg(0)?, arg(1)?, arg(2)?); | |
| 789 | Val::Num(if x < lo { lo } else if x > hi { hi } else { x }) | |
| 790 | } | |
| 791 | "mix" => Val::Num(arg(0)? + (arg(1)? - arg(0)?) * arg(2)?), | |
| 792 | "Point" => Val::Point([arg(0).unwrap_or(0.0), arg(1).unwrap_or(0.0)]), | |
| 793 | "Text" | "tostring" => Val::Str(args.first().map_or(Some(String::new()), Val::text)?), | |
| 794 | "tonumber" => args.first()?.num().map_or(Val::Nil, Val::Num), | |
| 795 | _ => return None, | |
| 796 | }) | |
| 797 | } | |
| 798 | ||
| 799 | #[derive(Default)] | |
| 800 | pub struct ExprEngine; | |
| 801 | ||
| 802 | impl ExprEngine { | |
| 803 | pub fn new() -> Self { | |
| 804 | Self | |
| 805 | } | |
| 806 | ||
| 807 | fn run<R>( | |
| 808 | &self, | |
| 809 | expr: &str, | |
| 810 | time: f64, | |
| 811 | self_params: &HashMap<String, f64>, | |
| 812 | self_points: &HashMap<String, [f64; 2]>, | |
| 813 | env_nodes: &HashMap<String, HashMap<String, ExprValue>>, | |
| 814 | read: impl FnOnce(Val) -> Option<R>, | |
| 815 | ) -> Option<R> { | |
| 816 | let body = match expr.trim_start().strip_prefix(':') { | |
| 817 | Some(stmt) => stmt.trim_start().strip_prefix("return ")?, | |
| 818 | None => expr, | |
| 819 | }; | |
| 820 | let mut parser = Parser { toks: lex(body)?, pos: 0, depth: 0 }; | |
| 821 | let ast = parser.expr(0)?; | |
| 822 | if parser.pos != parser.toks.len() { | |
| 823 | return None; | |
| 824 | } | |
| 825 | let scope = Scope { time, params: self_params, points: self_points, nodes: env_nodes }; | |
| 826 | read(scope.eval(&ast)?) | |
| 827 | } | |
| 828 | ||
| 829 | pub fn eval_number( | |
| 830 | &self, | |
| 831 | expr: &str, | |
| 832 | time: f64, | |
| 833 | self_params: &HashMap<String, f64>, | |
| 834 | self_points: &HashMap<String, [f64; 2]>, | |
| 835 | env_nodes: &HashMap<String, HashMap<String, ExprValue>>, | |
| 836 | ) -> Option<f64> { | |
| 837 | self.run(expr, time, self_params, self_points, env_nodes, |v| match v { | |
| 838 | Val::Bool(b) => Some(f64::from(b)), | |
| 839 | other => other.num(), | |
| 840 | }) | |
| 841 | } | |
| 842 | ||
| 843 | pub fn eval_point( | |
| 844 | &self, | |
| 845 | expr: &str, | |
| 846 | time: f64, | |
| 847 | self_params: &HashMap<String, f64>, | |
| 848 | self_points: &HashMap<String, [f64; 2]>, | |
| 849 | env_nodes: &HashMap<String, HashMap<String, ExprValue>>, | |
| 850 | ) -> Option<[f64; 2]> { | |
| 851 | self.run(expr, time, self_params, self_points, env_nodes, |v| match v { | |
| 852 | Val::Point(p) => Some(p), | |
| 853 | _ => None, | |
| 854 | }) | |
| 855 | } | |
| 856 | ||
| 857 | pub fn eval_string( | |
| 858 | &self, | |
| 859 | expr: &str, | |
| 860 | time: f64, | |
| 861 | self_params: &HashMap<String, f64>, | |
| 862 | self_points: &HashMap<String, [f64; 2]>, | |
| 863 | env_nodes: &HashMap<String, HashMap<String, ExprValue>>, | |
| 864 | ) -> Option<String> { | |
| 865 | self.run(expr, time, self_params, self_points, env_nodes, |v| v.text()) | |
| 866 | } | |
| 867 | } | |
| 868 | ||
| 869 | #[cfg(test)] | |
| 870 | mod tests { | |
| 871 | use super::*; | |
| 872 | ||
| 873 | fn nodes() -> HashMap<String, HashMap<String, ExprValue>> { | |
| 874 | HashMap::from([( | |
| 875 | "Ctl".to_owned(), | |
| 876 | HashMap::from([ | |
| 877 | ("Size".to_owned(), ExprValue::Number(0.25)), | |
| 878 | ("StyledText".to_owned(), ExprValue::Text("hi".to_owned())), | |
| 879 | ]), | |
| 880 | )]) | |
| 881 | } | |
| 882 | ||
| 883 | fn num(expr: &str, time: f64) -> Option<f64> { | |
| 884 | let params = HashMap::from([("Width".to_owned(), 8.0)]); | |
| 885 | let points = HashMap::from([("Center".to_owned(), [0.5, 0.25])]); | |
| 886 | ExprEngine::new().eval_number(expr, time, &params, &points, &nodes()) | |
| 887 | } | |
| 888 | ||
| 889 | #[test] | |
| 890 | fn falling_comp_expressions() { | |
| 891 | assert_eq!(num("floor(time/3)*3", 7.0), Some(6.0)); | |
| 892 | assert_eq!(num("floor(time/2)/4", 9.0), Some(1.0)); | |
| 893 | assert_eq!(num("floor(time/5)*42", 11.0), Some(84.0)); | |
| 894 | assert_eq!(num("math.floor(time / 5) * 42", 11.0), Some(84.0)); | |
| 895 | } | |
| 896 | ||
| 897 | #[test] | |
| 898 | fn precedence_and_associativity() { | |
| 899 | assert_eq!(num("-2^2", 0.0), Some(-4.0)); | |
| 900 | assert_eq!(num("2^3^2", 0.0), Some(512.0)); | |
| 901 | assert_eq!(num("2^-1", 0.0), Some(0.5)); | |
| 902 | assert_eq!(num("1 + 2 * 3 - 4 / 2", 0.0), Some(5.0)); | |
| 903 | assert_eq!(num("-7 % 3", 0.0), Some(2.0)); | |
| 904 | assert_eq!(num("7 // 2", 0.0), Some(3.0)); | |
| 905 | assert_eq!(num("1 .. 2 + 1", 0.0), Some(13.0)); | |
| 906 | } | |
| 907 | ||
| 908 | #[test] | |
| 909 | fn logic_and_ternaries() { | |
| 910 | assert_eq!(num("iif(time > 1, 10, 20)", 2.0), Some(10.0)); | |
| 911 | assert_eq!(num("iif(0, 10, 20)", 2.0), Some(20.0)); | |
| 912 | assert_eq!(num("time > 1 and 5 or 6", 0.0), Some(6.0)); | |
| 913 | assert_eq!(num("nil or 3", 0.0), Some(3.0)); | |
| 914 | assert_eq!(num("not (1 == 1)", 0.0), Some(0.0)); | |
| 915 | assert_eq!(num("clamp(5, 0, 1) + min(3, 2, 9) + max(1, 4)", 0.0), Some(7.0)); | |
| 916 | assert_eq!(num("mix(10, 20, 0.5)", 0.0), Some(15.0)); | |
| 917 | } | |
| 918 | ||
| 919 | #[test] | |
| 920 | fn scope_lookups() { | |
| 921 | assert_eq!(num("Width * 2", 0.0), Some(16.0)); | |
| 922 | assert_eq!(num("Center.X + Center[2]", 0.0), Some(0.75)); | |
| 923 | assert_eq!(num("Ctl.Size", 0.0), Some(0.25)); | |
| 924 | assert_eq!(num("Ctl.Missing", 0.0), Some(0.0)); | |
| 925 | assert_eq!(num("Nope.Size", 0.0), None); | |
| 926 | assert_eq!(num("sin(pi / 2) + atan(1, 1) * 0", 0.0), Some(1.0)); | |
| 927 | } | |
| 928 | ||
| 929 | #[test] | |
| 930 | fn points_and_strings() { | |
| 931 | let e = ExprEngine::new(); | |
| 932 | let (p, q, n) = (HashMap::new(), HashMap::new(), nodes()); | |
| 933 | assert_eq!(e.eval_point("Point(time, 0.5)", 2.0, &p, &q, &n), Some([2.0, 0.5])); | |
| 934 | assert_eq!(e.eval_string("Ctl.StyledText.Value .. '!'", 0.0, &p, &q, &n).as_deref(), Some("hi!")); | |
| 935 | assert_eq!(e.eval_string("Ctl.StyledText", 0.0, &p, &q, &n).as_deref(), Some("hi")); | |
| 936 | assert_eq!(e.eval_string("Text('f' .. time)", 3.0, &p, &q, &n).as_deref(), Some("f3")); | |
| 937 | assert_eq!(e.eval_string("time", 2.5, &p, &q, &n).as_deref(), Some("2.5")); | |
| 938 | } | |
| 939 | ||
| 940 | #[test] | |
| 941 | fn unsupported_and_malformed_input_is_none() { | |
| 942 | for src in ["", "1 +", "(1", "1 2", "foo(1)", "'a':upper()", ":local a = 1; return a", "1 @ 2", "'abc", "{}"] { | |
| 943 | assert_eq!(num(src, 0.0), None, "{src:?}"); | |
| 944 | } | |
| 945 | assert_eq!(num(":return time * 2", 2.0), Some(4.0)); | |
| 946 | assert_eq!(num(&"(".repeat(200), 0.0), None); | |
| 947 | } | |
| 948 | } | |
| 949 | } | |
| 950 | ||
| 951 | #[cfg(test)] | |
| 952 | mod parity { | |
| 953 | use super::{ExprEngine, ExprValue, pure}; | |
| 954 | use std::collections::HashMap; | |
| 955 | ||
| 314 | 956 | #[test] |
| 315 | fn evaluations_cannot_mutate_shared_state() { | |
| 316 | let engine = ExprEngine::new(); | |
| 317 | let e = HashMap::new(); | |
| 318 | let eval = |src: &str| engine.eval_number(src, 0.0, &HashMap::new(), &HashMap::new(), &e); | |
| 319 | for src in [ | |
| 320 | ":math.floor = function() return 42 end; return 1", | |
| 321 | ":string.upper = function() return 42 end; return 1", | |
| 322 | ":table.insert = nil; return 1", | |
| 323 | ":_G.leak = 1; return 1", | |
| 324 | ":getmetatable('').__index.upper = nil; return 1", | |
| 325 | ":setmetatable(math, nil); return 1", | |
| 326 | ] { | |
| 327 | assert_eq!(eval(src), None, "{src}"); | |
| 328 | } | |
| 329 | assert_eq!(eval(":floor = function() return 42 end; return floor(1.5)"), Some(42.0)); | |
| 330 | assert_eq!(eval("floor(1.5)"), Some(1.0)); | |
| 331 | assert_eq!(eval("math.floor(1.5)"), Some(1.0)); | |
| 332 | assert_eq!(eval("leak"), None); | |
| 333 | let upper = engine.eval_string("('a'):upper()", 0.0, &HashMap::new(), &HashMap::new(), &e); | |
| 334 | assert_eq!(upper.as_deref(), Some("A")); | |
| 335 | assert_eq!(eval("string.len('abc') + select('#', table.unpack({1, 2}))"), Some(5.0)); | |
| 957 | fn pure_matches_lua_on_shared_subset() { | |
| 958 | let params = HashMap::from([("Width".to_owned(), 8.0)]); | |
| 959 | let points = HashMap::from([("Center".to_owned(), [0.5, 0.25])]); | |
| 960 | let nodes = HashMap::from([( | |
| 961 | "Ctl".to_owned(), | |
| 962 | HashMap::from([("Size".to_owned(), ExprValue::Number(0.25))]), | |
| 963 | )]); | |
| 964 | let (lua, pure) = (ExprEngine::new(), pure::ExprEngine::new()); | |
| 965 | for time in [0.0, 2.5, 7.0, 11.0] { | |
| 966 | for src in [ | |
| 967 | "floor(time/3)*3", | |
| 968 | "floor(time/2)/4", | |
| 969 | "floor(time/5)*42", | |
| 970 | "time * 2 + math.sin(0.5)", | |
| 971 | "-2^2", | |
| 972 | "2^3^2", | |
| 973 | "-7 % 3", | |
| 974 | "7 // 2", | |
| 975 | "iif(time > 3, 10, 20)", | |
| 976 | "time > 3 and 5 or 6", | |
| 977 | "clamp(time, 1, 4) + mix(1, 3, 0.5)", | |
| 978 | "Width / 3 + Center.X + Center[2] + Ctl.Size + Ctl.Missing", | |
| 979 | "atan(1, 2) + atan2(1, 2) + log(8, 2) + log10(100) + fmod(-7, 3) + pow(2, 0.5)", | |
| 980 | "max(1, time, 3) + min(time, 9) + abs(-time) + ceil(time) + sqrt(time)", | |
| 981 | "cosh(time) + sinh(time) + tanh(time) + deg(1) + rad(90)", | |
| 982 | "time ~= 2.5", | |
| 983 | "'10' + 1", | |
| 984 | "Nope.Size", | |
| 985 | "1 +", | |
| 986 | ] { | |
| 987 | let args = (src, time, &params, &points, &nodes); | |
| 988 | let l = lua.eval_number(args.0, args.1, args.2, args.3, args.4); | |
| 989 | let p = pure.eval_number(args.0, args.1, args.2, args.3, args.4); | |
| 990 | match (l, p) { | |
| 991 | (Some(l), Some(p)) => assert!((l - p).abs() < 1e-9 || (l.is_nan() && p.is_nan()), "{src} @ {time}: {l} vs {p}"), | |
| 992 | _ => assert_eq!(l, p, "{src} @ {time}"), | |
| 993 | } | |
| 994 | } | |
| 995 | } | |
| 336 | 996 | } |
| 337 | 997 | } |
crates/web/.gitignore created+2| ... | ... | @@ -0,0 +1,2 @@ |
| 1 | /target | |
| 2 | /dist |
crates/web/Cargo.lock created+2605| ... | ... | @@ -0,0 +1,2605 @@ |
| 1 | # This file is automatically @generated by Cargo. | |
| 2 | # It is not intended for manual editing. | |
| 3 | version = 4 | |
| 4 | ||
| 5 | [[package]] | |
| 6 | name = "adler2" | |
| 7 | version = "2.0.1" | |
| 8 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 9 | checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" | |
| 10 | ||
| 11 | [[package]] | |
| 12 | name = "aho-corasick" | |
| 13 | version = "1.1.5" | |
| 14 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 15 | checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" | |
| 16 | dependencies = [ | |
| 17 | "memchr", | |
| 18 | ] | |
| 19 | ||
| 20 | [[package]] | |
| 21 | name = "allocator-api2" | |
| 22 | version = "0.2.22" | |
| 23 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 24 | checksum = "57b212daf2e827b1ccdd778b7eb48ba433e58cb0e4f27b43cd6b7a608425a014" | |
| 25 | ||
| 26 | [[package]] | |
| 27 | name = "alsa" | |
| 28 | version = "0.9.1" | |
| 29 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 30 | checksum = "ed7572b7ba83a31e20d1b48970ee402d2e3e0537dcfe0a3ff4d6eb7508617d43" | |
| 31 | dependencies = [ | |
| 32 | "alsa-sys", | |
| 33 | "bitflags 2.13.2", | |
| 34 | "cfg-if", | |
| 35 | "libc", | |
| 36 | ] | |
| 37 | ||
| 38 | [[package]] | |
| 39 | name = "alsa-sys" | |
| 40 | version = "0.3.1" | |
| 41 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 42 | checksum = "db8fee663d06c4e303404ef5f40488a53e062f89ba8bfed81f42325aafad1527" | |
| 43 | dependencies = [ | |
| 44 | "libc", | |
| 45 | "pkg-config", | |
| 46 | ] | |
| 47 | ||
| 48 | [[package]] | |
| 49 | name = "android_system_properties" | |
| 50 | version = "0.1.6" | |
| 51 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 52 | checksum = "ae221649c9976a6f6c56ae1facf410f3ddb33cc661c4b7b61020a912d4237fbc" | |
| 53 | dependencies = [ | |
| 54 | "libc", | |
| 55 | ] | |
| 56 | ||
| 57 | [[package]] | |
| 58 | name = "arrayvec" | |
| 59 | version = "0.7.9" | |
| 60 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 61 | checksum = "47a64a0fd06e123e9e3cf3ad01432af17dcab8185e8023edcf184fe696f9675d" | |
| 62 | ||
| 63 | [[package]] | |
| 64 | name = "ash" | |
| 65 | version = "0.38.0+1.3.281" | |
| 66 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 67 | checksum = "0bb44936d800fea8f016d7f2311c6a4f97aebd5dc86f09906139ec848cf3a46f" | |
| 68 | dependencies = [ | |
| 69 | "libloading", | |
| 70 | ] | |
| 71 | ||
| 72 | [[package]] | |
| 73 | name = "autocfg" | |
| 74 | version = "1.5.1" | |
| 75 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 76 | checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" | |
| 77 | ||
| 78 | [[package]] | |
| 79 | name = "bindgen" | |
| 80 | version = "0.72.1" | |
| 81 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 82 | checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895" | |
| 83 | dependencies = [ | |
| 84 | "bitflags 2.13.2", | |
| 85 | "cexpr", | |
| 86 | "clang-sys", | |
| 87 | "itertools", | |
| 88 | "proc-macro2", | |
| 89 | "quote", | |
| 90 | "regex", | |
| 91 | "rustc-hash 2.1.3", | |
| 92 | "shlex 1.3.0", | |
| 93 | "syn 2.0.119", | |
| 94 | ] | |
| 95 | ||
| 96 | [[package]] | |
| 97 | name = "bit-set" | |
| 98 | version = "0.10.0" | |
| 99 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 100 | checksum = "09ec2f926cc3060f09db9ebc5b52823d85268d24bb917e472c0c4bea35780a7d" | |
| 101 | dependencies = [ | |
| 102 | "bit-vec", | |
| 103 | ] | |
| 104 | ||
| 105 | [[package]] | |
| 106 | name = "bit-vec" | |
| 107 | version = "0.9.1" | |
| 108 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 109 | checksum = "b71798fca2c1fe1086445a7258a4bc81e6e49dcd24c8d0dd9a1e57395b603f51" | |
| 110 | ||
| 111 | [[package]] | |
| 112 | name = "bit_field" | |
| 113 | version = "0.10.4" | |
| 114 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 115 | checksum = "cb2907cc03d08cdb1c6724ad0670ce67c4a71e1c45a6d7635224011714cfc4b1" | |
| 116 | ||
| 117 | [[package]] | |
| 118 | name = "bitflags" | |
| 119 | version = "1.3.2" | |
| 120 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 121 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" | |
| 122 | ||
| 123 | [[package]] | |
| 124 | name = "bitflags" | |
| 125 | version = "2.13.2" | |
| 126 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 127 | checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06" | |
| 128 | ||
| 129 | [[package]] | |
| 130 | name = "block2" | |
| 131 | version = "0.6.2" | |
| 132 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 133 | checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5" | |
| 134 | dependencies = [ | |
| 135 | "objc2", | |
| 136 | ] | |
| 137 | ||
| 138 | [[package]] | |
| 139 | name = "bstr" | |
| 140 | version = "1.14.0" | |
| 141 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 142 | checksum = "a680398c10c7bc0488067c4612226ea905a85f607134b69f3068d505d58c4214" | |
| 143 | dependencies = [ | |
| 144 | "memchr", | |
| 145 | "serde_core", | |
| 146 | ] | |
| 147 | ||
| 148 | [[package]] | |
| 149 | name = "bumpalo" | |
| 150 | version = "3.20.4" | |
| 151 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 152 | checksum = "87a0cf66fd1eb2fb7b822cb78370d82303750809bc6ba855f3f58e517d3238db" | |
| 153 | ||
| 154 | [[package]] | |
| 155 | name = "bytemuck" | |
| 156 | version = "1.25.2" | |
| 157 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 158 | checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797" | |
| 159 | dependencies = [ | |
| 160 | "bytemuck_derive", | |
| 161 | ] | |
| 162 | ||
| 163 | [[package]] | |
| 164 | name = "bytemuck_derive" | |
| 165 | version = "1.12.1" | |
| 166 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 167 | checksum = "6a1f896587b6f2c069c73d2f0913e2d590c3990285cd2f0b6aa02b786b4c679c" | |
| 168 | dependencies = [ | |
| 169 | "proc-macro2", | |
| 170 | "quote", | |
| 171 | "syn 3.0.10", | |
| 172 | ] | |
| 173 | ||
| 174 | [[package]] | |
| 175 | name = "byteorder-lite" | |
| 176 | version = "0.1.0" | |
| 177 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 178 | checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" | |
| 179 | ||
| 180 | [[package]] | |
| 181 | name = "bytes" | |
| 182 | version = "1.12.2" | |
| 183 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 184 | checksum = "776dfebd015e2d8732c684a2c71003674ccb49457b539b9e82151ba38e96dd7c" | |
| 185 | ||
| 186 | [[package]] | |
| 187 | name = "cc" | |
| 188 | version = "1.12.0" | |
| 189 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 190 | checksum = "95e45cf2980b2d467be49a9ed942c9179b701063a7ca3d037de7ee9bd67f8d66" | |
| 191 | dependencies = [ | |
| 192 | "find-msvc-tools", | |
| 193 | "jobserver", | |
| 194 | "libc", | |
| 195 | "shlex 2.0.1", | |
| 196 | ] | |
| 197 | ||
| 198 | [[package]] | |
| 199 | name = "cesu8" | |
| 200 | version = "1.1.0" | |
| 201 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 202 | checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" | |
| 203 | ||
| 204 | [[package]] | |
| 205 | name = "cexpr" | |
| 206 | version = "0.6.0" | |
| 207 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 208 | checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" | |
| 209 | dependencies = [ | |
| 210 | "nom", | |
| 211 | ] | |
| 212 | ||
| 213 | [[package]] | |
| 214 | name = "cfg-if" | |
| 215 | version = "1.0.5" | |
| 216 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 217 | checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600" | |
| 218 | ||
| 219 | [[package]] | |
| 220 | name = "cfg_aliases" | |
| 221 | version = "0.2.2" | |
| 222 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 223 | checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" | |
| 224 | ||
| 225 | [[package]] | |
| 226 | name = "clang-sys" | |
| 227 | version = "1.9.1" | |
| 228 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 229 | checksum = "157a8ba7b480713b56f4c09fd13fc3e0a22a5dfab8097ba61cbc5feef950788a" | |
| 230 | dependencies = [ | |
| 231 | "glob", | |
| 232 | "libc", | |
| 233 | "libloading", | |
| 234 | ] | |
| 235 | ||
| 236 | [[package]] | |
| 237 | name = "codespan-reporting" | |
| 238 | version = "0.13.1" | |
| 239 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 240 | checksum = "af491d569909a7e4dee0ad7db7f5341fef5c614d5b8ec8cf765732aba3cff681" | |
| 241 | dependencies = [ | |
| 242 | "serde", | |
| 243 | "termcolor", | |
| 244 | "unicode-width", | |
| 245 | ] | |
| 246 | ||
| 247 | [[package]] | |
| 248 | name = "combine" | |
| 249 | version = "4.6.9" | |
| 250 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 251 | checksum = "4356eba6976435498d05a311ee9fc486da3bc81c200d3f0d7dd9703b41913f92" | |
| 252 | dependencies = [ | |
| 253 | "bytes", | |
| 254 | "memchr", | |
| 255 | ] | |
| 256 | ||
| 257 | [[package]] | |
| 258 | name = "console_error_panic_hook" | |
| 259 | version = "0.1.7" | |
| 260 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 261 | checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" | |
| 262 | dependencies = [ | |
| 263 | "cfg-if", | |
| 264 | "wasm-bindgen", | |
| 265 | ] | |
| 266 | ||
| 267 | [[package]] | |
| 268 | name = "core-foundation-sys" | |
| 269 | version = "0.8.7" | |
| 270 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 271 | checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" | |
| 272 | ||
| 273 | [[package]] | |
| 274 | name = "core_detect" | |
| 275 | version = "1.0.0" | |
| 276 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 277 | checksum = "7f8f80099a98041a3d1622845c271458a2d73e688351bf3cb999266764b81d48" | |
| 278 | ||
| 279 | [[package]] | |
| 280 | name = "core_maths" | |
| 281 | version = "0.1.1" | |
| 282 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 283 | checksum = "77745e017f5edba1a9c1d854f6f3a52dac8a12dd5af5d2f54aecf61e43d80d30" | |
| 284 | dependencies = [ | |
| 285 | "libm", | |
| 286 | ] | |
| 287 | ||
| 288 | [[package]] | |
| 289 | name = "coreaudio-rs" | |
| 290 | version = "0.11.3" | |
| 291 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 292 | checksum = "321077172d79c662f64f5071a03120748d5bb652f5231570141be24cfcd2bace" | |
| 293 | dependencies = [ | |
| 294 | "bitflags 1.3.2", | |
| 295 | "core-foundation-sys", | |
| 296 | "coreaudio-sys", | |
| 297 | ] | |
| 298 | ||
| 299 | [[package]] | |
| 300 | name = "coreaudio-sys" | |
| 301 | version = "0.2.18" | |
| 302 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 303 | checksum = "b9b4739a805a62757a83e5654fa3faabec0442666b263bb2287d5a8185bfd953" | |
| 304 | dependencies = [ | |
| 305 | "bindgen", | |
| 306 | ] | |
| 307 | ||
| 308 | [[package]] | |
| 309 | name = "cpal" | |
| 310 | version = "0.15.3" | |
| 311 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 312 | checksum = "873dab07c8f743075e57f524c583985fbaf745602acbe916a01539364369a779" | |
| 313 | dependencies = [ | |
| 314 | "alsa", | |
| 315 | "core-foundation-sys", | |
| 316 | "coreaudio-rs", | |
| 317 | "dasp_sample", | |
| 318 | "jni", | |
| 319 | "js-sys", | |
| 320 | "libc", | |
| 321 | "mach2", | |
| 322 | "ndk", | |
| 323 | "ndk-context", | |
| 324 | "oboe", | |
| 325 | "wasm-bindgen", | |
| 326 | "wasm-bindgen-futures", | |
| 327 | "web-sys", | |
| 328 | "windows 0.54.0", | |
| 329 | ] | |
| 330 | ||
| 331 | [[package]] | |
| 332 | name = "crc32fast" | |
| 333 | version = "1.5.6" | |
| 334 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 335 | checksum = "fd9ae8fcb3ea71b0b26338b4ffb13006bb175de8fd07921089a906ce7e5e6945" | |
| 336 | dependencies = [ | |
| 337 | "cfg-if", | |
| 338 | ] | |
| 339 | ||
| 340 | [[package]] | |
| 341 | name = "crossbeam-deque" | |
| 342 | version = "0.8.8" | |
| 343 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 344 | checksum = "622f3fc73690be383c7214310406f28a90e6edeadc3cea882f9d71e495b9711a" | |
| 345 | dependencies = [ | |
| 346 | "crossbeam-epoch", | |
| 347 | "crossbeam-utils", | |
| 348 | ] | |
| 349 | ||
| 350 | [[package]] | |
| 351 | name = "crossbeam-epoch" | |
| 352 | version = "0.9.21" | |
| 353 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 354 | checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d" | |
| 355 | dependencies = [ | |
| 356 | "crossbeam-utils", | |
| 357 | ] | |
| 358 | ||
| 359 | [[package]] | |
| 360 | name = "crossbeam-utils" | |
| 361 | version = "0.8.23" | |
| 362 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 363 | checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6" | |
| 364 | ||
| 365 | [[package]] | |
| 366 | name = "crunchy" | |
| 367 | version = "0.2.4" | |
| 368 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 369 | checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" | |
| 370 | ||
| 371 | [[package]] | |
| 372 | name = "dasp_sample" | |
| 373 | version = "0.11.0" | |
| 374 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 375 | checksum = "0c87e182de0887fd5361989c677c4e8f5000cd9491d6d563161a8f3a5519fc7f" | |
| 376 | ||
| 377 | [[package]] | |
| 378 | name = "dispatch2" | |
| 379 | version = "0.3.1" | |
| 380 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 381 | checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38" | |
| 382 | dependencies = [ | |
| 383 | "bitflags 2.13.2", | |
| 384 | "objc2", | |
| 385 | ] | |
| 386 | ||
| 387 | [[package]] | |
| 388 | name = "dlib" | |
| 389 | version = "0.5.3" | |
| 390 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 391 | checksum = "ab8ecd87370524b461f8557c119c405552c396ed91fc0a8eec68679eab26f94a" | |
| 392 | dependencies = [ | |
| 393 | "libloading", | |
| 394 | ] | |
| 395 | ||
| 396 | [[package]] | |
| 397 | name = "document-features" | |
| 398 | version = "0.2.12" | |
| 399 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 400 | checksum = "d4b8a88685455ed29a21542a33abd9cb6510b6b129abadabdcef0f4c55bc8f61" | |
| 401 | dependencies = [ | |
| 402 | "litrs", | |
| 403 | ] | |
| 404 | ||
| 405 | [[package]] | |
| 406 | name = "either" | |
| 407 | version = "1.19.0" | |
| 408 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 409 | checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be" | |
| 410 | ||
| 411 | [[package]] | |
| 412 | name = "encoding_rs" | |
| 413 | version = "0.8.44" | |
| 414 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 415 | checksum = "89253175e704ab869b04f9db224d38630e0211a53841a79181deae0889e169f5" | |
| 416 | dependencies = [ | |
| 417 | "cfg-if", | |
| 418 | "core_detect", | |
| 419 | "multiversion_no_op", | |
| 420 | "rustversion", | |
| 421 | "scopeguard", | |
| 422 | "simdutf8", | |
| 423 | ] | |
| 424 | ||
| 425 | [[package]] | |
| 426 | name = "engine" | |
| 427 | version = "0.1.0" | |
| 428 | dependencies = [ | |
| 429 | "bytemuck", | |
| 430 | "cc", | |
| 431 | "cpal", | |
| 432 | "exr", | |
| 433 | "fontdb", | |
| 434 | "image", | |
| 435 | "model", | |
| 436 | "png", | |
| 437 | "pollster", | |
| 438 | "rustybuzz", | |
| 439 | "symphonia", | |
| 440 | "web-time", | |
| 441 | "wgpu", | |
| 442 | "zeno", | |
| 443 | ] | |
| 444 | ||
| 445 | [[package]] | |
| 446 | name = "env_home" | |
| 447 | version = "0.1.0" | |
| 448 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 449 | checksum = "c7f84e12ccf0a7ddc17a6c41c93326024c42920d7ee630d04950e6926645c0fe" | |
| 450 | ||
| 451 | [[package]] | |
| 452 | name = "equivalent" | |
| 453 | version = "1.0.3" | |
| 454 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 455 | checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826" | |
| 456 | ||
| 457 | [[package]] | |
| 458 | name = "errno" | |
| 459 | version = "0.3.15" | |
| 460 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 461 | checksum = "e35d6e78f4cebb90e51d543db8fe41528851d6deeef6ef21ebd4bfdc1e784776" | |
| 462 | dependencies = [ | |
| 463 | "libc", | |
| 464 | "windows-sys 0.61.2", | |
| 465 | ] | |
| 466 | ||
| 467 | [[package]] | |
| 468 | name = "exr" | |
| 469 | version = "1.74.3" | |
| 470 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 471 | checksum = "cb29d0be702adf92c645d9b2f93472906ba83d400e59f98adb3770ce5c18c2f6" | |
| 472 | dependencies = [ | |
| 473 | "bit_field", | |
| 474 | "half", | |
| 475 | "lebe", | |
| 476 | "miniz_oxide 0.8.9", | |
| 477 | "multiversion", | |
| 478 | "rayon-core", | |
| 479 | "smallvec", | |
| 480 | "zune-inflate", | |
| 481 | ] | |
| 482 | ||
| 483 | [[package]] | |
| 484 | name = "extended" | |
| 485 | version = "0.1.0" | |
| 486 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 487 | checksum = "af9673d8203fcb076b19dfd17e38b3d4ae9f44959416ea532ce72415a6020365" | |
| 488 | ||
| 489 | [[package]] | |
| 490 | name = "fax" | |
| 491 | version = "0.2.7" | |
| 492 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 493 | checksum = "caf1079563223d5d59d83c85886a56e586cfd5c1a26292e971a0fa266531ac5a" | |
| 494 | ||
| 495 | [[package]] | |
| 496 | name = "fdeflate" | |
| 497 | version = "0.3.7" | |
| 498 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 499 | checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" | |
| 500 | dependencies = [ | |
| 501 | "simd-adler32", | |
| 502 | ] | |
| 503 | ||
| 504 | [[package]] | |
| 505 | name = "find-msvc-tools" | |
| 506 | version = "0.1.16" | |
| 507 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 508 | checksum = "3e44f110d1777dc6559a51e7d45083945ded4f1bf3305494350f693b6d20b9c8" | |
| 509 | ||
| 510 | [[package]] | |
| 511 | name = "fission-web" | |
| 512 | version = "0.1.0" | |
| 513 | dependencies = [ | |
| 514 | "console_error_panic_hook", | |
| 515 | "engine", | |
| 516 | "js-sys", | |
| 517 | "model", | |
| 518 | "serde_json", | |
| 519 | "wasm-bindgen", | |
| 520 | "wasm-bindgen-futures", | |
| 521 | "web-sys", | |
| 522 | "wgpu", | |
| 523 | ] | |
| 524 | ||
| 525 | [[package]] | |
| 526 | name = "flate2" | |
| 527 | version = "1.1.11" | |
| 528 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 529 | checksum = "626d4928326b646e70f65ed36fc7cf9f206bdb68a0019ee7c6b4709da4e084c4" | |
| 530 | dependencies = [ | |
| 531 | "crc32fast", | |
| 532 | "miniz_oxide 0.9.1", | |
| 533 | "zlib-rs", | |
| 534 | ] | |
| 535 | ||
| 536 | [[package]] | |
| 537 | name = "foldhash" | |
| 538 | version = "0.2.0" | |
| 539 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 540 | checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" | |
| 541 | ||
| 542 | [[package]] | |
| 543 | name = "fontdb" | |
| 544 | version = "0.23.0" | |
| 545 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 546 | checksum = "457e789b3d1202543297a350643cf459f836cade38934e7a4cf6a39e7cde2905" | |
| 547 | dependencies = [ | |
| 548 | "log", | |
| 549 | "memmap2", | |
| 550 | "slotmap", | |
| 551 | "tinyvec", | |
| 552 | "ttf-parser", | |
| 553 | ] | |
| 554 | ||
| 555 | [[package]] | |
| 556 | name = "futures-core" | |
| 557 | version = "0.3.34" | |
| 558 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 559 | checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e" | |
| 560 | ||
| 561 | [[package]] | |
| 562 | name = "futures-task" | |
| 563 | version = "0.3.34" | |
| 564 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 565 | checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd" | |
| 566 | ||
| 567 | [[package]] | |
| 568 | name = "futures-util" | |
| 569 | version = "0.3.34" | |
| 570 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 571 | checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" | |
| 572 | dependencies = [ | |
| 573 | "futures-core", | |
| 574 | "futures-task", | |
| 575 | "pin-project-lite", | |
| 576 | "slab", | |
| 577 | ] | |
| 578 | ||
| 579 | [[package]] | |
| 580 | name = "getrandom" | |
| 581 | version = "0.4.3" | |
| 582 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 583 | checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" | |
| 584 | dependencies = [ | |
| 585 | "cfg-if", | |
| 586 | "libc", | |
| 587 | "r-efi", | |
| 588 | ] | |
| 589 | ||
| 590 | [[package]] | |
| 591 | name = "gl_generator" | |
| 592 | version = "0.14.0" | |
| 593 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 594 | checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" | |
| 595 | dependencies = [ | |
| 596 | "khronos_api", | |
| 597 | "log", | |
| 598 | "xml-rs", | |
| 599 | ] | |
| 600 | ||
| 601 | [[package]] | |
| 602 | name = "glob" | |
| 603 | version = "0.3.4" | |
| 604 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 605 | checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b" | |
| 606 | ||
| 607 | [[package]] | |
| 608 | name = "glow" | |
| 609 | version = "0.17.0" | |
| 610 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 611 | checksum = "29038e1c483364cc6bb3cf78feee1816002e127c331a1eec55a4d202b9e1adb5" | |
| 612 | dependencies = [ | |
| 613 | "js-sys", | |
| 614 | "slotmap", | |
| 615 | "wasm-bindgen", | |
| 616 | "web-sys", | |
| 617 | ] | |
| 618 | ||
| 619 | [[package]] | |
| 620 | name = "glutin_wgl_sys" | |
| 621 | version = "0.6.1" | |
| 622 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 623 | checksum = "2c4ee00b289aba7a9e5306d57c2d05499b2e5dc427f84ac708bd2c090212cf3e" | |
| 624 | dependencies = [ | |
| 625 | "gl_generator", | |
| 626 | ] | |
| 627 | ||
| 628 | [[package]] | |
| 629 | name = "gpu-allocator" | |
| 630 | version = "0.28.0" | |
| 631 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 632 | checksum = "51255ea7cfaadb6c5f1528d43e92a82acb2b96c43365989a28b2d44ee38f8795" | |
| 633 | dependencies = [ | |
| 634 | "ash", | |
| 635 | "hashbrown 0.16.1", | |
| 636 | "log", | |
| 637 | "presser", | |
| 638 | "thiserror 2.0.21", | |
| 639 | "windows 0.62.2", | |
| 640 | ] | |
| 641 | ||
| 642 | [[package]] | |
| 643 | name = "half" | |
| 644 | version = "2.7.1" | |
| 645 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 646 | checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b" | |
| 647 | dependencies = [ | |
| 648 | "cfg-if", | |
| 649 | "crunchy", | |
| 650 | "num-traits", | |
| 651 | "zerocopy", | |
| 652 | ] | |
| 653 | ||
| 654 | [[package]] | |
| 655 | name = "hashbrown" | |
| 656 | version = "0.16.1" | |
| 657 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 658 | checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" | |
| 659 | dependencies = [ | |
| 660 | "allocator-api2", | |
| 661 | "equivalent", | |
| 662 | "foldhash", | |
| 663 | ] | |
| 664 | ||
| 665 | [[package]] | |
| 666 | name = "hashbrown" | |
| 667 | version = "0.17.2" | |
| 668 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 669 | checksum = "735eaa21a6a5ffb2e84362faaeb90c05ba8e19797ca30428478cb6ea3a4921bc" | |
| 670 | dependencies = [ | |
| 671 | "foldhash", | |
| 672 | ] | |
| 673 | ||
| 674 | [[package]] | |
| 675 | name = "image" | |
| 676 | version = "0.25.10" | |
| 677 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 678 | checksum = "85ab80394333c02fe689eaf900ab500fbd0c2213da414687ebf995a65d5a6104" | |
| 679 | dependencies = [ | |
| 680 | "bytemuck", | |
| 681 | "byteorder-lite", | |
| 682 | "exr", | |
| 683 | "image-webp", | |
| 684 | "moxcms", | |
| 685 | "num-traits", | |
| 686 | "png", | |
| 687 | "tiff", | |
| 688 | "zune-core", | |
| 689 | "zune-jpeg", | |
| 690 | ] | |
| 691 | ||
| 692 | [[package]] | |
| 693 | name = "image-webp" | |
| 694 | version = "0.2.4" | |
| 695 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 696 | checksum = "525e9ff3e1a4be2fbea1fdf0e98686a6d98b4d8f937e1bf7402245af1909e8c3" | |
| 697 | dependencies = [ | |
| 698 | "byteorder-lite", | |
| 699 | "quick-error", | |
| 700 | ] | |
| 701 | ||
| 702 | [[package]] | |
| 703 | name = "indexmap" | |
| 704 | version = "2.14.2" | |
| 705 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 706 | checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855" | |
| 707 | dependencies = [ | |
| 708 | "equivalent", | |
| 709 | "hashbrown 0.17.2", | |
| 710 | ] | |
| 711 | ||
| 712 | [[package]] | |
| 713 | name = "itertools" | |
| 714 | version = "0.13.0" | |
| 715 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 716 | checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" | |
| 717 | dependencies = [ | |
| 718 | "either", | |
| 719 | ] | |
| 720 | ||
| 721 | [[package]] | |
| 722 | name = "itoa" | |
| 723 | version = "1.0.19" | |
| 724 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 725 | checksum = "3bd1574e617a9a6c1f8f8181bd7e841e1f20e4277607ef28945765188d6284d4" | |
| 726 | ||
| 727 | [[package]] | |
| 728 | name = "jni" | |
| 729 | version = "0.21.1" | |
| 730 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 731 | checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" | |
| 732 | dependencies = [ | |
| 733 | "cesu8", | |
| 734 | "cfg-if", | |
| 735 | "combine", | |
| 736 | "jni-sys 0.3.1", | |
| 737 | "log", | |
| 738 | "thiserror 1.0.69", | |
| 739 | "walkdir", | |
| 740 | "windows-sys 0.45.0", | |
| 741 | ] | |
| 742 | ||
| 743 | [[package]] | |
| 744 | name = "jni-sys" | |
| 745 | version = "0.3.1" | |
| 746 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 747 | checksum = "41a652e1f9b6e0275df1f15b32661cf0d4b78d4d87ddec5e0c3c20f097433258" | |
| 748 | dependencies = [ | |
| 749 | "jni-sys 0.4.1", | |
| 750 | ] | |
| 751 | ||
| 752 | [[package]] | |
| 753 | name = "jni-sys" | |
| 754 | version = "0.4.1" | |
| 755 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 756 | checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" | |
| 757 | dependencies = [ | |
| 758 | "jni-sys-macros", | |
| 759 | ] | |
| 760 | ||
| 761 | [[package]] | |
| 762 | name = "jni-sys-macros" | |
| 763 | version = "0.4.1" | |
| 764 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 765 | checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" | |
| 766 | dependencies = [ | |
| 767 | "quote", | |
| 768 | "syn 2.0.119", | |
| 769 | ] | |
| 770 | ||
| 771 | [[package]] | |
| 772 | name = "jobserver" | |
| 773 | version = "0.1.35" | |
| 774 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 775 | checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3" | |
| 776 | dependencies = [ | |
| 777 | "getrandom", | |
| 778 | "libc", | |
| 779 | ] | |
| 780 | ||
| 781 | [[package]] | |
| 782 | name = "js-sys" | |
| 783 | version = "0.3.105" | |
| 784 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 785 | checksum = "ce57d20d1ea864ce2ac172ab472d409214f4fd359f0b2a2775abdf522e2af99e" | |
| 786 | dependencies = [ | |
| 787 | "cfg-if", | |
| 788 | "futures-util", | |
| 789 | "wasm-bindgen", | |
| 790 | ] | |
| 791 | ||
| 792 | [[package]] | |
| 793 | name = "khronos-egl" | |
| 794 | version = "6.0.0" | |
| 795 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 796 | checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" | |
| 797 | dependencies = [ | |
| 798 | "libc", | |
| 799 | "libloading", | |
| 800 | "pkg-config", | |
| 801 | ] | |
| 802 | ||
| 803 | [[package]] | |
| 804 | name = "khronos_api" | |
| 805 | version = "3.1.0" | |
| 806 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 807 | checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" | |
| 808 | ||
| 809 | [[package]] | |
| 810 | name = "lazy_static" | |
| 811 | version = "1.5.1" | |
| 812 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 813 | checksum = "20870f649af7073d53e38067b2a84312175d56ea15217e1b15bc83506ec50afb" | |
| 814 | ||
| 815 | [[package]] | |
| 816 | name = "lebe" | |
| 817 | version = "0.5.3" | |
| 818 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 819 | checksum = "7a79a3332a6609480d7d0c9eab957bca6b455b91bb84e66d19f5ff66294b85b8" | |
| 820 | ||
| 821 | [[package]] | |
| 822 | name = "libc" | |
| 823 | version = "0.2.191" | |
| 824 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 825 | checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a" | |
| 826 | ||
| 827 | [[package]] | |
| 828 | name = "libloading" | |
| 829 | version = "0.8.9" | |
| 830 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 831 | checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" | |
| 832 | dependencies = [ | |
| 833 | "cfg-if", | |
| 834 | "windows-link", | |
| 835 | ] | |
| 836 | ||
| 837 | [[package]] | |
| 838 | name = "libm" | |
| 839 | version = "0.2.16" | |
| 840 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 841 | checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" | |
| 842 | ||
| 843 | [[package]] | |
| 844 | name = "linux-raw-sys" | |
| 845 | version = "0.12.1" | |
| 846 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 847 | checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" | |
| 848 | ||
| 849 | [[package]] | |
| 850 | name = "litrs" | |
| 851 | version = "1.1.0" | |
| 852 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 853 | checksum = "02b614978e47ce529faee66579f2b2fe19c94aa96d910a6a9a8043b2b02d8175" | |
| 854 | ||
| 855 | [[package]] | |
| 856 | name = "lock_api" | |
| 857 | version = "0.4.14" | |
| 858 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 859 | checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" | |
| 860 | dependencies = [ | |
| 861 | "scopeguard", | |
| 862 | ] | |
| 863 | ||
| 864 | [[package]] | |
| 865 | name = "log" | |
| 866 | version = "0.4.35" | |
| 867 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 868 | checksum = "5d15f86d12da44cd8d4ec3c73984537eb7f4cadcb9776a575a0a8a05ca11005c" | |
| 869 | ||
| 870 | [[package]] | |
| 871 | name = "lua-src" | |
| 872 | version = "547.0.0" | |
| 873 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 874 | checksum = "1edaf29e3517b49b8b746701e5648ccb5785cde1c119062cbabbc5d5cd115e42" | |
| 875 | dependencies = [ | |
| 876 | "cc", | |
| 877 | ] | |
| 878 | ||
| 879 | [[package]] | |
| 880 | name = "luajit-src" | |
| 881 | version = "210.5.12+a4f56a4" | |
| 882 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 883 | checksum = "b3a8e7962a5368d5f264d045a5a255e90f9aa3fc1941ae15a8d2940d42cac671" | |
| 884 | dependencies = [ | |
| 885 | "cc", | |
| 886 | "which", | |
| 887 | ] | |
| 888 | ||
| 889 | [[package]] | |
| 890 | name = "mach2" | |
| 891 | version = "0.4.3" | |
| 892 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 893 | checksum = "d640282b302c0bb0a2a8e0233ead9035e3bed871f0b7e81fe4a1ec829765db44" | |
| 894 | dependencies = [ | |
| 895 | "libc", | |
| 896 | ] | |
| 897 | ||
| 898 | [[package]] | |
| 899 | name = "memchr" | |
| 900 | version = "2.8.3" | |
| 901 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 902 | checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" | |
| 903 | ||
| 904 | [[package]] | |
| 905 | name = "memmap2" | |
| 906 | version = "0.9.12" | |
| 907 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 908 | checksum = "6b0ca1155a9ecc25aa12e8313a119f32edf0255fea2f44839c4ac0a12b2ac157" | |
| 909 | dependencies = [ | |
| 910 | "libc", | |
| 911 | ] | |
| 912 | ||
| 913 | [[package]] | |
| 914 | name = "minimal-lexical" | |
| 915 | version = "0.2.1" | |
| 916 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 917 | checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" | |
| 918 | ||
| 919 | [[package]] | |
| 920 | name = "miniz_oxide" | |
| 921 | version = "0.8.9" | |
| 922 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 923 | checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" | |
| 924 | dependencies = [ | |
| 925 | "adler2", | |
| 926 | "simd-adler32", | |
| 927 | ] | |
| 928 | ||
| 929 | [[package]] | |
| 930 | name = "miniz_oxide" | |
| 931 | version = "0.9.1" | |
| 932 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 933 | checksum = "b63fbc4a50860e98e7b2aa7804ded1db5cbc3aff9193adaff57a6931bf7c4b4c" | |
| 934 | dependencies = [ | |
| 935 | "adler2", | |
| 936 | "simd-adler32", | |
| 937 | ] | |
| 938 | ||
| 939 | [[package]] | |
| 940 | name = "mlua" | |
| 941 | version = "0.10.5" | |
| 942 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 943 | checksum = "c1f5f8fbebc7db5f671671134b9321c4b9aa9adeafccfd9a8c020ae45c6a35d0" | |
| 944 | dependencies = [ | |
| 945 | "bstr", | |
| 946 | "either", | |
| 947 | "mlua-sys", | |
| 948 | "num-traits", | |
| 949 | "parking_lot", | |
| 950 | "rustc-hash 2.1.3", | |
| 951 | "rustversion", | |
| 952 | ] | |
| 953 | ||
| 954 | [[package]] | |
| 955 | name = "mlua-sys" | |
| 956 | version = "0.6.8" | |
| 957 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 958 | checksum = "380c1f7e2099cafcf40e51d3a9f20a346977587aa4d012eae1f043149a728a93" | |
| 959 | dependencies = [ | |
| 960 | "cc", | |
| 961 | "cfg-if", | |
| 962 | "lua-src", | |
| 963 | "luajit-src", | |
| 964 | "pkg-config", | |
| 965 | ] | |
| 966 | ||
| 967 | [[package]] | |
| 968 | name = "model" | |
| 969 | version = "0.1.0" | |
| 970 | dependencies = [ | |
| 971 | "mlua", | |
| 972 | ] | |
| 973 | ||
| 974 | [[package]] | |
| 975 | name = "moxcms" | |
| 976 | version = "0.8.1" | |
| 977 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 978 | checksum = "bb85c154ba489f01b25c0d36ae69a87e4a1c73a72631fc6c0eb6dde34a73e44b" | |
| 979 | dependencies = [ | |
| 980 | "num-traits", | |
| 981 | "pxfm", | |
| 982 | ] | |
| 983 | ||
| 984 | [[package]] | |
| 985 | name = "multiversion" | |
| 986 | version = "0.8.1" | |
| 987 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 988 | checksum = "eb8a68be21d0755f83bfe47e79b896cc732687cf1903f0e50585e8d6ecc53076" | |
| 989 | dependencies = [ | |
| 990 | "multiversion-macros", | |
| 991 | "target-features", | |
| 992 | ] | |
| 993 | ||
| 994 | [[package]] | |
| 995 | name = "multiversion-macros" | |
| 996 | version = "0.8.1" | |
| 997 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 998 | checksum = "a05e0c3c3e4edaa21d87c645852ed0b0c3663752bcc6ec43353bd6189dce35e1" | |
| 999 | dependencies = [ | |
| 1000 | "proc-macro2", | |
| 1001 | "quote", | |
| 1002 | "syn 2.0.119", | |
| 1003 | "target-features", | |
| 1004 | ] | |
| 1005 | ||
| 1006 | [[package]] | |
| 1007 | name = "multiversion_no_op" | |
| 1008 | version = "1.0.0" | |
| 1009 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1010 | checksum = "743fb55ba31b18fb1ecef6bdc9aa2743314978ac084044301a7eee33fb99a20d" | |
| 1011 | ||
| 1012 | [[package]] | |
| 1013 | name = "naga" | |
| 1014 | version = "30.0.2" | |
| 1015 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1016 | checksum = "fd0dd362bf26c0ffdd143df6da66a25d287e196eff482f117771010b207ad163" | |
| 1017 | dependencies = [ | |
| 1018 | "arrayvec", | |
| 1019 | "bit-set", | |
| 1020 | "bitflags 2.13.2", | |
| 1021 | "cfg-if", | |
| 1022 | "cfg_aliases", | |
| 1023 | "codespan-reporting", | |
| 1024 | "half", | |
| 1025 | "hashbrown 0.17.2", | |
| 1026 | "indexmap", | |
| 1027 | "libm", | |
| 1028 | "log", | |
| 1029 | "naga-types", | |
| 1030 | "num-traits", | |
| 1031 | "once_cell", | |
| 1032 | "rustc-hash 1.1.0", | |
| 1033 | "spirv", | |
| 1034 | "thiserror 2.0.21", | |
| 1035 | "unicode-ident", | |
| 1036 | ] | |
| 1037 | ||
| 1038 | [[package]] | |
| 1039 | name = "naga-types" | |
| 1040 | version = "30.0.2" | |
| 1041 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1042 | checksum = "14474170feb673cfb18b3565111a9869797cc1d290fb9ec969c53f5e1e231c6d" | |
| 1043 | dependencies = [ | |
| 1044 | "hashbrown 0.17.2", | |
| 1045 | "indexmap", | |
| 1046 | "rustc-hash 1.1.0", | |
| 1047 | "thiserror 2.0.21", | |
| 1048 | ] | |
| 1049 | ||
| 1050 | [[package]] | |
| 1051 | name = "ndk" | |
| 1052 | version = "0.8.0" | |
| 1053 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1054 | checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7" | |
| 1055 | dependencies = [ | |
| 1056 | "bitflags 2.13.2", | |
| 1057 | "jni-sys 0.3.1", | |
| 1058 | "log", | |
| 1059 | "ndk-sys 0.5.0+25.2.9519653", | |
| 1060 | "num_enum", | |
| 1061 | "thiserror 1.0.69", | |
| 1062 | ] | |
| 1063 | ||
| 1064 | [[package]] | |
| 1065 | name = "ndk-context" | |
| 1066 | version = "0.1.1" | |
| 1067 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1068 | checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" | |
| 1069 | ||
| 1070 | [[package]] | |
| 1071 | name = "ndk-sys" | |
| 1072 | version = "0.5.0+25.2.9519653" | |
| 1073 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1074 | checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691" | |
| 1075 | dependencies = [ | |
| 1076 | "jni-sys 0.3.1", | |
| 1077 | ] | |
| 1078 | ||
| 1079 | [[package]] | |
| 1080 | name = "ndk-sys" | |
| 1081 | version = "0.6.0+11769913" | |
| 1082 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1083 | checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" | |
| 1084 | dependencies = [ | |
| 1085 | "jni-sys 0.3.1", | |
| 1086 | ] | |
| 1087 | ||
| 1088 | [[package]] | |
| 1089 | name = "nom" | |
| 1090 | version = "7.1.3" | |
| 1091 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1092 | checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" | |
| 1093 | dependencies = [ | |
| 1094 | "memchr", | |
| 1095 | "minimal-lexical", | |
| 1096 | ] | |
| 1097 | ||
| 1098 | [[package]] | |
| 1099 | name = "num-derive" | |
| 1100 | version = "0.4.2" | |
| 1101 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1102 | checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" | |
| 1103 | dependencies = [ | |
| 1104 | "proc-macro2", | |
| 1105 | "quote", | |
| 1106 | "syn 2.0.119", | |
| 1107 | ] | |
| 1108 | ||
| 1109 | [[package]] | |
| 1110 | name = "num-traits" | |
| 1111 | version = "0.2.19" | |
| 1112 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1113 | checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" | |
| 1114 | dependencies = [ | |
| 1115 | "autocfg", | |
| 1116 | "libm", | |
| 1117 | ] | |
| 1118 | ||
| 1119 | [[package]] | |
| 1120 | name = "num_enum" | |
| 1121 | version = "0.7.6" | |
| 1122 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1123 | checksum = "5d0bca838442ec211fa11de3a8b0e0e8f3a4522575b5c4c06ed722e005036f26" | |
| 1124 | dependencies = [ | |
| 1125 | "num_enum_derive", | |
| 1126 | "rustversion", | |
| 1127 | ] | |
| 1128 | ||
| 1129 | [[package]] | |
| 1130 | name = "num_enum_derive" | |
| 1131 | version = "0.7.6" | |
| 1132 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1133 | checksum = "680998035259dcfcafe653688bf2aa6d3e2dc05e98be6ab46afb089dc84f1df8" | |
| 1134 | dependencies = [ | |
| 1135 | "proc-macro-crate", | |
| 1136 | "proc-macro2", | |
| 1137 | "quote", | |
| 1138 | "syn 2.0.119", | |
| 1139 | ] | |
| 1140 | ||
| 1141 | [[package]] | |
| 1142 | name = "objc2" | |
| 1143 | version = "0.6.5" | |
| 1144 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1145 | checksum = "08849bbd4767dfae9457696856ae1c84fe4e0281bbe4a7abff2d0e06fb7981f8" | |
| 1146 | dependencies = [ | |
| 1147 | "objc2-encode", | |
| 1148 | ] | |
| 1149 | ||
| 1150 | [[package]] | |
| 1151 | name = "objc2-core-foundation" | |
| 1152 | version = "0.3.2" | |
| 1153 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1154 | checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" | |
| 1155 | dependencies = [ | |
| 1156 | "bitflags 2.13.2", | |
| 1157 | "dispatch2", | |
| 1158 | "objc2", | |
| 1159 | ] | |
| 1160 | ||
| 1161 | [[package]] | |
| 1162 | name = "objc2-core-graphics" | |
| 1163 | version = "0.3.2" | |
| 1164 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1165 | checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807" | |
| 1166 | dependencies = [ | |
| 1167 | "dispatch2", | |
| 1168 | "objc2", | |
| 1169 | "objc2-core-foundation", | |
| 1170 | "objc2-io-surface", | |
| 1171 | ] | |
| 1172 | ||
| 1173 | [[package]] | |
| 1174 | name = "objc2-encode" | |
| 1175 | version = "4.1.0" | |
| 1176 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1177 | checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" | |
| 1178 | ||
| 1179 | [[package]] | |
| 1180 | name = "objc2-foundation" | |
| 1181 | version = "0.3.2" | |
| 1182 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1183 | checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" | |
| 1184 | dependencies = [ | |
| 1185 | "bitflags 2.13.2", | |
| 1186 | "objc2", | |
| 1187 | "objc2-core-foundation", | |
| 1188 | ] | |
| 1189 | ||
| 1190 | [[package]] | |
| 1191 | name = "objc2-io-surface" | |
| 1192 | version = "0.3.2" | |
| 1193 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1194 | checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d" | |
| 1195 | dependencies = [ | |
| 1196 | "bitflags 2.13.2", | |
| 1197 | "objc2", | |
| 1198 | "objc2-core-foundation", | |
| 1199 | ] | |
| 1200 | ||
| 1201 | [[package]] | |
| 1202 | name = "objc2-metal" | |
| 1203 | version = "0.3.2" | |
| 1204 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1205 | checksum = "a0125f776a10d00af4152d74616409f0d4a2053a6f57fa5b7d6aa2854ac04794" | |
| 1206 | dependencies = [ | |
| 1207 | "bitflags 2.13.2", | |
| 1208 | "block2", | |
| 1209 | "objc2", | |
| 1210 | "objc2-foundation", | |
| 1211 | ] | |
| 1212 | ||
| 1213 | [[package]] | |
| 1214 | name = "objc2-quartz-core" | |
| 1215 | version = "0.3.2" | |
| 1216 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1217 | checksum = "96c1358452b371bf9f104e21ec536d37a650eb10f7ee379fff67d2e08d537f1f" | |
| 1218 | dependencies = [ | |
| 1219 | "bitflags 2.13.2", | |
| 1220 | "objc2", | |
| 1221 | "objc2-core-foundation", | |
| 1222 | "objc2-core-graphics", | |
| 1223 | "objc2-foundation", | |
| 1224 | "objc2-metal", | |
| 1225 | ] | |
| 1226 | ||
| 1227 | [[package]] | |
| 1228 | name = "oboe" | |
| 1229 | version = "0.6.1" | |
| 1230 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1231 | checksum = "e8b61bebd49e5d43f5f8cc7ee2891c16e0f41ec7954d36bcb6c14c5e0de867fb" | |
| 1232 | dependencies = [ | |
| 1233 | "jni", | |
| 1234 | "ndk", | |
| 1235 | "ndk-context", | |
| 1236 | "num-derive", | |
| 1237 | "num-traits", | |
| 1238 | "oboe-sys", | |
| 1239 | ] | |
| 1240 | ||
| 1241 | [[package]] | |
| 1242 | name = "oboe-sys" | |
| 1243 | version = "0.6.1" | |
| 1244 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1245 | checksum = "6c8bb09a4a2b1d668170cfe0a7d5bc103f8999fb316c98099b6a9939c9f2e79d" | |
| 1246 | dependencies = [ | |
| 1247 | "cc", | |
| 1248 | ] | |
| 1249 | ||
| 1250 | [[package]] | |
| 1251 | name = "once_cell" | |
| 1252 | version = "1.21.4" | |
| 1253 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1254 | checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" | |
| 1255 | ||
| 1256 | [[package]] | |
| 1257 | name = "ordered-float" | |
| 1258 | version = "5.5.1" | |
| 1259 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1260 | checksum = "7f59006ce1e204c30956638535b74d317bca99477b9356dfaec54c37f6f600ab" | |
| 1261 | dependencies = [ | |
| 1262 | "num-traits", | |
| 1263 | ] | |
| 1264 | ||
| 1265 | [[package]] | |
| 1266 | name = "parking_lot" | |
| 1267 | version = "0.12.5" | |
| 1268 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1269 | checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" | |
| 1270 | dependencies = [ | |
| 1271 | "lock_api", | |
| 1272 | "parking_lot_core", | |
| 1273 | ] | |
| 1274 | ||
| 1275 | [[package]] | |
| 1276 | name = "parking_lot_core" | |
| 1277 | version = "0.9.12" | |
| 1278 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1279 | checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" | |
| 1280 | dependencies = [ | |
| 1281 | "cfg-if", | |
| 1282 | "libc", | |
| 1283 | "redox_syscall", | |
| 1284 | "smallvec", | |
| 1285 | "windows-link", | |
| 1286 | ] | |
| 1287 | ||
| 1288 | [[package]] | |
| 1289 | name = "pin-project-lite" | |
| 1290 | version = "0.2.18" | |
| 1291 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1292 | checksum = "c938015719552d665fd0553b90d96cd7ff58e83e4c061ca99e6bb78865a72752" | |
| 1293 | ||
| 1294 | [[package]] | |
| 1295 | name = "pkg-config" | |
| 1296 | version = "0.3.34" | |
| 1297 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1298 | checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548" | |
| 1299 | ||
| 1300 | [[package]] | |
| 1301 | name = "png" | |
| 1302 | version = "0.18.1" | |
| 1303 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1304 | checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61" | |
| 1305 | dependencies = [ | |
| 1306 | "bitflags 2.13.2", | |
| 1307 | "crc32fast", | |
| 1308 | "fdeflate", | |
| 1309 | "flate2", | |
| 1310 | "miniz_oxide 0.8.9", | |
| 1311 | ] | |
| 1312 | ||
| 1313 | [[package]] | |
| 1314 | name = "pollster" | |
| 1315 | version = "0.4.0" | |
| 1316 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1317 | checksum = "2f3a9f18d041e6d0e102a0a46750538147e5e8992d3b4873aaafee2520b00ce3" | |
| 1318 | ||
| 1319 | [[package]] | |
| 1320 | name = "portable-atomic" | |
| 1321 | version = "1.15.0" | |
| 1322 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1323 | checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85" | |
| 1324 | ||
| 1325 | [[package]] | |
| 1326 | name = "portable-atomic-util" | |
| 1327 | version = "0.2.8" | |
| 1328 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1329 | checksum = "10ab3eb7f3becc3a1cbc4f2c6f20267996cfc1a6467a873763411b136a122715" | |
| 1330 | dependencies = [ | |
| 1331 | "portable-atomic", | |
| 1332 | ] | |
| 1333 | ||
| 1334 | [[package]] | |
| 1335 | name = "presser" | |
| 1336 | version = "0.3.1" | |
| 1337 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1338 | checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" | |
| 1339 | ||
| 1340 | [[package]] | |
| 1341 | name = "proc-macro-crate" | |
| 1342 | version = "3.5.0" | |
| 1343 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1344 | checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" | |
| 1345 | dependencies = [ | |
| 1346 | "toml_edit", | |
| 1347 | ] | |
| 1348 | ||
| 1349 | [[package]] | |
| 1350 | name = "proc-macro2" | |
| 1351 | version = "1.0.107" | |
| 1352 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1353 | checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" | |
| 1354 | dependencies = [ | |
| 1355 | "unicode-ident", | |
| 1356 | ] | |
| 1357 | ||
| 1358 | [[package]] | |
| 1359 | name = "profiling" | |
| 1360 | version = "1.0.18" | |
| 1361 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1362 | checksum = "3d595e54a326bc53c1c197b32d295e14b169e3cfeaa8dc82b529f947fba6bcf5" | |
| 1363 | ||
| 1364 | [[package]] | |
| 1365 | name = "pxfm" | |
| 1366 | version = "0.1.30" | |
| 1367 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1368 | checksum = "d55d956fa96f5ec02be2e13af0e20391a5aa83d6a074e3ad368959d0fab299ea" | |
| 1369 | ||
| 1370 | [[package]] | |
| 1371 | name = "quick-error" | |
| 1372 | version = "2.0.1" | |
| 1373 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1374 | checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" | |
| 1375 | ||
| 1376 | [[package]] | |
| 1377 | name = "quote" | |
| 1378 | version = "1.0.47" | |
| 1379 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1380 | checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" | |
| 1381 | dependencies = [ | |
| 1382 | "proc-macro2", | |
| 1383 | ] | |
| 1384 | ||
| 1385 | [[package]] | |
| 1386 | name = "r-efi" | |
| 1387 | version = "6.0.0" | |
| 1388 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1389 | checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" | |
| 1390 | ||
| 1391 | [[package]] | |
| 1392 | name = "range-alloc" | |
| 1393 | version = "0.1.5" | |
| 1394 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1395 | checksum = "ca45419789ae5a7899559e9512e58ca889e41f04f1f2445e9f4b290ceccd1d08" | |
| 1396 | ||
| 1397 | [[package]] | |
| 1398 | name = "raw-window-handle" | |
| 1399 | version = "0.6.2" | |
| 1400 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1401 | checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" | |
| 1402 | ||
| 1403 | [[package]] | |
| 1404 | name = "raw-window-metal" | |
| 1405 | version = "1.1.0" | |
| 1406 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1407 | checksum = "40d213455a5f1dc59214213c7330e074ddf8114c9a42411eb890c767357ce135" | |
| 1408 | dependencies = [ | |
| 1409 | "objc2", | |
| 1410 | "objc2-core-foundation", | |
| 1411 | "objc2-foundation", | |
| 1412 | "objc2-quartz-core", | |
| 1413 | ] | |
| 1414 | ||
| 1415 | [[package]] | |
| 1416 | name = "rayon-core" | |
| 1417 | version = "1.13.0" | |
| 1418 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1419 | checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" | |
| 1420 | dependencies = [ | |
| 1421 | "crossbeam-deque", | |
| 1422 | "crossbeam-utils", | |
| 1423 | ] | |
| 1424 | ||
| 1425 | [[package]] | |
| 1426 | name = "redox_syscall" | |
| 1427 | version = "0.5.18" | |
| 1428 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1429 | checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" | |
| 1430 | dependencies = [ | |
| 1431 | "bitflags 2.13.2", | |
| 1432 | ] | |
| 1433 | ||
| 1434 | [[package]] | |
| 1435 | name = "regex" | |
| 1436 | version = "1.13.2" | |
| 1437 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1438 | checksum = "9807af0e638c12e753aa1b4e601791bf2a8f71274023c8bbeec12fc149950857" | |
| 1439 | dependencies = [ | |
| 1440 | "aho-corasick", | |
| 1441 | "memchr", | |
| 1442 | "regex-automata", | |
| 1443 | "regex-syntax", | |
| 1444 | ] | |
| 1445 | ||
| 1446 | [[package]] | |
| 1447 | name = "regex-automata" | |
| 1448 | version = "0.4.19" | |
| 1449 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1450 | checksum = "41d60ef07df457506a0a1a2073112eb4aae5733dbd2813c3da77d1b0fd441158" | |
| 1451 | dependencies = [ | |
| 1452 | "aho-corasick", | |
| 1453 | "memchr", | |
| 1454 | "regex-syntax", | |
| 1455 | ] | |
| 1456 | ||
| 1457 | [[package]] | |
| 1458 | name = "regex-syntax" | |
| 1459 | version = "0.8.12" | |
| 1460 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1461 | checksum = "d902046e6a28a1e4c3cab97258a0ce11e994903f01c2d97a9447a0b3df85f4f6" | |
| 1462 | ||
| 1463 | [[package]] | |
| 1464 | name = "renderdoc-sys" | |
| 1465 | version = "1.1.0" | |
| 1466 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1467 | checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" | |
| 1468 | ||
| 1469 | [[package]] | |
| 1470 | name = "rustc-hash" | |
| 1471 | version = "1.1.0" | |
| 1472 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1473 | checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" | |
| 1474 | ||
| 1475 | [[package]] | |
| 1476 | name = "rustc-hash" | |
| 1477 | version = "2.1.3" | |
| 1478 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1479 | checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" | |
| 1480 | ||
| 1481 | [[package]] | |
| 1482 | name = "rustix" | |
| 1483 | version = "1.1.6" | |
| 1484 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1485 | checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa" | |
| 1486 | dependencies = [ | |
| 1487 | "bitflags 2.13.2", | |
| 1488 | "errno", | |
| 1489 | "libc", | |
| 1490 | "linux-raw-sys", | |
| 1491 | "windows-sys 0.61.2", | |
| 1492 | ] | |
| 1493 | ||
| 1494 | [[package]] | |
| 1495 | name = "rustversion" | |
| 1496 | version = "1.0.23" | |
| 1497 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1498 | checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" | |
| 1499 | ||
| 1500 | [[package]] | |
| 1501 | name = "rustybuzz" | |
| 1502 | version = "0.20.1" | |
| 1503 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1504 | checksum = "fd3c7c96f8a08ee34eff8857b11b49b07d71d1c3f4e88f8a88d4c9e9f90b1702" | |
| 1505 | dependencies = [ | |
| 1506 | "bitflags 2.13.2", | |
| 1507 | "bytemuck", | |
| 1508 | "core_maths", | |
| 1509 | "log", | |
| 1510 | "smallvec", | |
| 1511 | "ttf-parser", | |
| 1512 | "unicode-bidi-mirroring", | |
| 1513 | "unicode-ccc", | |
| 1514 | "unicode-properties", | |
| 1515 | "unicode-script", | |
| 1516 | ] | |
| 1517 | ||
| 1518 | [[package]] | |
| 1519 | name = "same-file" | |
| 1520 | version = "1.0.6" | |
| 1521 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1522 | checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" | |
| 1523 | dependencies = [ | |
| 1524 | "winapi-util", | |
| 1525 | ] | |
| 1526 | ||
| 1527 | [[package]] | |
| 1528 | name = "scopeguard" | |
| 1529 | version = "1.2.0" | |
| 1530 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1531 | checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" | |
| 1532 | ||
| 1533 | [[package]] | |
| 1534 | name = "serde" | |
| 1535 | version = "1.0.229" | |
| 1536 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1537 | checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" | |
| 1538 | dependencies = [ | |
| 1539 | "serde_core", | |
| 1540 | "serde_derive", | |
| 1541 | ] | |
| 1542 | ||
| 1543 | [[package]] | |
| 1544 | name = "serde_core" | |
| 1545 | version = "1.0.229" | |
| 1546 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1547 | checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" | |
| 1548 | dependencies = [ | |
| 1549 | "serde_derive", | |
| 1550 | ] | |
| 1551 | ||
| 1552 | [[package]] | |
| 1553 | name = "serde_derive" | |
| 1554 | version = "1.0.229" | |
| 1555 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1556 | checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" | |
| 1557 | dependencies = [ | |
| 1558 | "proc-macro2", | |
| 1559 | "quote", | |
| 1560 | "syn 3.0.10", | |
| 1561 | ] | |
| 1562 | ||
| 1563 | [[package]] | |
| 1564 | name = "serde_json" | |
| 1565 | version = "1.0.154" | |
| 1566 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1567 | checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6" | |
| 1568 | dependencies = [ | |
| 1569 | "itoa", | |
| 1570 | "memchr", | |
| 1571 | "serde", | |
| 1572 | "serde_core", | |
| 1573 | "zmij", | |
| 1574 | ] | |
| 1575 | ||
| 1576 | [[package]] | |
| 1577 | name = "shlex" | |
| 1578 | version = "1.3.0" | |
| 1579 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1580 | checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" | |
| 1581 | ||
| 1582 | [[package]] | |
| 1583 | name = "shlex" | |
| 1584 | version = "2.0.1" | |
| 1585 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1586 | checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" | |
| 1587 | ||
| 1588 | [[package]] | |
| 1589 | name = "simd-adler32" | |
| 1590 | version = "0.3.10" | |
| 1591 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1592 | checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea" | |
| 1593 | ||
| 1594 | [[package]] | |
| 1595 | name = "simdutf8" | |
| 1596 | version = "0.1.5" | |
| 1597 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1598 | checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" | |
| 1599 | ||
| 1600 | [[package]] | |
| 1601 | name = "slab" | |
| 1602 | version = "0.4.12" | |
| 1603 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1604 | checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" | |
| 1605 | ||
| 1606 | [[package]] | |
| 1607 | name = "slotmap" | |
| 1608 | version = "1.1.1" | |
| 1609 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1610 | checksum = "bdd58c3c93c3d278ca835519292445cb4b0d4dc59ccfdf7ceadaab3f8aeb4038" | |
| 1611 | dependencies = [ | |
| 1612 | "version_check", | |
| 1613 | ] | |
| 1614 | ||
| 1615 | [[package]] | |
| 1616 | name = "smallvec" | |
| 1617 | version = "1.16.6" | |
| 1618 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1619 | checksum = "3244542535d5de959d90ec55d1b5ff0fd2bb7b1310223907d5f11932847f7b59" | |
| 1620 | ||
| 1621 | [[package]] | |
| 1622 | name = "spirv" | |
| 1623 | version = "0.4.0+sdk-1.4.341.0" | |
| 1624 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1625 | checksum = "d9571ea910ebd84c86af4b3ed27f9dbdc6ad06f17c5f96146b2b671e2976744f" | |
| 1626 | dependencies = [ | |
| 1627 | "bitflags 2.13.2", | |
| 1628 | ] | |
| 1629 | ||
| 1630 | [[package]] | |
| 1631 | name = "static_assertions" | |
| 1632 | version = "1.1.0" | |
| 1633 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1634 | checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" | |
| 1635 | ||
| 1636 | [[package]] | |
| 1637 | name = "symphonia" | |
| 1638 | version = "0.5.5" | |
| 1639 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1640 | checksum = "5773a4c030a19d9bfaa090f49746ff35c75dfddfa700df7a5939d5e076a57039" | |
| 1641 | dependencies = [ | |
| 1642 | "lazy_static", | |
| 1643 | "symphonia-bundle-flac", | |
| 1644 | "symphonia-bundle-mp3", | |
| 1645 | "symphonia-codec-aac", | |
| 1646 | "symphonia-codec-pcm", | |
| 1647 | "symphonia-core", | |
| 1648 | "symphonia-format-isomp4", | |
| 1649 | "symphonia-format-ogg", | |
| 1650 | "symphonia-format-riff", | |
| 1651 | "symphonia-metadata", | |
| 1652 | ] | |
| 1653 | ||
| 1654 | [[package]] | |
| 1655 | name = "symphonia-bundle-flac" | |
| 1656 | version = "0.5.5" | |
| 1657 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1658 | checksum = "c91565e180aea25d9b80a910c546802526ffd0072d0b8974e3ebe59b686c9976" | |
| 1659 | dependencies = [ | |
| 1660 | "log", | |
| 1661 | "symphonia-core", | |
| 1662 | "symphonia-metadata", | |
| 1663 | "symphonia-utils-xiph", | |
| 1664 | ] | |
| 1665 | ||
| 1666 | [[package]] | |
| 1667 | name = "symphonia-bundle-mp3" | |
| 1668 | version = "0.5.5" | |
| 1669 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1670 | checksum = "4872dd6bb56bf5eac799e3e957aa1981086c3e613b27e0ac23b176054f7c57ed" | |
| 1671 | dependencies = [ | |
| 1672 | "lazy_static", | |
| 1673 | "log", | |
| 1674 | "symphonia-core", | |
| 1675 | "symphonia-metadata", | |
| 1676 | ] | |
| 1677 | ||
| 1678 | [[package]] | |
| 1679 | name = "symphonia-codec-aac" | |
| 1680 | version = "0.5.5" | |
| 1681 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1682 | checksum = "4c263845aa86881416849c1729a54c7f55164f8b96111dba59de46849e73a790" | |
| 1683 | dependencies = [ | |
| 1684 | "lazy_static", | |
| 1685 | "log", | |
| 1686 | "symphonia-core", | |
| 1687 | ] | |
| 1688 | ||
| 1689 | [[package]] | |
| 1690 | name = "symphonia-codec-pcm" | |
| 1691 | version = "0.5.5" | |
| 1692 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1693 | checksum = "4e89d716c01541ad3ebe7c91ce4c8d38a7cf266a3f7b2f090b108fb0cb031d95" | |
| 1694 | dependencies = [ | |
| 1695 | "log", | |
| 1696 | "symphonia-core", | |
| 1697 | ] | |
| 1698 | ||
| 1699 | [[package]] | |
| 1700 | name = "symphonia-core" | |
| 1701 | version = "0.5.5" | |
| 1702 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1703 | checksum = "ea00cc4f79b7f6bb7ff87eddc065a1066f3a43fe1875979056672c9ef948c2af" | |
| 1704 | dependencies = [ | |
| 1705 | "arrayvec", | |
| 1706 | "bitflags 1.3.2", | |
| 1707 | "bytemuck", | |
| 1708 | "lazy_static", | |
| 1709 | "log", | |
| 1710 | ] | |
| 1711 | ||
| 1712 | [[package]] | |
| 1713 | name = "symphonia-format-isomp4" | |
| 1714 | version = "0.5.5" | |
| 1715 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1716 | checksum = "243739585d11f81daf8dac8d9f3d18cc7898f6c09a259675fc364b382c30e0a5" | |
| 1717 | dependencies = [ | |
| 1718 | "encoding_rs", | |
| 1719 | "log", | |
| 1720 | "symphonia-core", | |
| 1721 | "symphonia-metadata", | |
| 1722 | "symphonia-utils-xiph", | |
| 1723 | ] | |
| 1724 | ||
| 1725 | [[package]] | |
| 1726 | name = "symphonia-format-ogg" | |
| 1727 | version = "0.5.5" | |
| 1728 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1729 | checksum = "2b4955c67c1ed3aa8ae8428d04ca8397fbef6a19b2b051e73b5da8b1435639cb" | |
| 1730 | dependencies = [ | |
| 1731 | "log", | |
| 1732 | "symphonia-core", | |
| 1733 | "symphonia-metadata", | |
| 1734 | "symphonia-utils-xiph", | |
| 1735 | ] | |
| 1736 | ||
| 1737 | [[package]] | |
| 1738 | name = "symphonia-format-riff" | |
| 1739 | version = "0.5.5" | |
| 1740 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1741 | checksum = "c2d7c3df0e7d94efb68401d81906eae73c02b40d5ec1a141962c592d0f11a96f" | |
| 1742 | dependencies = [ | |
| 1743 | "extended", | |
| 1744 | "log", | |
| 1745 | "symphonia-core", | |
| 1746 | "symphonia-metadata", | |
| 1747 | ] | |
| 1748 | ||
| 1749 | [[package]] | |
| 1750 | name = "symphonia-metadata" | |
| 1751 | version = "0.5.5" | |
| 1752 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1753 | checksum = "36306ff42b9ffe6e5afc99d49e121e0bd62fe79b9db7b9681d48e29fa19e6b16" | |
| 1754 | dependencies = [ | |
| 1755 | "encoding_rs", | |
| 1756 | "lazy_static", | |
| 1757 | "log", | |
| 1758 | "symphonia-core", | |
| 1759 | ] | |
| 1760 | ||
| 1761 | [[package]] | |
| 1762 | name = "symphonia-utils-xiph" | |
| 1763 | version = "0.5.5" | |
| 1764 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1765 | checksum = "ee27c85ab799a338446b68eec77abf42e1a6f1bb490656e121c6e27bfbab9f16" | |
| 1766 | dependencies = [ | |
| 1767 | "symphonia-core", | |
| 1768 | "symphonia-metadata", | |
| 1769 | ] | |
| 1770 | ||
| 1771 | [[package]] | |
| 1772 | name = "syn" | |
| 1773 | version = "2.0.119" | |
| 1774 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1775 | checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" | |
| 1776 | dependencies = [ | |
| 1777 | "proc-macro2", | |
| 1778 | "quote", | |
| 1779 | "unicode-ident", | |
| 1780 | ] | |
| 1781 | ||
| 1782 | [[package]] | |
| 1783 | name = "syn" | |
| 1784 | version = "3.0.10" | |
| 1785 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1786 | checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79" | |
| 1787 | dependencies = [ | |
| 1788 | "proc-macro2", | |
| 1789 | "quote", | |
| 1790 | "unicode-ident", | |
| 1791 | ] | |
| 1792 | ||
| 1793 | [[package]] | |
| 1794 | name = "target-features" | |
| 1795 | version = "0.1.6" | |
| 1796 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1797 | checksum = "c1bbb9f3c5c463a01705937a24fdabc5047929ac764b2d5b9cf681c1f5041ed5" | |
| 1798 | ||
| 1799 | [[package]] | |
| 1800 | name = "termcolor" | |
| 1801 | version = "1.4.1" | |
| 1802 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1803 | checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" | |
| 1804 | dependencies = [ | |
| 1805 | "winapi-util", | |
| 1806 | ] | |
| 1807 | ||
| 1808 | [[package]] | |
| 1809 | name = "thiserror" | |
| 1810 | version = "1.0.69" | |
| 1811 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1812 | checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" | |
| 1813 | dependencies = [ | |
| 1814 | "thiserror-impl 1.0.69", | |
| 1815 | ] | |
| 1816 | ||
| 1817 | [[package]] | |
| 1818 | name = "thiserror" | |
| 1819 | version = "2.0.21" | |
| 1820 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1821 | checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e" | |
| 1822 | dependencies = [ | |
| 1823 | "thiserror-impl 2.0.21", | |
| 1824 | ] | |
| 1825 | ||
| 1826 | [[package]] | |
| 1827 | name = "thiserror-impl" | |
| 1828 | version = "1.0.69" | |
| 1829 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1830 | checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" | |
| 1831 | dependencies = [ | |
| 1832 | "proc-macro2", | |
| 1833 | "quote", | |
| 1834 | "syn 2.0.119", | |
| 1835 | ] | |
| 1836 | ||
| 1837 | [[package]] | |
| 1838 | name = "thiserror-impl" | |
| 1839 | version = "2.0.21" | |
| 1840 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1841 | checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524" | |
| 1842 | dependencies = [ | |
| 1843 | "proc-macro2", | |
| 1844 | "quote", | |
| 1845 | "syn 3.0.10", | |
| 1846 | ] | |
| 1847 | ||
| 1848 | [[package]] | |
| 1849 | name = "tiff" | |
| 1850 | version = "0.11.3" | |
| 1851 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1852 | checksum = "b63feaf3343d35b6ca4d50483f94843803b0f51634937cc2ec519fc32232bc52" | |
| 1853 | dependencies = [ | |
| 1854 | "fax", | |
| 1855 | "flate2", | |
| 1856 | "half", | |
| 1857 | "quick-error", | |
| 1858 | "weezl", | |
| 1859 | "zune-jpeg", | |
| 1860 | ] | |
| 1861 | ||
| 1862 | [[package]] | |
| 1863 | name = "tinyvec" | |
| 1864 | version = "1.13.3" | |
| 1865 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1866 | checksum = "fd3ca314f692efd6c868f8408f53fe444634a845f96c028b97d35f6a1f79f0ee" | |
| 1867 | ||
| 1868 | [[package]] | |
| 1869 | name = "toml_datetime" | |
| 1870 | version = "1.1.3+spec-1.1.0" | |
| 1871 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1872 | checksum = "173f25c883cd2176a2d8212155638c0a60d484a9d84546d270866f40f56b6e49" | |
| 1873 | dependencies = [ | |
| 1874 | "serde_core", | |
| 1875 | ] | |
| 1876 | ||
| 1877 | [[package]] | |
| 1878 | name = "toml_edit" | |
| 1879 | version = "0.25.21+spec-1.1.0" | |
| 1880 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1881 | checksum = "88497dab46de5bf343ec66b05c251e48c6213f3e9170c70a70a823f7abe886a4" | |
| 1882 | dependencies = [ | |
| 1883 | "indexmap", | |
| 1884 | "toml_datetime", | |
| 1885 | "toml_parser", | |
| 1886 | "winnow", | |
| 1887 | ] | |
| 1888 | ||
| 1889 | [[package]] | |
| 1890 | name = "toml_parser" | |
| 1891 | version = "1.1.7+spec-1.1.0" | |
| 1892 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1893 | checksum = "0bb28d6e049a9766c3bd91a8326e6179f5b132dec87906bb97018ef7a2f3431a" | |
| 1894 | dependencies = [ | |
| 1895 | "winnow", | |
| 1896 | ] | |
| 1897 | ||
| 1898 | [[package]] | |
| 1899 | name = "ttf-parser" | |
| 1900 | version = "0.25.1" | |
| 1901 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1902 | checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31" | |
| 1903 | dependencies = [ | |
| 1904 | "core_maths", | |
| 1905 | ] | |
| 1906 | ||
| 1907 | [[package]] | |
| 1908 | name = "unicode-bidi-mirroring" | |
| 1909 | version = "0.4.0" | |
| 1910 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1911 | checksum = "5dfa6e8c60bb66d49db113e0125ee8711b7647b5579dc7f5f19c42357ed039fe" | |
| 1912 | ||
| 1913 | [[package]] | |
| 1914 | name = "unicode-ccc" | |
| 1915 | version = "0.4.0" | |
| 1916 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1917 | checksum = "ce61d488bcdc9bc8b5d1772c404828b17fc481c0a582b5581e95fb233aef503e" | |
| 1918 | ||
| 1919 | [[package]] | |
| 1920 | name = "unicode-ident" | |
| 1921 | version = "1.0.27" | |
| 1922 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1923 | checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563" | |
| 1924 | ||
| 1925 | [[package]] | |
| 1926 | name = "unicode-properties" | |
| 1927 | version = "0.1.5" | |
| 1928 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1929 | checksum = "993ad287eb20e8ba755312801cfe1413e0f25d604075863acaddca10b04c1833" | |
| 1930 | ||
| 1931 | [[package]] | |
| 1932 | name = "unicode-script" | |
| 1933 | version = "0.5.9" | |
| 1934 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1935 | checksum = "aa04c955db05429d464c74d495c1ee677e1866e783a4c3747f9c0cef7756cabf" | |
| 1936 | ||
| 1937 | [[package]] | |
| 1938 | name = "unicode-width" | |
| 1939 | version = "0.2.3" | |
| 1940 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1941 | checksum = "ca718471876992059f251e33aafc334346ada08042b7661dd1fe313a9bced557" | |
| 1942 | ||
| 1943 | [[package]] | |
| 1944 | name = "version_check" | |
| 1945 | version = "0.9.5" | |
| 1946 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1947 | checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" | |
| 1948 | ||
| 1949 | [[package]] | |
| 1950 | name = "walkdir" | |
| 1951 | version = "2.5.1" | |
| 1952 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1953 | checksum = "b42e295b7452c4604982280d8586001fcad9b8b201cac67bca9771e7a7475403" | |
| 1954 | dependencies = [ | |
| 1955 | "same-file", | |
| 1956 | "winapi-util", | |
| 1957 | ] | |
| 1958 | ||
| 1959 | [[package]] | |
| 1960 | name = "wasm-bindgen" | |
| 1961 | version = "0.2.128" | |
| 1962 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1963 | checksum = "aecb87a33d3b0c5e3b7aa46336eaf486cffafbd281b195e4c8b80d50df2351bf" | |
| 1964 | dependencies = [ | |
| 1965 | "cfg-if", | |
| 1966 | "once_cell", | |
| 1967 | "rustversion", | |
| 1968 | "wasm-bindgen-macro", | |
| 1969 | "wasm-bindgen-shared", | |
| 1970 | ] | |
| 1971 | ||
| 1972 | [[package]] | |
| 1973 | name = "wasm-bindgen-futures" | |
| 1974 | version = "0.4.78" | |
| 1975 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1976 | checksum = "6ef4c5d3d2cdf5c54f4231181768f5510842e350db025faf1f7163b1030ed928" | |
| 1977 | dependencies = [ | |
| 1978 | "js-sys", | |
| 1979 | "wasm-bindgen", | |
| 1980 | ] | |
| 1981 | ||
| 1982 | [[package]] | |
| 1983 | name = "wasm-bindgen-macro" | |
| 1984 | version = "0.2.128" | |
| 1985 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1986 | checksum = "a690d511e3c1a8b3a55e33511e3c2c00c78415cd23650f32b808627f5696b9ed" | |
| 1987 | dependencies = [ | |
| 1988 | "quote", | |
| 1989 | "wasm-bindgen-macro-support", | |
| 1990 | ] | |
| 1991 | ||
| 1992 | [[package]] | |
| 1993 | name = "wasm-bindgen-macro-support" | |
| 1994 | version = "0.2.128" | |
| 1995 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 1996 | checksum = "411e4887f0071ef2d2164a9d5fdf2d20efbef78fccd3a78b0c10a1dc5295e48a" | |
| 1997 | dependencies = [ | |
| 1998 | "bumpalo", | |
| 1999 | "proc-macro2", | |
| 2000 | "quote", | |
| 2001 | "syn 3.0.10", | |
| 2002 | "wasm-bindgen-shared", | |
| 2003 | ] | |
| 2004 | ||
| 2005 | [[package]] | |
| 2006 | name = "wasm-bindgen-shared" | |
| 2007 | version = "0.2.128" | |
| 2008 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2009 | checksum = "81941cd78d0c92026c33e5e01312845a4cb1e9af3407f9134b100dd03144103e" | |
| 2010 | dependencies = [ | |
| 2011 | "unicode-ident", | |
| 2012 | ] | |
| 2013 | ||
| 2014 | [[package]] | |
| 2015 | name = "wayland-sys" | |
| 2016 | version = "0.31.11" | |
| 2017 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2018 | checksum = "d8eab23fefc9e41f8e841df4a9c707e8a8c4ed26e944ef69297184de2785e3be" | |
| 2019 | dependencies = [ | |
| 2020 | "dlib", | |
| 2021 | "log", | |
| 2022 | "once_cell", | |
| 2023 | "pkg-config", | |
| 2024 | ] | |
| 2025 | ||
| 2026 | [[package]] | |
| 2027 | name = "web-sys" | |
| 2028 | version = "0.3.105" | |
| 2029 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2030 | checksum = "9fbddc4a036f00ec4f18c83445bd3115cb306a91da554919a099d9222fe4a7f8" | |
| 2031 | dependencies = [ | |
| 2032 | "js-sys", | |
| 2033 | "wasm-bindgen", | |
| 2034 | ] | |
| 2035 | ||
| 2036 | [[package]] | |
| 2037 | name = "web-time" | |
| 2038 | version = "1.1.0" | |
| 2039 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2040 | checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" | |
| 2041 | dependencies = [ | |
| 2042 | "js-sys", | |
| 2043 | "wasm-bindgen", | |
| 2044 | ] | |
| 2045 | ||
| 2046 | [[package]] | |
| 2047 | name = "weezl" | |
| 2048 | version = "0.1.12" | |
| 2049 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2050 | checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88" | |
| 2051 | ||
| 2052 | [[package]] | |
| 2053 | name = "wgpu" | |
| 2054 | version = "30.0.2" | |
| 2055 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2056 | checksum = "146fc3d654250e6207921a66c87534c621bc886c70df83dcf466c1d66813810e" | |
| 2057 | dependencies = [ | |
| 2058 | "arrayvec", | |
| 2059 | "bitflags 2.13.2", | |
| 2060 | "bytemuck", | |
| 2061 | "cfg-if", | |
| 2062 | "cfg_aliases", | |
| 2063 | "document-features", | |
| 2064 | "hashbrown 0.17.2", | |
| 2065 | "js-sys", | |
| 2066 | "log", | |
| 2067 | "naga", | |
| 2068 | "parking_lot", | |
| 2069 | "portable-atomic", | |
| 2070 | "profiling", | |
| 2071 | "raw-window-handle", | |
| 2072 | "smallvec", | |
| 2073 | "static_assertions", | |
| 2074 | "wasm-bindgen", | |
| 2075 | "wasm-bindgen-futures", | |
| 2076 | "web-sys", | |
| 2077 | "wgpu-core", | |
| 2078 | "wgpu-hal", | |
| 2079 | "wgpu-types", | |
| 2080 | ] | |
| 2081 | ||
| 2082 | [[package]] | |
| 2083 | name = "wgpu-core" | |
| 2084 | version = "30.0.2" | |
| 2085 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2086 | checksum = "ad661da2ee99f208c30090b585284b2ab5b8bf2358ddf2d2215592808ec62f1a" | |
| 2087 | dependencies = [ | |
| 2088 | "arrayvec", | |
| 2089 | "bit-set", | |
| 2090 | "bit-vec", | |
| 2091 | "bitflags 2.13.2", | |
| 2092 | "bytemuck", | |
| 2093 | "cfg_aliases", | |
| 2094 | "document-features", | |
| 2095 | "hashbrown 0.17.2", | |
| 2096 | "indexmap", | |
| 2097 | "log", | |
| 2098 | "naga", | |
| 2099 | "naga-types", | |
| 2100 | "once_cell", | |
| 2101 | "parking_lot", | |
| 2102 | "portable-atomic", | |
| 2103 | "profiling", | |
| 2104 | "raw-window-handle", | |
| 2105 | "rustc-hash 1.1.0", | |
| 2106 | "smallvec", | |
| 2107 | "thiserror 2.0.21", | |
| 2108 | "wgpu-core-deps-apple", | |
| 2109 | "wgpu-core-deps-emscripten", | |
| 2110 | "wgpu-core-deps-windows-linux-android", | |
| 2111 | "wgpu-hal", | |
| 2112 | "wgpu-naga-bridge", | |
| 2113 | "wgpu-types", | |
| 2114 | ] | |
| 2115 | ||
| 2116 | [[package]] | |
| 2117 | name = "wgpu-core-deps-apple" | |
| 2118 | version = "30.0.2" | |
| 2119 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2120 | checksum = "7d3f2f24aee039ffe9ef527300daf6b7428c58edeefdaa1700f4fa0fd754df16" | |
| 2121 | dependencies = [ | |
| 2122 | "wgpu-hal", | |
| 2123 | ] | |
| 2124 | ||
| 2125 | [[package]] | |
| 2126 | name = "wgpu-core-deps-emscripten" | |
| 2127 | version = "30.0.2" | |
| 2128 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2129 | checksum = "55ccf093bd215ae9dc4f96df293e675513ac1f2569f8293a2911cc34ca3505d1" | |
| 2130 | dependencies = [ | |
| 2131 | "wgpu-hal", | |
| 2132 | ] | |
| 2133 | ||
| 2134 | [[package]] | |
| 2135 | name = "wgpu-core-deps-windows-linux-android" | |
| 2136 | version = "30.0.2" | |
| 2137 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2138 | checksum = "1331b08fa2362c5d454eccc4448e6e4f01eccfea569a00e310adbfc4415f2bdc" | |
| 2139 | dependencies = [ | |
| 2140 | "wgpu-hal", | |
| 2141 | ] | |
| 2142 | ||
| 2143 | [[package]] | |
| 2144 | name = "wgpu-hal" | |
| 2145 | version = "30.0.2" | |
| 2146 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2147 | checksum = "a57452fe453658e141aafdb09de1028afa498805fab518238ddf372a518813ff" | |
| 2148 | dependencies = [ | |
| 2149 | "android_system_properties", | |
| 2150 | "arrayvec", | |
| 2151 | "ash", | |
| 2152 | "bit-set", | |
| 2153 | "bitflags 2.13.2", | |
| 2154 | "block2", | |
| 2155 | "bytemuck", | |
| 2156 | "cfg-if", | |
| 2157 | "cfg_aliases", | |
| 2158 | "glow", | |
| 2159 | "glutin_wgl_sys", | |
| 2160 | "gpu-allocator", | |
| 2161 | "hashbrown 0.17.2", | |
| 2162 | "js-sys", | |
| 2163 | "khronos-egl", | |
| 2164 | "libc", | |
| 2165 | "libloading", | |
| 2166 | "log", | |
| 2167 | "naga", | |
| 2168 | "naga-types", | |
| 2169 | "ndk-sys 0.6.0+11769913", | |
| 2170 | "objc2", | |
| 2171 | "objc2-core-foundation", | |
| 2172 | "objc2-core-graphics", | |
| 2173 | "objc2-foundation", | |
| 2174 | "objc2-metal", | |
| 2175 | "objc2-quartz-core", | |
| 2176 | "once_cell", | |
| 2177 | "ordered-float", | |
| 2178 | "parking_lot", | |
| 2179 | "portable-atomic", | |
| 2180 | "portable-atomic-util", | |
| 2181 | "profiling", | |
| 2182 | "range-alloc", | |
| 2183 | "raw-window-handle", | |
| 2184 | "raw-window-metal", | |
| 2185 | "renderdoc-sys", | |
| 2186 | "smallvec", | |
| 2187 | "static_assertions", | |
| 2188 | "thiserror 2.0.21", | |
| 2189 | "wasm-bindgen", | |
| 2190 | "wayland-sys", | |
| 2191 | "web-sys", | |
| 2192 | "wgpu-naga-bridge", | |
| 2193 | "wgpu-types", | |
| 2194 | "windows 0.62.2", | |
| 2195 | "windows-core 0.62.2", | |
| 2196 | "windows-result 0.4.1", | |
| 2197 | ] | |
| 2198 | ||
| 2199 | [[package]] | |
| 2200 | name = "wgpu-naga-bridge" | |
| 2201 | version = "30.0.2" | |
| 2202 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2203 | checksum = "44a62ead68aad7cd40ac9e2cd2b8ec64f32dfbad2765f429b9fb74b8b735869f" | |
| 2204 | dependencies = [ | |
| 2205 | "naga", | |
| 2206 | "wgpu-types", | |
| 2207 | ] | |
| 2208 | ||
| 2209 | [[package]] | |
| 2210 | name = "wgpu-types" | |
| 2211 | version = "30.0.2" | |
| 2212 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2213 | checksum = "a9f6ee0bd50f5ab79fb8c25e3f33afb27126f034af4ba5909c7a0967058659e6" | |
| 2214 | dependencies = [ | |
| 2215 | "bitflags 2.13.2", | |
| 2216 | "bytemuck", | |
| 2217 | "js-sys", | |
| 2218 | "log", | |
| 2219 | "naga-types", | |
| 2220 | "raw-window-handle", | |
| 2221 | "static_assertions", | |
| 2222 | "web-sys", | |
| 2223 | ] | |
| 2224 | ||
| 2225 | [[package]] | |
| 2226 | name = "which" | |
| 2227 | version = "7.0.3" | |
| 2228 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2229 | checksum = "24d643ce3fd3e5b54854602a080f34fb10ab75e0b813ee32d00ca2b44fa74762" | |
| 2230 | dependencies = [ | |
| 2231 | "either", | |
| 2232 | "env_home", | |
| 2233 | "rustix", | |
| 2234 | "winsafe", | |
| 2235 | ] | |
| 2236 | ||
| 2237 | [[package]] | |
| 2238 | name = "winapi-util" | |
| 2239 | version = "0.1.11" | |
| 2240 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2241 | checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" | |
| 2242 | dependencies = [ | |
| 2243 | "windows-sys 0.61.2", | |
| 2244 | ] | |
| 2245 | ||
| 2246 | [[package]] | |
| 2247 | name = "windows" | |
| 2248 | version = "0.54.0" | |
| 2249 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2250 | checksum = "9252e5725dbed82865af151df558e754e4a3c2c30818359eb17465f1346a1b49" | |
| 2251 | dependencies = [ | |
| 2252 | "windows-core 0.54.0", | |
| 2253 | "windows-targets 0.52.6", | |
| 2254 | ] | |
| 2255 | ||
| 2256 | [[package]] | |
| 2257 | name = "windows" | |
| 2258 | version = "0.62.2" | |
| 2259 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2260 | checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580" | |
| 2261 | dependencies = [ | |
| 2262 | "windows-collections", | |
| 2263 | "windows-core 0.62.2", | |
| 2264 | "windows-future", | |
| 2265 | "windows-numerics", | |
| 2266 | ] | |
| 2267 | ||
| 2268 | [[package]] | |
| 2269 | name = "windows-collections" | |
| 2270 | version = "0.3.2" | |
| 2271 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2272 | checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610" | |
| 2273 | dependencies = [ | |
| 2274 | "windows-core 0.62.2", | |
| 2275 | ] | |
| 2276 | ||
| 2277 | [[package]] | |
| 2278 | name = "windows-core" | |
| 2279 | version = "0.54.0" | |
| 2280 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2281 | checksum = "12661b9c89351d684a50a8a643ce5f608e20243b9fb84687800163429f161d65" | |
| 2282 | dependencies = [ | |
| 2283 | "windows-result 0.1.2", | |
| 2284 | "windows-targets 0.52.6", | |
| 2285 | ] | |
| 2286 | ||
| 2287 | [[package]] | |
| 2288 | name = "windows-core" | |
| 2289 | version = "0.62.2" | |
| 2290 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2291 | checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" | |
| 2292 | dependencies = [ | |
| 2293 | "windows-implement", | |
| 2294 | "windows-interface", | |
| 2295 | "windows-link", | |
| 2296 | "windows-result 0.4.1", | |
| 2297 | "windows-strings", | |
| 2298 | ] | |
| 2299 | ||
| 2300 | [[package]] | |
| 2301 | name = "windows-future" | |
| 2302 | version = "0.3.2" | |
| 2303 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2304 | checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb" | |
| 2305 | dependencies = [ | |
| 2306 | "windows-core 0.62.2", | |
| 2307 | "windows-link", | |
| 2308 | "windows-threading", | |
| 2309 | ] | |
| 2310 | ||
| 2311 | [[package]] | |
| 2312 | name = "windows-implement" | |
| 2313 | version = "0.60.2" | |
| 2314 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2315 | checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" | |
| 2316 | dependencies = [ | |
| 2317 | "proc-macro2", | |
| 2318 | "quote", | |
| 2319 | "syn 2.0.119", | |
| 2320 | ] | |
| 2321 | ||
| 2322 | [[package]] | |
| 2323 | name = "windows-interface" | |
| 2324 | version = "0.59.3" | |
| 2325 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2326 | checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" | |
| 2327 | dependencies = [ | |
| 2328 | "proc-macro2", | |
| 2329 | "quote", | |
| 2330 | "syn 2.0.119", | |
| 2331 | ] | |
| 2332 | ||
| 2333 | [[package]] | |
| 2334 | name = "windows-link" | |
| 2335 | version = "0.2.1" | |
| 2336 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2337 | checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" | |
| 2338 | ||
| 2339 | [[package]] | |
| 2340 | name = "windows-numerics" | |
| 2341 | version = "0.3.1" | |
| 2342 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2343 | checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26" | |
| 2344 | dependencies = [ | |
| 2345 | "windows-core 0.62.2", | |
| 2346 | "windows-link", | |
| 2347 | ] | |
| 2348 | ||
| 2349 | [[package]] | |
| 2350 | name = "windows-result" | |
| 2351 | version = "0.1.2" | |
| 2352 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2353 | checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" | |
| 2354 | dependencies = [ | |
| 2355 | "windows-targets 0.52.6", | |
| 2356 | ] | |
| 2357 | ||
| 2358 | [[package]] | |
| 2359 | name = "windows-result" | |
| 2360 | version = "0.4.1" | |
| 2361 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2362 | checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" | |
| 2363 | dependencies = [ | |
| 2364 | "windows-link", | |
| 2365 | ] | |
| 2366 | ||
| 2367 | [[package]] | |
| 2368 | name = "windows-strings" | |
| 2369 | version = "0.5.1" | |
| 2370 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2371 | checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" | |
| 2372 | dependencies = [ | |
| 2373 | "windows-link", | |
| 2374 | ] | |
| 2375 | ||
| 2376 | [[package]] | |
| 2377 | name = "windows-sys" | |
| 2378 | version = "0.45.0" | |
| 2379 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2380 | checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" | |
| 2381 | dependencies = [ | |
| 2382 | "windows-targets 0.42.2", | |
| 2383 | ] | |
| 2384 | ||
| 2385 | [[package]] | |
| 2386 | name = "windows-sys" | |
| 2387 | version = "0.61.2" | |
| 2388 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2389 | checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" | |
| 2390 | dependencies = [ | |
| 2391 | "windows-link", | |
| 2392 | ] | |
| 2393 | ||
| 2394 | [[package]] | |
| 2395 | name = "windows-targets" | |
| 2396 | version = "0.42.2" | |
| 2397 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2398 | checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" | |
| 2399 | dependencies = [ | |
| 2400 | "windows_aarch64_gnullvm 0.42.2", | |
| 2401 | "windows_aarch64_msvc 0.42.2", | |
| 2402 | "windows_i686_gnu 0.42.2", | |
| 2403 | "windows_i686_msvc 0.42.2", | |
| 2404 | "windows_x86_64_gnu 0.42.2", | |
| 2405 | "windows_x86_64_gnullvm 0.42.2", | |
| 2406 | "windows_x86_64_msvc 0.42.2", | |
| 2407 | ] | |
| 2408 | ||
| 2409 | [[package]] | |
| 2410 | name = "windows-targets" | |
| 2411 | version = "0.52.6" | |
| 2412 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2413 | checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" | |
| 2414 | dependencies = [ | |
| 2415 | "windows_aarch64_gnullvm 0.52.6", | |
| 2416 | "windows_aarch64_msvc 0.52.6", | |
| 2417 | "windows_i686_gnu 0.52.6", | |
| 2418 | "windows_i686_gnullvm", | |
| 2419 | "windows_i686_msvc 0.52.6", | |
| 2420 | "windows_x86_64_gnu 0.52.6", | |
| 2421 | "windows_x86_64_gnullvm 0.52.6", | |
| 2422 | "windows_x86_64_msvc 0.52.6", | |
| 2423 | ] | |
| 2424 | ||
| 2425 | [[package]] | |
| 2426 | name = "windows-threading" | |
| 2427 | version = "0.2.1" | |
| 2428 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2429 | checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37" | |
| 2430 | dependencies = [ | |
| 2431 | "windows-link", | |
| 2432 | ] | |
| 2433 | ||
| 2434 | [[package]] | |
| 2435 | name = "windows_aarch64_gnullvm" | |
| 2436 | version = "0.42.2" | |
| 2437 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2438 | checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" | |
| 2439 | ||
| 2440 | [[package]] | |
| 2441 | name = "windows_aarch64_gnullvm" | |
| 2442 | version = "0.52.6" | |
| 2443 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2444 | checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" | |
| 2445 | ||
| 2446 | [[package]] | |
| 2447 | name = "windows_aarch64_msvc" | |
| 2448 | version = "0.42.2" | |
| 2449 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2450 | checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" | |
| 2451 | ||
| 2452 | [[package]] | |
| 2453 | name = "windows_aarch64_msvc" | |
| 2454 | version = "0.52.6" | |
| 2455 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2456 | checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" | |
| 2457 | ||
| 2458 | [[package]] | |
| 2459 | name = "windows_i686_gnu" | |
| 2460 | version = "0.42.2" | |
| 2461 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2462 | checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" | |
| 2463 | ||
| 2464 | [[package]] | |
| 2465 | name = "windows_i686_gnu" | |
| 2466 | version = "0.52.6" | |
| 2467 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2468 | checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" | |
| 2469 | ||
| 2470 | [[package]] | |
| 2471 | name = "windows_i686_gnullvm" | |
| 2472 | version = "0.52.6" | |
| 2473 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2474 | checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" | |
| 2475 | ||
| 2476 | [[package]] | |
| 2477 | name = "windows_i686_msvc" | |
| 2478 | version = "0.42.2" | |
| 2479 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2480 | checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" | |
| 2481 | ||
| 2482 | [[package]] | |
| 2483 | name = "windows_i686_msvc" | |
| 2484 | version = "0.52.6" | |
| 2485 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2486 | checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" | |
| 2487 | ||
| 2488 | [[package]] | |
| 2489 | name = "windows_x86_64_gnu" | |
| 2490 | version = "0.42.2" | |
| 2491 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2492 | checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" | |
| 2493 | ||
| 2494 | [[package]] | |
| 2495 | name = "windows_x86_64_gnu" | |
| 2496 | version = "0.52.6" | |
| 2497 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2498 | checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" | |
| 2499 | ||
| 2500 | [[package]] | |
| 2501 | name = "windows_x86_64_gnullvm" | |
| 2502 | version = "0.42.2" | |
| 2503 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2504 | checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" | |
| 2505 | ||
| 2506 | [[package]] | |
| 2507 | name = "windows_x86_64_gnullvm" | |
| 2508 | version = "0.52.6" | |
| 2509 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2510 | checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" | |
| 2511 | ||
| 2512 | [[package]] | |
| 2513 | name = "windows_x86_64_msvc" | |
| 2514 | version = "0.42.2" | |
| 2515 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2516 | checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" | |
| 2517 | ||
| 2518 | [[package]] | |
| 2519 | name = "windows_x86_64_msvc" | |
| 2520 | version = "0.52.6" | |
| 2521 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2522 | checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" | |
| 2523 | ||
| 2524 | [[package]] | |
| 2525 | name = "winnow" | |
| 2526 | version = "1.0.5" | |
| 2527 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2528 | checksum = "8c3b93199df0ab874cdf0c6a94f0a0dc3423fe41f1cafb62b8bd7b1deb277aef" | |
| 2529 | dependencies = [ | |
| 2530 | "memchr", | |
| 2531 | ] | |
| 2532 | ||
| 2533 | [[package]] | |
| 2534 | name = "winsafe" | |
| 2535 | version = "0.0.19" | |
| 2536 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2537 | checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" | |
| 2538 | ||
| 2539 | [[package]] | |
| 2540 | name = "xml-rs" | |
| 2541 | version = "0.8.29" | |
| 2542 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2543 | checksum = "e450f9b2ed1dff33c94c12589a87338689467b9c4f5d8a5710bd09a847d2c8a7" | |
| 2544 | ||
| 2545 | [[package]] | |
| 2546 | name = "zeno" | |
| 2547 | version = "0.3.3" | |
| 2548 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2549 | checksum = "6df3dc4292935e51816d896edcd52aa30bc297907c26167fec31e2b0c6a32524" | |
| 2550 | ||
| 2551 | [[package]] | |
| 2552 | name = "zerocopy" | |
| 2553 | version = "0.8.66" | |
| 2554 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2555 | checksum = "cba8a86aee14fc8cc6c208af60854b3d4ab7185a9a369a12c648faa2716ff42a" | |
| 2556 | dependencies = [ | |
| 2557 | "zerocopy-derive", | |
| 2558 | ] | |
| 2559 | ||
| 2560 | [[package]] | |
| 2561 | name = "zerocopy-derive" | |
| 2562 | version = "0.8.66" | |
| 2563 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2564 | checksum = "f89bca3b96ceb3cfcb4572790402f977442270d252b9a8504ebc258760c55f94" | |
| 2565 | dependencies = [ | |
| 2566 | "proc-macro2", | |
| 2567 | "quote", | |
| 2568 | "syn 2.0.119", | |
| 2569 | ] | |
| 2570 | ||
| 2571 | [[package]] | |
| 2572 | name = "zlib-rs" | |
| 2573 | version = "0.6.9" | |
| 2574 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2575 | checksum = "aa76918995d776d9dd34d371030be228d021137449771493d56e29f77e4148ac" | |
| 2576 | ||
| 2577 | [[package]] | |
| 2578 | name = "zmij" | |
| 2579 | version = "1.0.23" | |
| 2580 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2581 | checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" | |
| 2582 | ||
| 2583 | [[package]] | |
| 2584 | name = "zune-core" | |
| 2585 | version = "0.5.4" | |
| 2586 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2587 | checksum = "c1a65ee146f41cb456b005bc898af3ab1495ded4ee61ac3637103f40ccacac18" | |
| 2588 | ||
| 2589 | [[package]] | |
| 2590 | name = "zune-inflate" | |
| 2591 | version = "0.2.54" | |
| 2592 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2593 | checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" | |
| 2594 | dependencies = [ | |
| 2595 | "simd-adler32", | |
| 2596 | ] | |
| 2597 | ||
| 2598 | [[package]] | |
| 2599 | name = "zune-jpeg" | |
| 2600 | version = "0.5.15" | |
| 2601 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
| 2602 | checksum = "27bc9d5b815bc103f142aa054f561d9187d191692ec7c2d1e2b4737f8dbd7296" | |
| 2603 | dependencies = [ | |
| 2604 | "zune-core", | |
| 2605 | ] |
crates/web/Cargo.toml created+27| ... | ... | @@ -0,0 +1,27 @@ |
| 1 | [package] | |
| 2 | name = "fission-web" | |
| 3 | version = "0.1.0" | |
| 4 | edition = "2024" | |
| 5 | publish = false | |
| 6 | ||
| 7 | # Standalone workspace: the native workspace never builds this crate. | |
| 8 | [workspace] | |
| 9 | ||
| 10 | [lib] | |
| 11 | crate-type = ["cdylib"] | |
| 12 | ||
| 13 | [dependencies] | |
| 14 | engine = { path = "../engine" } | |
| 15 | model = { path = "../model" } | |
| 16 | console_error_panic_hook = "0.1" | |
| 17 | js-sys = "0.3" | |
| 18 | serde_json = "1" | |
| 19 | wasm-bindgen = "=0.2.128" | |
| 20 | wasm-bindgen-futures = "0.4" | |
| 21 | web-sys = { version = "0.3", features = ["HtmlCanvasElement"] } | |
| 22 | wgpu = "30.0.1" | |
| 23 | ||
| 24 | [profile.release] | |
| 25 | opt-level = "s" | |
| 26 | lto = true | |
| 27 | codegen-units = 1 |
crates/web/README.md created+44| ... | ... | @@ -0,0 +1,44 @@ |
| 1 | # Fission on the web | |
| 2 | ||
| 3 | Evaluates Fusion `.comp` files with the native `engine` on WebGPU and presents the chosen node to a canvas. | |
| 4 | Standalone crate (`[workspace]` in its own manifest): the native workspace never builds it. | |
| 5 | ||
| 6 | ## Build | |
| 7 | ||
| 8 | ```sh | |
| 9 | rustup target add wasm32-unknown-unknown | |
| 10 | cargo install wasm-bindgen-cli --version 0.2.128 # must match the `=0.2.128` pin in Cargo.toml | |
| 11 | crates/web/build.sh # -> crates/web/dist/{index.html,pkg/} | |
| 12 | python3 -m http.server -d crates/web/dist 8080 # any static host works | |
| 13 | ``` | |
| 14 | ||
| 15 | `OUT=/tmp/fission-web-dist PROFILE=release crates/web/build.sh` redirects the output. Needs a browser with WebGPU. | |
| 16 | ||
| 17 | ## Use | |
| 18 | ||
| 19 | - **Demo** loads the built-in `demo.comp` (3D simplex `FastNoise`, `Displace`, `TextPlus`, `Merge`, `Glow`, `ColorCorrector`, animated splines and expressions). | |
| 20 | - **Open .comp…**, **Open folder…** or drop a `.comp` / project folder on the page. Images in the folder are registered | |
| 21 | with `MediaCache::insert_virtual_bytes`; a `Loader` path (even `C:\shots\plate.0001.png`) resolves to the file sharing | |
| 22 | the longest run of trailing path components. Missing media is listed under the node list. | |
| 23 | - Transport: Play/Pause (Space), scrubber, ←/→ step. The dropdown, the Flow graph and the node list all pick the viewed node. | |
| 24 | ||
| 25 | ## Native vs. wasm differences | |
| 26 | ||
| 27 | | Area | wasm32 | | |
| 28 | | --- | --- | | |
| 29 | | Expressions | pure-Rust Lua-subset evaluator (`model::expr`); no statement bodies or method calls | | |
| 30 | | Audio, export, RAM prefetch thread | compiled out | | |
| 31 | | Video loaders | unavailable (no ffmpeg / AVFoundation) | | |
| 32 | | EXR, fonts | not from virtual files / no system fonts (see below) | | |
| 33 | ||
| 34 | ## Needs changes outside this crate's claim | |
| 35 | ||
| 36 | The browser cannot render until these land; each is verified by building a patched scratch copy and running it in Chrome (WebGPU, Metal). | |
| 37 | ||
| 38 | 1. **`std::time::Instant::now()` panics on `wasm32-unknown-unknown`.** `engine/src/eval/mod.rs:11` and `eval/dispatch.rs:4` | |
| 39 | `use std::time::Instant;` must become `use web_time::Instant;` (`web-time` is already a wasm32 dependency of `engine`; | |
| 40 | gate it with `cfg(target_arch = "wasm32")` or add it for all targets, where it re-exports `std`). | |
| 41 | 2. **No fonts**: `text_engine::database()` only loads system fonts, so `TextPlus` renders empty in the browser. | |
| 42 | It needs a hook to register font bytes (`fontdb::Database::load_font_data`). | |
| 43 | 3. **EXR from virtual files**: `media/exr.rs::decode_exr_rgba` opens a `File`; it needs a bytes entry point. | |
| 44 | 4. `eval/io.rs::probe_clip_dims` still reads dimensions from the filesystem for missing media (cosmetic). |
crates/web/build.sh created+13| ... | ... | @@ -0,0 +1,13 @@ |
| 1 | #!/usr/bin/env bash | |
| 2 | # Builds the browser app into crates/web/dist (override with OUT=...), ready to serve statically. | |
| 3 | # needs: rustup target add wasm32-unknown-unknown; wasm-bindgen-cli 0.2.128 (cargo install wasm-bindgen-cli --version 0.2.128) | |
| 4 | set -euo pipefail | |
| 5 | cd "$(dirname "$0")" | |
| 6 | out="${OUT:-dist}" | |
| 7 | profile="${PROFILE:-release}" | |
| 8 | ||
| 9 | cargo build --target wasm32-unknown-unknown --profile "$profile" | |
| 10 | rm -rf "$out" && mkdir -p "$out" | |
| 11 | wasm-bindgen --target web --no-typescript --out-dir "$out/pkg" "target/wasm32-unknown-unknown/$profile/fission_web.wasm" | |
| 12 | cp index.html "$out/" | |
| 13 | echo "built $out/ -- serve with: python3 -m http.server -d $out 8080" |
crates/web/demo.comp created+127| ... | ... | @@ -0,0 +1,127 @@ |
| 1 | Composition { | |
| 2 | 	CurrentTime = 0, | |
| 3 | 	RenderRange = { 0, 149 }, | |
| 4 | 	GlobalRange = { 0, 149 }, | |
| 5 | 	Tools = ordered() { | |
| 6 | 		NoiseSeethe = BezierSpline { | |
| 7 | 			SplineColor = { Red = 90, Green = 200, Blue = 255 }, | |
| 8 | 			KeyFrames = { | |
| 9 | 				[0] = { 0, Flags = { Linear = true } }, | |
| 10 | 				[149] = { 14, Flags = { Linear = true } }, | |
| 11 | 			}, | |
| 12 | 		}, | |
| 13 | 		WarpAmount = BezierSpline { | |
| 14 | 			SplineColor = { Red = 255, Green = 120, Blue = 60 }, | |
| 15 | 			KeyFrames = { | |
| 16 | 				[0] = { 0, RH = { 25, 0.1 } }, | |
| 17 | 				[75] = { 0.3, LH = { 50, 0.2 }, RH = { 100, 0.2 } }, | |
| 18 | 				[149] = { 0, LH = { 125, 0.1 } }, | |
| 19 | 			}, | |
| 20 | 		}, | |
| 21 | 		GlowSize = BezierSpline { | |
| 22 | 			SplineColor = { Red = 255, Green = 220, Blue = 120 }, | |
| 23 | 			KeyFrames = { | |
| 24 | 				[0] = { 2, Flags = { Linear = true } }, | |
| 25 | 				[75] = { 12, Flags = { Linear = true } }, | |
| 26 | 				[149] = { 2, Flags = { Linear = true } }, | |
| 27 | 			}, | |
| 28 | 		}, | |
| 29 | 		Noise = FastNoise { | |
| 30 | 			Inputs = { | |
| 31 | 				Width = Input { Value = 960, }, | |
| 32 | 				Height = Input { Value = 540, }, | |
| 33 | 				Detail = Input { Value = 4, }, | |
| 34 | 				XScale = Input { Value = 3, }, | |
| 35 | 				YScale = Input { Value = 3, }, | |
| 36 | 				Seethe = Input { SourceOp = "NoiseSeethe", Source = "Value", }, | |
| 37 | 				Color1Red = Input { Value = 0, }, | |
| 38 | 				Color1Green = Input { Value = 0.04, }, | |
| 39 | 				Color1Blue = Input { Value = 0.22, }, | |
| 40 | 				Color1Alpha = Input { Value = 1, }, | |
| 41 | 				Color2Red = Input { Value = 0.1, }, | |
| 42 | 				Color2Green = Input { Value = 0.9, }, | |
| 43 | 				Color2Blue = Input { Value = 1, }, | |
| 44 | 				Color2Alpha = Input { Value = 1, }, | |
| 45 | 			}, | |
| 46 | 			ViewInfo = OperatorInfo { Pos = { 0, 0 } }, | |
| 47 | 		}, | |
| 48 | 		Warm = FastNoise { | |
| 49 | 			Inputs = { | |
| 50 | 				Width = Input { Value = 960, }, | |
| 51 | 				Height = Input { Value = 540, }, | |
| 52 | 				Detail = Input { Value = 3, }, | |
| 53 | 				XScale = Input { Value = 1.6, }, | |
| 54 | 				YScale = Input { Value = 1.6, }, | |
| 55 | 				Seethe = Input { Value = 3, Expression = "time * 0.15 + floor(time / 5) * 2", }, | |
| 56 | 				Color1Red = Input { Value = 0.3, }, | |
| 57 | 				Color1Green = Input { Value = 0.02, }, | |
| 58 | 				Color1Blue = Input { Value = 0.12, }, | |
| 59 | 				Color1Alpha = Input { Value = 1, }, | |
| 60 | 				Color2Red = Input { Value = 1, }, | |
| 61 | 				Color2Green = Input { Value = 0.62, }, | |
| 62 | 				Color2Blue = Input { Value = 0.2, }, | |
| 63 | 				Color2Alpha = Input { Value = 1, }, | |
| 64 | 			}, | |
| 65 | 			ViewInfo = OperatorInfo { Pos = { 0, 80 } }, | |
| 66 | 		}, | |
| 67 | 		Warp = Displace { | |
| 68 | 			Inputs = { | |
| 69 | 				Type = Input { Value = 1, }, | |
| 70 | 				XRefraction = Input { SourceOp = "WarpAmount", Source = "Value", }, | |
| 71 | 				YRefraction = Input { SourceOp = "WarpAmount", Source = "Value", }, | |
| 72 | 				Input = Input { SourceOp = "Warm", Source = "Output", }, | |
| 73 | 				Foreground = Input { SourceOp = "Noise", Source = "Output", }, | |
| 74 | 			}, | |
| 75 | 			ViewInfo = OperatorInfo { Pos = { 150, 40 } }, | |
| 76 | 		}, | |
| 77 | 		Title = TextPlus { | |
| 78 | 			Inputs = { | |
| 79 | 				Width = Input { Value = 960, }, | |
| 80 | 				Height = Input { Value = 540, }, | |
| 81 | 				StyledText = Input { Value = "FISSION", }, | |
| 82 | 				Font = Input { Value = "Helvetica Neue", }, | |
| 83 | 				Style = Input { Value = "Bold", }, | |
| 84 | 				Size = Input { Value = 0.2, Expression = "0.2 + 0.015 * sin(time * 0.15)", }, | |
| 85 | 				Center = Input { Value = { 0.5, 0.5 }, }, | |
| 86 | 			}, | |
| 87 | 			ViewInfo = OperatorInfo { Pos = { 150, 120 } }, | |
| 88 | 		}, | |
| 89 | 		Mix = Merge { | |
| 90 | 			Inputs = { | |
| 91 | 				Background = Input { SourceOp = "Noise", Source = "Output", }, | |
| 92 | 				Foreground = Input { SourceOp = "Warp", Source = "Output", }, | |
| 93 | 				Blend = Input { Value = 0.6, }, | |
| 94 | 			}, | |
| 95 | 			ViewInfo = OperatorInfo { Pos = { 300, 0 } }, | |
| 96 | 		}, | |
| 97 | 		Merge1 = Merge { | |
| 98 | 			Inputs = { | |
| 99 | 				Background = Input { SourceOp = "Mix", Source = "Output", }, | |
| 100 | 				Foreground = Input { SourceOp = "Title", Source = "Output", }, | |
| 101 | 			}, | |
| 102 | 			ViewInfo = OperatorInfo { Pos = { 300, 80 } }, | |
| 103 | 		}, | |
| 104 | 		Glow1 = Glow { | |
| 105 | 			Inputs = { | |
| 106 | 				Input = Input { SourceOp = "Merge1", Source = "Output", }, | |
| 107 | 				XGlowSize = Input { SourceOp = "GlowSize", Source = "Value", }, | |
| 108 | 				Glow = Input { Value = 0.4, }, | |
| 109 | 			}, | |
| 110 | 			ViewInfo = OperatorInfo { Pos = { 450, 80 } }, | |
| 111 | 		}, | |
| 112 | 		Grade = ColorCorrector { | |
| 113 | 			Inputs = { | |
| 114 | 				Input = Input { SourceOp = "Glow1", Source = "Output", }, | |
| 115 | 				WheelSaturation1 = Input { Value = 1.7, }, | |
| 116 | 				MasterRGBGain = Input { Value = 1, }, | |
| 117 | 				MasterRGBGamma = Input { Value = 1.1, }, | |
| 118 | 			}, | |
| 119 | 			ViewInfo = OperatorInfo { Pos = { 600, 80 } }, | |
| 120 | 		}, | |
| 121 | 	}, | |
| 122 | 	Prefs = { | |
| 123 | 		Comp = { | |
| 124 | 			FrameFormat = { Width = 960, Height = 540, Rate = 30, }, | |
| 125 | 		}, | |
| 126 | 	}, | |
| 127 | } |
crates/web/index.html created+288| ... | ... | @@ -0,0 +1,288 @@ |
| 1 | <!doctype html> | |
| 2 | <html lang="en"> | |
| 3 | <head> | |
| 4 | <meta charset="utf-8"> | |
| 5 | <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| 6 | <title>Fission</title> | |
| 7 | <style> | |
| 8 | :root { color-scheme: dark; --bg: #141416; --panel: #1c1c20; --line: #2c2c33; --fg: #e6e6ea; --dim: #8b8b96; --accent: #7aa2ff; --warn: #ffb454; --bad: #ff6b6b; } | |
| 9 | * { box-sizing: border-box; } | |
| 10 | body { margin: 0; height: 100vh; display: grid; grid-template: "bar bar" auto "stage side" 1fr / 1fr 340px; background: var(--bg); color: var(--fg); font: 13px/1.4 system-ui, sans-serif; } | |
| 11 | button, select { font: inherit; color: inherit; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; } | |
| 12 | button:hover:not(:disabled) { border-color: var(--accent); cursor: pointer; } | |
| 13 | button:disabled { opacity: .45; } | |
| 14 | header { grid-area: bar; display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); } | |
| 15 | header h1 { font-size: 14px; margin: 0 8px 0 0; letter-spacing: .08em; } | |
| 16 | #status { margin-left: auto; color: var(--dim); font-variant-numeric: tabular-nums; } | |
| 17 | #banner { grid-column: 1 / -1; display: none; padding: 10px 14px; background: #3a1d1d; color: #ffd0d0; border-bottom: 1px solid #6a2c2c; } | |
| 18 | main { grid-area: stage; display: flex; flex-direction: column; min-height: 0; padding: 12px; gap: 10px; } | |
| 19 | #stage { flex: 1; min-height: 0; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 8px; position: relative; overflow: hidden; } | |
| 20 | #stage.drop { border-color: var(--accent); background: #1a2036; } | |
| 21 | canvas { max-width: 100%; max-height: 100%; background: #000; } | |
| 22 | #hint { position: absolute; color: var(--dim); pointer-events: none; text-align: center; } | |
| 23 | #transport { display: flex; gap: 10px; align-items: center; } | |
| 24 | #scrub { flex: 1; accent-color: var(--accent); } | |
| 25 | #frame { min-width: 110px; font-variant-numeric: tabular-nums; } | |
| 26 | aside { grid-area: side; border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; } | |
| 27 | aside h2 { margin: 0; padding: 8px 12px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); } | |
| 28 | #flow { width: 100%; height: 240px; background: var(--panel); border-block: 1px solid var(--line); } | |
| 29 | #flow .edge { fill: none; stroke-width: 1.5; opacity: .8; } | |
| 30 | #flow g.node { cursor: pointer; } | |
| 31 | #flow rect { fill: #262630; stroke: var(--line); } | |
| 32 | #flow g.node:hover rect { stroke: var(--accent); } | |
| 33 | #flow g.sel rect { stroke: var(--accent); stroke-width: 2; } | |
| 34 | #flow g.bypassed rect { stroke-dasharray: 3 2; opacity: .6; } | |
| 35 | #flow text { fill: var(--fg); font-size: 10px; pointer-events: none; } | |
| 36 | #nodes { flex: 1; overflow: auto; margin: 0; padding: 0; list-style: none; } | |
| 37 | #nodes li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 12px; cursor: pointer; border-bottom: 1px solid var(--line); } | |
| 38 | #nodes li:hover { background: var(--panel); } | |
| 39 | #nodes li.sel { background: #212a44; } | |
| 40 | #nodes .kind { color: var(--dim); } | |
| 41 | #nodes .missing { color: var(--bad); } | |
| 42 | #notes { padding: 8px 12px; color: var(--warn); font-size: 12px; border-top: 1px solid var(--line); } | |
| 43 | #notes:empty { display: none; } | |
| 44 | input[type=file] { display: none; } | |
| 45 | </style> | |
| 46 | </head> | |
| 47 | <body> | |
| 48 | <header> | |
| 49 | <h1>FISSION</h1> | |
| 50 | <button id="demo">Demo</button> | |
| 51 | <button id="open-comp">Open .comp…</button> | |
| 52 | <button id="open-folder">Open folder…</button> | |
| 53 | <select id="comps" hidden title="Compositions in the folder"></select> | |
| 54 | <span id="status"></span> | |
| 55 | </header> | |
| 56 | <div id="banner" role="alert"></div> | |
| 57 | <main> | |
| 58 | <div id="stage"> | |
| 59 | <canvas id="canvas" width="960" height="540"></canvas> | |
| 60 | <div id="hint">Drop a <b>.comp</b> or a project folder here</div> | |
| 61 | </div> | |
| 62 | <div id="transport"> | |
| 63 | <button id="play" disabled>Play</button> | |
| 64 | <input id="scrub" type="range" min="0" max="0" value="0" step="1" disabled> | |
| 65 | <span id="frame">–</span> | |
| 66 | <select id="node" disabled title="Node to view"></select> | |
| 67 | </div> | |
| 68 | </main> | |
| 69 | <aside> | |
| 70 | <h2>Flow</h2> | |
| 71 | <svg id="flow" viewBox="0 0 340 240" role="img" aria-label="Flow graph"></svg> | |
| 72 | <h2>Nodes</h2> | |
| 73 | <ul id="nodes"></ul> | |
| 74 | <div id="notes"></div> | |
| 75 | </aside> | |
| 76 | <input id="file-comp" type="file" accept=".comp,.setting,.txt,image/*" multiple> | |
| 77 | <input id="file-folder" type="file" webkitdirectory multiple> | |
| 78 | <script type="module"> | |
| 79 | import init, { Fission } from './pkg/fission_web.js'; | |
| 80 | ||
| 81 | const $ = (id) => document.getElementById(id); | |
| 82 | const MEDIA_EXT = /\.(png|jpe?g|tiff?|webp|bmp|gif|exr|tga)$/i; | |
| 83 | const MAX_FILE_BYTES = 256 * 1024 * 1024; | |
| 84 | const PORT_COLOR = { Background: '#e6b450', Input: '#e6b450', Foreground: '#6fcf97', EffectMask: '#7aa2ff' }; | |
| 85 | ||
| 86 | const fail = (message) => { $('banner').textContent = message; $('banner').style.display = 'block'; }; | |
| 87 | ||
| 88 | let app = null; | |
| 89 | let info = null; | |
| 90 | let sources = new Map(); | |
| 91 | let frame = 0, playing = false, playStart = 0, playOrigin = 0, lastDrawn = null; | |
| 92 | let dirty = true, fps = 0, lastTick = 0, evalMs = 0, broken = false; | |
| 93 | ||
| 94 | async function boot() { | |
| 95 | if (!navigator.gpu) { | |
| 96 | fail('This browser has no WebGPU. Use a current Chrome, Edge or Safari, or enable WebGPU in Firefox.'); | |
| 97 | return; | |
| 98 | } | |
| 99 | try { | |
| 100 | await init(); | |
| 101 | app = await Fission.create($('canvas')); | |
| 102 | } catch (e) { | |
| 103 | fail(`Could not start the renderer: ${e.message ?? e}`); | |
| 104 | return; | |
| 105 | } | |
| 106 | loadComp('Demo', Fission.demo_comp()); | |
| 107 | requestAnimationFrame(tick); | |
| 108 | } | |
| 109 | ||
| 110 | function loadComp(name, text) { | |
| 111 | if (broken) return; | |
| 112 | try { | |
| 113 | info = JSON.parse(app.load_comp(text, name)); | |
| 114 | } catch (e) { | |
| 115 | fail(`${name}: ${e.message ?? e}`); | |
| 116 | return; | |
| 117 | } | |
| 118 | $('banner').style.display = 'none'; | |
| 119 | $('hint').hidden = true; | |
| 120 | const [start, end] = info.range; | |
| 121 | frame = start; playing = false; lastDrawn = null; dirty = true; | |
| 122 | $('scrub').min = start; $('scrub').max = end; $('scrub').value = start; | |
| 123 | for (const id of ['play', 'scrub', 'node']) $(id).disabled = false; | |
| 124 | $('play').textContent = 'Play'; | |
| 125 | $('node').replaceChildren(...info.nodes.map((n) => new Option(`${n.name} (${n.kind})`, n.id))); | |
| 126 | $('node').value = info.target ?? info.nodes[0]?.id; | |
| 127 | refreshGraph(); | |
| 128 | } | |
| 129 | ||
| 130 | function refreshGraph() { | |
| 131 | info = JSON.parse(app.describe()); | |
| 132 | drawFlow(); | |
| 133 | const ul = $('nodes'); | |
| 134 | ul.replaceChildren(...info.nodes.map((n) => { | |
| 135 | const li = document.createElement('li'); | |
| 136 | li.dataset.id = n.id; | |
| 137 | li.classList.toggle('sel', n.id === info.target); | |
| 138 | const miss = n.clips.filter((c) => !c.found).length; | |
| 139 | li.innerHTML = `<span>${esc(n.name)}${miss ? ` <span class="missing">${miss} missing</span>` : ''}</span><span class="kind">${esc(n.kind)}</span>`; | |
| 140 | li.onclick = () => selectNode(n.id); | |
| 141 | return li; | |
| 142 | })); | |
| 143 | const missing = info.nodes.flatMap((n) => n.clips.filter((c) => !c.found).map((c) => c.file.split(/[\\/]/).pop())); | |
| 144 | $('notes').textContent = missing.length ? `Missing media: ${[...new Set(missing)].join(', ')}. Drop the project folder to supply it.` : ''; | |
| 145 | } | |
| 146 | ||
| 147 | function selectNode(id) { | |
| 148 | app.set_node(id); | |
| 149 | info.target = id; | |
| 150 | $('node').value = id; | |
| 151 | dirty = true; | |
| 152 | for (const li of $('nodes').children) li.classList.toggle('sel', Number(li.dataset.id) === id); | |
| 153 | drawFlow(); | |
| 154 | } | |
| 155 | ||
| 156 | function drawFlow() { | |
| 157 | const svg = $('flow'); | |
| 158 | const [W, H, PAD, BW, BH] = [340, 240, 14, 56, 20]; | |
| 159 | const xs = info.nodes.map((n) => n.pos[0]), ys = info.nodes.map((n) => n.pos[1]); | |
| 160 | const [x0, y0] = [Math.min(...xs), Math.min(...ys)]; | |
| 161 | const sx = (W - 2 * PAD - BW) / (Math.max(...xs) - x0 || 1), sy = (H - 2 * PAD - BH) / (Math.max(...ys) - y0 || 1); | |
| 162 | const at = new Map(info.nodes.map((n) => [n.name, [PAD + (n.pos[0] - x0) * Math.min(sx, 1.2), PAD + (n.pos[1] - y0) * Math.min(sy, 1.2)]])); | |
| 163 | let out = ''; | |
| 164 | for (const n of info.nodes) for (const [port, src] of n.from) { | |
| 165 | const a = at.get(src), b = at.get(n.name); | |
| 166 | if (!a || !b) continue; | |
| 167 | const [ax, ay, bx, by] = [a[0] + BW, a[1] + BH / 2, b[0], b[1] + BH / 2]; | |
| 168 | const mx = (ax + bx) / 2; | |
| 169 | out += `<path class="edge" stroke="${PORT_COLOR[port] ?? '#8b8b96'}" d="M${ax},${ay} C${mx},${ay} ${mx},${by} ${bx},${by}"/>`; | |
| 170 | } | |
| 171 | for (const n of info.nodes) { | |
| 172 | const [x, y] = at.get(n.name); | |
| 173 | const cls = ['node', n.id === info.target ? 'sel' : '', n.bypassed ? 'bypassed' : ''].join(' '); | |
| 174 | out += `<g class="${cls}" data-id="${n.id}"><rect x="${x}" y="${y}" width="${BW}" height="${BH}" rx="4"/><text x="${x + 5}" y="${y + 13}">${esc(n.name.slice(0, 11))}</text></g>`; | |
| 175 | } | |
| 176 | svg.innerHTML = out; | |
| 177 | svg.querySelectorAll('g.node').forEach((g) => { g.onclick = () => selectNode(Number(g.dataset.id)); }); | |
| 178 | } | |
| 179 | ||
| 180 | const esc = (s) => s.replace(/[&<>"]/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' })[c]); | |
| 181 | ||
| 182 | function tick(now) { | |
| 183 | requestAnimationFrame(tick); | |
| 184 | if (!info || broken) return; | |
| 185 | const [start, end] = info.range; | |
| 186 | if (playing) { | |
| 187 | const len = end - start + 1; | |
| 188 | frame = start + (playOrigin - start + Math.floor(((now - playStart) / 1000) * info.fps)) % len; | |
| 189 | $('scrub').value = frame; | |
| 190 | } | |
| 191 | if (dirty || frame !== lastDrawn) { | |
| 192 | try { | |
| 193 | evalMs = app.render(frame); | |
| 194 | } catch (e) { | |
| 195 | broken = true; | |
| 196 | fail(`Render failed: ${e.message ?? e}. Reload the page; details are in the console.`); | |
| 197 | return; | |
| 198 | } | |
| 199 | if (lastTick) fps += ((1000 / (now - lastTick)) - fps) * 0.15; | |
| 200 | lastTick = now; | |
| 201 | lastDrawn = frame; dirty = false; | |
| 202 | const bad = app.unsupported(); | |
| 203 | $('notes').dataset.unsupported = bad.join(', '); | |
| 204 | } else if (!playing) { | |
| 205 | lastTick = 0; | |
| 206 | } | |
| 207 | const unsupported = $('notes').dataset.unsupported; | |
| 208 | $('frame').textContent = `f ${frame} / ${end}`; | |
| 209 | $('status').textContent = `${info.name} · ${info.width}×${info.height} · ${info.fps} fps · ${playing ? fps.toFixed(0) + ' fps · ' : ''}${evalMs.toFixed(1)} ms cpu${unsupported ? ' · unsupported: ' + unsupported : ''}`; | |
| 210 | } | |
| 211 | ||
| 212 | function setPlaying(on) { | |
| 213 | playing = on; | |
| 214 | $('play').textContent = on ? 'Pause' : 'Play'; | |
| 215 | playStart = performance.now(); playOrigin = frame; lastTick = 0; | |
| 216 | } | |
| 217 | ||
| 218 | $('play').onclick = () => setPlaying(!playing); | |
| 219 | $('scrub').oninput = (e) => { frame = Number(e.target.value); if (playing) setPlaying(true); dirty = true; }; | |
| 220 | $('node').onchange = (e) => selectNode(Number(e.target.value)); | |
| 221 | $('demo').onclick = () => { app.clear_files(); sources.clear(); $('comps').hidden = true; loadComp('Demo', Fission.demo_comp()); }; | |
| 222 | $('open-comp').onclick = () => $('file-comp').click(); | |
| 223 | $('open-folder').onclick = () => $('file-folder').click(); | |
| 224 | $('comps').onchange = (e) => { const f = sources.get(e.target.value); if (f) f.text().then((t) => loadComp(e.target.value.replace(/\.comp$/i, ''), t)); }; | |
| 225 | addEventListener('keydown', (e) => { | |
| 226 | if (e.target.matches('select, input[type=range]') || !info) return; | |
| 227 | if (e.code === 'Space') { e.preventDefault(); setPlaying(!playing); } | |
| 228 | else if (e.code === 'ArrowLeft' || e.code === 'ArrowRight') { | |
| 229 | const [start, end] = info.range; | |
| 230 | frame = Math.min(end, Math.max(start, frame + (e.code === 'ArrowRight' ? 1 : -1))); | |
| 231 | $('scrub').value = frame; if (playing) setPlaying(false); dirty = true; | |
| 232 | } | |
| 233 | }); | |
| 234 | ||
| 235 | $('file-comp').onchange = (e) => ingest([...e.target.files].map((file) => ({ path: file.name, file }))); | |
| 236 | $('file-folder').onchange = (e) => ingest([...e.target.files].map((file) => ({ path: file.webkitRelativePath || file.name, file }))); | |
| 237 | ||
| 238 | const stage = $('stage'); | |
| 239 | addEventListener('dragover', (e) => { e.preventDefault(); stage.classList.add('drop'); }); | |
| 240 | addEventListener('dragleave', (e) => { if (!e.relatedTarget) stage.classList.remove('drop'); }); | |
| 241 | addEventListener('drop', async (e) => { | |
| 242 | e.preventDefault(); | |
| 243 | stage.classList.remove('drop'); | |
| 244 | const entries = [...e.dataTransfer.items].map((i) => i.webkitGetAsEntry?.()).filter(Boolean); | |
| 245 | ingest(await walk(entries)); | |
| 246 | }); | |
| 247 | ||
| 248 | async function walk(entries) { | |
| 249 | const out = []; | |
| 250 | const visit = async (entry) => { | |
| 251 | if (entry.isFile) { | |
| 252 | out.push({ path: entry.fullPath.replace(/^\//, ''), file: await new Promise((ok, no) => entry.file(ok, no)) }); | |
| 253 | } else if (entry.isDirectory) { | |
| 254 | const reader = entry.createReader(); | |
| 255 | for (let batch; (batch = await new Promise((ok, no) => reader.readEntries(ok, no))).length;) { | |
| 256 | await Promise.all(batch.map(visit)); | |
| 257 | } | |
| 258 | } | |
| 259 | }; | |
| 260 | await Promise.all(entries.map(visit)); | |
| 261 | return out; | |
| 262 | } | |
| 263 | ||
| 264 | async function ingest(files) { | |
| 265 | if (!app) return; | |
| 266 | const comps = files.filter(({ path }) => /\.comp$/i.test(path)); | |
| 267 | if (comps.length) { app.clear_files(); sources.clear(); } | |
| 268 | for (const { path, file } of files) { | |
| 269 | if (!MEDIA_EXT.test(path) || file.size > MAX_FILE_BYTES) continue; | |
| 270 | app.add_file(path, new Uint8Array(await file.arrayBuffer())); | |
| 271 | } | |
| 272 | if (comps.length) { | |
| 273 | comps.sort((a, b) => a.path.localeCompare(b.path)); | |
| 274 | for (const { path, file } of comps) sources.set(path, file); | |
| 275 | $('comps').replaceChildren(...comps.map(({ path }) => new Option(path, path))); | |
| 276 | $('comps').hidden = comps.length < 2; | |
| 277 | const first = comps[0]; | |
| 278 | loadComp(first.path.replace(/\.comp$/i, ''), await first.file.text()); | |
| 279 | } else if (info) { | |
| 280 | refreshGraph(); | |
| 281 | dirty = true; | |
| 282 | } | |
| 283 | } | |
| 284 | ||
| 285 | boot(); | |
| 286 | </script> | |
| 287 | </body> | |
| 288 | </html> |
crates/web/src/lib.rs created+263| ... | ... | @@ -0,0 +1,263 @@ |
| 1 | //! Browser entry point: evaluates a Fusion `.comp` with the native engine on WebGPU and presents | |
| 2 | //! the chosen node to a `<canvas>`. All UI lives in `index.html`. | |
| 3 | #![cfg(target_arch = "wasm32")] | |
| 4 | ||
| 5 | use engine::media::MediaCache; | |
| 6 | use engine::{DisplaySettings, Engine}; | |
| 7 | use model::{Comp, NodeId}; | |
| 8 | use serde_json::json; | |
| 9 | use std::collections::HashSet; | |
| 10 | use wasm_bindgen::prelude::*; | |
| 11 | ||
| 12 | const DEMO_COMP: &str = include_str!("../demo.comp"); | |
| 13 | ||
| 14 | struct Viewer { | |
| 15 | texture: wgpu::Texture, | |
| 16 | bind_group: wgpu::BindGroup, | |
| 17 | } | |
| 18 | ||
| 19 | #[wasm_bindgen] | |
| 20 | pub struct Fission { | |
| 21 | engine: Engine, | |
| 22 | surface: wgpu::Surface<'static>, | |
| 23 | surface_format: wgpu::TextureFormat, | |
| 24 | present: wgpu::RenderPipeline, | |
| 25 | sampler: wgpu::Sampler, | |
| 26 | viewer: Option<Viewer>, | |
| 27 | comp: Option<Comp>, | |
| 28 | target: Option<NodeId>, | |
| 29 | unsupported: Vec<String>, | |
| 30 | } | |
| 31 | ||
| 32 | fn js_err(e: impl std::fmt::Display) -> JsError { | |
| 33 | JsError::new(&e.to_string()) | |
| 34 | } | |
| 35 | ||
| 36 | #[wasm_bindgen] | |
| 37 | impl Fission { | |
| 38 | /// Fails with a readable message when the browser has no WebGPU adapter. | |
| 39 | pub async fn create(canvas: web_sys::HtmlCanvasElement) -> Result<Fission, JsError> { | |
| 40 | console_error_panic_hook::set_once(); | |
| 41 | let instance = wgpu::Instance::new(wgpu::InstanceDescriptor::new_without_display_handle()); | |
| 42 | let surface = instance.create_surface(wgpu::SurfaceTarget::Canvas(canvas)).map_err(js_err)?; | |
| 43 | let adapter = instance | |
| 44 | .request_adapter(&wgpu::RequestAdapterOptions { | |
| 45 | compatible_surface: Some(&surface), | |
| 46 | ..Default::default() | |
| 47 | }) | |
| 48 | .await | |
| 49 | .map_err(|e| JsError::new(&format!("No WebGPU adapter: {e}")))?; | |
| 50 | let mut features = wgpu::Features::empty(); | |
| 51 | if adapter.features().contains(wgpu::Features::FLOAT32_FILTERABLE) { | |
| 52 | features |= wgpu::Features::FLOAT32_FILTERABLE; | |
| 53 | } | |
| 54 | let (device, queue) = adapter | |
| 55 | .request_device(&wgpu::DeviceDescriptor { | |
| 56 | required_features: features, | |
| 57 | required_limits: adapter.limits(), | |
| 58 | ..Default::default() | |
| 59 | }) | |
| 60 | .await | |
| 61 | .map_err(js_err)?; | |
| 62 | ||
| 63 | let surface_format = surface | |
| 64 | .get_capabilities(&adapter) | |
| 65 | .formats | |
| 66 | .into_iter() | |
| 67 | .find(|f| !f.is_srgb()) | |
| 68 | .unwrap_or(wgpu::TextureFormat::Bgra8Unorm); | |
| 69 | let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor { | |
| 70 | label: Some("present"), | |
| 71 | source: wgpu::ShaderSource::Wgsl(include_str!("present.wgsl").into()), | |
| 72 | }); | |
| 73 | let present = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor { | |
| 74 | label: Some("present"), | |
| 75 | layout: None, | |
| 76 | vertex: wgpu::VertexState { | |
| 77 | module: &shader, | |
| 78 | entry_point: Some("vertex"), | |
| 79 | compilation_options: Default::default(), | |
| 80 | buffers: &[], | |
| 81 | }, | |
| 82 | fragment: Some(wgpu::FragmentState { | |
| 83 | module: &shader, | |
| 84 | entry_point: Some("fragment"), | |
| 85 | compilation_options: Default::default(), | |
| 86 | targets: &[Some(surface_format.into())], | |
| 87 | }), | |
| 88 | primitive: Default::default(), | |
| 89 | depth_stencil: None, | |
| 90 | multisample: Default::default(), | |
| 91 | multiview_mask: None, | |
| 92 | cache: None, | |
| 93 | }); | |
| 94 | let sampler = device.create_sampler(&wgpu::SamplerDescriptor { | |
| 95 | mag_filter: wgpu::FilterMode::Linear, | |
| 96 | min_filter: wgpu::FilterMode::Linear, | |
| 97 | ..Default::default() | |
| 98 | }); | |
| 99 | ||
| 100 | Ok(Fission { | |
| 101 | engine: Engine::new(device, queue), | |
| 102 | surface, | |
| 103 | surface_format, | |
| 104 | present, | |
| 105 | sampler, | |
| 106 | viewer: None, | |
| 107 | comp: None, | |
| 108 | target: None, | |
| 109 | unsupported: Vec::new(), | |
| 110 | }) | |
| 111 | } | |
| 112 | ||
| 113 | pub fn demo_comp() -> String { | |
| 114 | DEMO_COMP.to_owned() | |
| 115 | } | |
| 116 | ||
| 117 | /// Registers a project file (a dropped folder's relative path) that `Loader` clips resolve against. | |
| 118 | pub fn add_file(&mut self, path: &str, bytes: &[u8]) { | |
| 119 | MediaCache::insert_virtual_bytes(path, bytes); | |
| 120 | self.engine.bust_all_caches(); | |
| 121 | } | |
| 122 | ||
| 123 | pub fn clear_files(&mut self) { | |
| 124 | MediaCache::clear_virtual_bytes(); | |
| 125 | self.engine.bust_all_caches(); | |
| 126 | } | |
| 127 | ||
| 128 | /// Parses `text`, selects its default output and returns [`Self::describe`]. | |
| 129 | pub fn load_comp(&mut self, text: &str, name: &str) -> Result<String, JsError> { | |
| 130 | let mut comp = Comp::from_fusion_str(text).map_err(js_err)?; | |
| 131 | comp.name = name.to_owned(); | |
| 132 | self.target = comp.default_output_node(); | |
| 133 | self.comp = Some(comp); | |
| 134 | self.engine.bust_all_caches(); | |
| 135 | self.describe() | |
| 136 | } | |
| 137 | ||
| 138 | /// JSON: comp format, frame range, node graph and whether each `Loader` clip resolves. | |
| 139 | pub fn describe(&self) -> Result<String, JsError> { | |
| 140 | let comp = self.comp.as_ref().ok_or_else(|| JsError::new("no comp loaded"))?; | |
| 141 | let names: HashSet<String> = comp.node_by_name.keys().cloned().collect(); | |
| 142 | let nodes: Vec<_> = comp | |
| 143 | .nodes | |
| 144 | .iter() | |
| 145 | .filter(|n| !n.internal) | |
| 146 | .map(|n| { | |
| 147 | let from: Vec<_> = n.image_connections(&names).into_iter().map(|(port, src, _)| json!([port, src])).collect(); | |
| 148 | let clips: Vec<_> = n | |
| 149 | .clips | |
| 150 | .iter() | |
| 151 | .map(|c| json!({ "file": c.filename, "found": engine::media::resolve_clip_path(c, c.global_start).is_some() })) | |
| 152 | .collect(); | |
| 153 | json!({ "id": n.id.0, "name": n.name, "kind": n.kind, "pos": n.pos, "bypassed": n.bypassed, "from": from, "clips": clips }) | |
| 154 | }) | |
| 155 | .collect(); | |
| 156 | Ok(json!({ | |
| 157 | "name": comp.name, | |
| 158 | "width": comp.width, | |
| 159 | "height": comp.height, | |
| 160 | "fps": comp.fps, | |
| 161 | "range": comp.render_range, | |
| 162 | "target": self.target.map(|t| t.0), | |
| 163 | "nodes": nodes, | |
| 164 | }) | |
| 165 | .to_string()) | |
| 166 | } | |
| 167 | ||
| 168 | pub fn set_node(&mut self, id: usize) -> Result<(), JsError> { | |
| 169 | let comp = self.comp.as_ref().ok_or_else(|| JsError::new("no comp loaded"))?; | |
| 170 | if id >= comp.nodes.len() { | |
| 171 | return Err(JsError::new("no such node")); | |
| 172 | } | |
| 173 | self.target = Some(NodeId(id)); | |
| 174 | Ok(()) | |
| 175 | } | |
| 176 | ||
| 177 | /// Evaluates the selected node at `frame` into the canvas and returns the CPU-side milliseconds. | |
| 178 | pub fn render(&mut self, frame: f64) -> Result<f64, JsError> { | |
| 179 | let (comp, target) = self.comp.as_ref().zip(self.target).ok_or_else(|| JsError::new("no comp loaded"))?; | |
| 180 | // Cached by the engine, so `render_into_viewer` below reuses it; the size can change with media or time. | |
| 181 | let (tex, _) = self.engine.evaluate(comp, target, frame); | |
| 182 | if self.viewer.as_ref().is_none_or(|v| [v.texture.width(), v.texture.height()] != tex.canvas_size) { | |
| 183 | self.viewer = Some(make_viewer(self.engine.device(), &self.surface, self.surface_format, &self.present, &self.sampler, tex.canvas_size)); | |
| 184 | } | |
| 185 | let viewer = self.viewer.as_ref().expect("viewer sized above"); | |
| 186 | let stats = self.engine.render_into_viewer(comp, target, frame, &viewer.texture, DisplaySettings::default()); | |
| 187 | self.unsupported = stats.unsupported_nodes; | |
| 188 | ||
| 189 | let frame_tex = match self.surface.get_current_texture() { | |
| 190 | wgpu::CurrentSurfaceTexture::Success(t) | wgpu::CurrentSurfaceTexture::Suboptimal(t) => t, | |
| 191 | _ => return Ok(stats.eval_ms), | |
| 192 | }; | |
| 193 | let device = self.engine.device(); | |
| 194 | let mut encoder = device.create_command_encoder(&Default::default()); | |
| 195 | let view = frame_tex.texture.create_view(&Default::default()); | |
| 196 | { | |
| 197 | let mut pass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { | |
| 198 | color_attachments: &[Some(wgpu::RenderPassColorAttachment { | |
| 199 | view: &view, | |
| 200 | depth_slice: None, | |
| 201 | resolve_target: None, | |
| 202 | ops: wgpu::Operations { load: wgpu::LoadOp::Clear(wgpu::Color::BLACK), store: wgpu::StoreOp::Store }, | |
| 203 | })], | |
| 204 | ..Default::default() | |
| 205 | }); | |
| 206 | pass.set_pipeline(&self.present); | |
| 207 | pass.set_bind_group(0, &viewer.bind_group, &[]); | |
| 208 | pass.draw(0..3, 0..1); | |
| 209 | } | |
| 210 | self.engine.queue().submit(Some(encoder.finish())); | |
| 211 | self.engine.queue().present(frame_tex); | |
| 212 | Ok(stats.eval_ms) | |
| 213 | } | |
| 214 | ||
| 215 | /// Kinds the last rendered frame could not evaluate. | |
| 216 | pub fn unsupported(&self) -> Vec<String> { | |
| 217 | self.unsupported.clone() | |
| 218 | } | |
| 219 | } | |
| 220 | ||
| 221 | /// Sizes the canvas and the intermediate viewer texture to the node's logical output. | |
| 222 | fn make_viewer( | |
| 223 | device: &wgpu::Device, | |
| 224 | surface: &wgpu::Surface<'static>, | |
| 225 | format: wgpu::TextureFormat, | |
| 226 | present: &wgpu::RenderPipeline, | |
| 227 | sampler: &wgpu::Sampler, | |
| 228 | [width, height]: [u32; 2], | |
| 229 | ) -> Viewer { | |
| 230 | surface.configure( | |
| 231 | device, | |
| 232 | &wgpu::SurfaceConfiguration { | |
| 233 | usage: wgpu::TextureUsages::RENDER_ATTACHMENT, | |
| 234 | format, | |
| 235 | color_space: wgpu::SurfaceColorSpace::Auto, | |
| 236 | width, | |
| 237 | height, | |
| 238 | present_mode: wgpu::PresentMode::AutoVsync, | |
| 239 | desired_maximum_frame_latency: 2, | |
| 240 | alpha_mode: wgpu::CompositeAlphaMode::Opaque, | |
| 241 | view_formats: vec![], | |
| 242 | }, | |
| 243 | ); | |
| 244 | let texture = device.create_texture(&wgpu::TextureDescriptor { | |
| 245 | label: Some("viewer"), | |
| 246 | size: wgpu::Extent3d { width, height, depth_or_array_layers: 1 }, | |
| 247 | mip_level_count: 1, | |
| 248 | sample_count: 1, | |
| 249 | dimension: wgpu::TextureDimension::D2, | |
| 250 | format: wgpu::TextureFormat::Rgba8Unorm, | |
| 251 | usage: wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::STORAGE_BINDING, | |
| 252 | view_formats: &[], | |
| 253 | }); | |
| 254 | let bind_group = device.create_bind_group(&wgpu::BindGroupDescriptor { | |
| 255 | label: Some("present"), | |
| 256 | layout: &present.get_bind_group_layout(0), | |
| 257 | entries: &[ | |
| 258 | wgpu::BindGroupEntry { binding: 0, resource: wgpu::BindingResource::TextureView(&texture.create_view(&Default::default())) }, | |
| 259 | wgpu::BindGroupEntry { binding: 1, resource: wgpu::BindingResource::Sampler(sampler) }, | |
| 260 | ], | |
| 261 | }); | |
| 262 | Viewer { texture, bind_group } | |
| 263 | } |
crates/web/src/present.wgsl created+18| ... | ... | @@ -0,0 +1,18 @@ |
| 1 | @group(0) @binding(0) var frame: texture_2d<f32>; | |
| 2 | @group(0) @binding(1) var frame_sampler: sampler; | |
| 3 | ||
| 4 | struct Vertex { | |
| 5 | @builtin(position) position: vec4<f32>, | |
| 6 | @location(0) uv: vec2<f32>, | |
| 7 | } | |
| 8 | ||
| 9 | @vertex | |
| 10 | fn vertex(@builtin(vertex_index) index: u32) -> Vertex { | |
| 11 | let corner = vec2<f32>(f32((index << 1u) & 2u), f32(index & 2u)); | |
| 12 | return Vertex(vec4<f32>(corner * 2.0 - 1.0, 0.0, 1.0), vec2<f32>(corner.x, 1.0 - corner.y)); | |
| 13 | } | |
| 14 | ||
| 15 | @fragment | |
| 16 | fn fragment(v: Vertex) -> @location(0) vec4<f32> { | |
| 17 | return textureSample(frame, frame_sampler, v.uv); | |
| 18 | } |