From ab518d6299399f752464486647e89274014d6c5a Mon Sep 17 00:00:00 2001 From: Tei Leelo Roberts Date: Fri, 16 Aug 2024 11:34:41 +0200 Subject: [PATCH 1/6] wip: expose renderer and app setup --- examples/basic.rs | 6 +- examples/buttons.rs | 8 +- examples/color.rs | 4 +- examples/flow.rs | 4 +- examples/row.rs | 4 +- examples/scroll.rs | 6 +- examples/sizing.rs | 4 +- violet-core/src/layout/cache.rs | 14 +- violet-core/src/systems.rs | 6 +- violet-demo/src/lib.rs | 11 +- violet-wgpu/src/app.rs | 184 +++++++++------- violet-wgpu/src/renderer/debug_renderer.rs | 73 +++---- violet-wgpu/src/renderer/mod.rs | 222 ++++++++++++-------- violet-wgpu/src/renderer/rect_renderer.rs | 23 +- violet-wgpu/src/renderer/text_renderer.rs | 28 +-- violet-wgpu/src/renderer/window_renderer.rs | 97 ++++----- 16 files changed, 369 insertions(+), 325 deletions(-) diff --git a/examples/basic.rs b/examples/basic.rs index 9ce221d..358bf7c 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -2,7 +2,7 @@ use tracing_subscriber::{ prelude::__tracing_subscriber_SubscriberExt, registry, util::SubscriberInitExt, EnvFilter, }; use tracing_tree::HierarchicalLayer; -use violet_wgpu::renderer::RendererConfig; +use violet_wgpu::{renderer::MainRendererConfig, AppBuilder}; pub fn main() -> anyhow::Result<()> { registry() @@ -15,7 +15,7 @@ pub fn main() -> anyhow::Result<()> { .with(EnvFilter::from_default_env()) .init(); - violet_wgpu::AppBuilder::new() - .with_renderer_config(RendererConfig { debug_mode: false }) + AppBuilder::new() + .with_renderer_config(MainRendererConfig { debug_mode: false }) .run(violet_demo::bridge_of_death::app()) } diff --git a/examples/buttons.rs b/examples/buttons.rs index be1f226..518dc91 100644 --- a/examples/buttons.rs +++ b/examples/buttons.rs @@ -1,5 +1,3 @@ -use std::usize; - use futures_signals::{map_ref, signal::Mutable}; use itertools::Itertools; @@ -19,7 +17,7 @@ use violet_core::{ text::Wrap, widget::{card, col, label, row, Button, ButtonStyle, SliderWithLabel, TextInput}, }; -use violet_wgpu::renderer::RendererConfig; +use violet_wgpu::{renderer::MainRendererConfig, AppBuilder}; pub fn main() -> anyhow::Result<()> { registry() @@ -33,8 +31,8 @@ pub fn main() -> anyhow::Result<()> { .with(EnvFilter::from_default_env()) .init(); - violet_wgpu::AppBuilder::new() - .with_renderer_config(RendererConfig { debug_mode: false }) + AppBuilder::new() + .with_renderer_config(MainRendererConfig { debug_mode: false }) .run(MainApp) } diff --git a/examples/color.rs b/examples/color.rs index 090e31b..437623d 100644 --- a/examples/color.rs +++ b/examples/color.rs @@ -15,7 +15,7 @@ use violet_core::{ }, Edges, Scope, Widget, }; -use violet_wgpu::renderer::RendererConfig; +use violet_wgpu::renderer::MainRendererConfig; pub fn main() -> anyhow::Result<()> { registry() @@ -30,7 +30,7 @@ pub fn main() -> anyhow::Result<()> { .init(); violet_wgpu::AppBuilder::new() - .with_renderer_config(RendererConfig { debug_mode: false }) + .with_renderer_config(MainRendererConfig { debug_mode: false }) .run(MainApp) } diff --git a/examples/flow.rs b/examples/flow.rs index e99931e..66dbe8e 100644 --- a/examples/flow.rs +++ b/examples/flow.rs @@ -7,7 +7,7 @@ use violet::core::{ widget::{col, row, Button}, Edges, Widget, }; -use violet_wgpu::renderer::RendererConfig; +use violet_wgpu::renderer::MainRendererConfig; pub fn main() -> anyhow::Result<()> { registry() @@ -21,7 +21,7 @@ pub fn main() -> anyhow::Result<()> { .init(); violet_wgpu::AppBuilder::new() - .with_renderer_config(RendererConfig { debug_mode: true }) + .with_renderer_config(MainRendererConfig { debug_mode: false }) .run(app()) } diff --git a/examples/row.rs b/examples/row.rs index 9a5820c..37c68ff 100644 --- a/examples/row.rs +++ b/examples/row.rs @@ -8,7 +8,7 @@ use violet_core::{ style::{accent_element, primary_surface, spacing_small, SizeExt}, widget::{centered, col, row, Image, Stack}, }; -use violet_wgpu::renderer::RendererConfig; +use violet_wgpu::renderer::MainRendererConfig; pub fn main() -> anyhow::Result<()> { registry() @@ -23,7 +23,7 @@ pub fn main() -> anyhow::Result<()> { .init(); violet_wgpu::AppBuilder::new() - .with_renderer_config(RendererConfig { debug_mode: true }) + .with_renderer_config(MainRendererConfig { debug_mode: true }) .run(MainApp) } diff --git a/examples/scroll.rs b/examples/scroll.rs index 3471aca..dfc1752 100644 --- a/examples/scroll.rs +++ b/examples/scroll.rs @@ -19,7 +19,7 @@ use violet_core::{ utils::zip_latest, widget::{label, Button, Checkbox, ScrollArea, SliderWithLabel, StreamWidget, WidgetExt}, }; -use violet_wgpu::renderer::RendererConfig; +use violet_wgpu::{renderer::MainRendererConfig, AppBuilder}; pub fn main() -> anyhow::Result<()> { registry() @@ -33,8 +33,8 @@ pub fn main() -> anyhow::Result<()> { .with(EnvFilter::from_default_env()) .init(); - violet_wgpu::AppBuilder::new() - .with_renderer_config(RendererConfig { debug_mode: true }) + AppBuilder::new() + .with_renderer_config(MainRendererConfig { debug_mode: true }) .run(app()) } diff --git a/examples/sizing.rs b/examples/sizing.rs index 81527b2..504bcec 100644 --- a/examples/sizing.rs +++ b/examples/sizing.rs @@ -19,7 +19,7 @@ use violet_core::style::{ colors::{AMBER_500, EMERALD_500, EMERALD_800, REDWOOD_500, TEAL_500}, primary_surface, }; -use violet_wgpu::renderer::RendererConfig; +use violet_wgpu::renderer::MainRendererConfig; pub fn main() -> anyhow::Result<()> { registry() @@ -34,7 +34,7 @@ pub fn main() -> anyhow::Result<()> { .init(); violet_wgpu::AppBuilder::new() - .with_renderer_config(RendererConfig { debug_mode: true }) + .with_renderer_config(MainRendererConfig { debug_mode: true }) .run(MainApp) } diff --git a/violet-core/src/layout/cache.rs b/violet-core/src/layout/cache.rs index 9708bd9..77d6f6b 100644 --- a/violet-core/src/layout/cache.rs +++ b/violet-core/src/layout/cache.rs @@ -23,7 +23,7 @@ impl CachedValue { } #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] -pub enum LayoutUpdate { +pub enum LayoutUpdateEvent { SizeQueryUpdate, LayoutUpdate, Explicit, @@ -33,12 +33,12 @@ pub struct LayoutCache { pub(crate) query: [Vec>; 2], pub(crate) query_row: Option>, pub(crate) layout: Option>, - on_invalidated: Option>, + on_invalidated: Option>, pub(crate) hints: SizingHints, } impl LayoutCache { - pub fn new(on_invalidated: Option>) -> Self { + pub fn new(on_invalidated: Option>) -> Self { Self { query: Default::default(), query_row: None, @@ -50,7 +50,7 @@ impl LayoutCache { pub fn invalidate(&mut self) { if let Some(f) = self.on_invalidated.as_ref() { - f(LayoutUpdate::Explicit) + f(LayoutUpdateEvent::Explicit) } self.query = Default::default(); @@ -68,21 +68,21 @@ impl LayoutCache { v.insert(0, value); if let Some(f) = self.on_invalidated.as_ref() { - f(LayoutUpdate::SizeQueryUpdate) + f(LayoutUpdateEvent::SizeQueryUpdate) } } pub(crate) fn insert_query_row(&mut self, value: CachedValue) { self.query_row = Some(value); if let Some(f) = self.on_invalidated.as_ref() { - f(LayoutUpdate::SizeQueryUpdate) + f(LayoutUpdateEvent::SizeQueryUpdate) } } pub(crate) fn insert_layout(&mut self, value: CachedValue) { self.layout = Some(value); if let Some(f) = self.on_invalidated.as_ref() { - f(LayoutUpdate::LayoutUpdate) + f(LayoutUpdateEvent::LayoutUpdate) } } diff --git a/violet-core/src/systems.rs b/violet-core/src/systems.rs index 07238d3..c362187 100644 --- a/violet-core/src/systems.rs +++ b/violet-core/src/systems.rs @@ -23,7 +23,7 @@ use crate::{ }, layout::{ apply_layout, - cache::{invalidate_widget, layout_cache, LayoutCache, LayoutUpdate}, + cache::{invalidate_widget, layout_cache, LayoutCache, LayoutUpdateEvent}, LayoutArgs, LayoutLimits, }, Rect, @@ -54,7 +54,9 @@ pub fn widget_template(entity: &mut EntityBuilder, name: String) { .set_default(rect()); } -pub fn templating_system(layout_changes_tx: flume::Sender<(Entity, LayoutUpdate)>) -> BoxedSystem { +pub fn templating_system( + layout_changes_tx: flume::Sender<(Entity, LayoutUpdateEvent)>, +) -> BoxedSystem { let query = Query::new(entity_ids()).filter(Or((rect().with(), layout_cache().without()))); System::builder() diff --git a/violet-demo/src/lib.rs b/violet-demo/src/lib.rs index c4af1ef..fe6157e 100644 --- a/violet-demo/src/lib.rs +++ b/violet-demo/src/lib.rs @@ -8,7 +8,7 @@ use violet::{ Widget, }, futures_signals::signal::Mutable, - wgpu::{app::App, renderer::RendererConfig}, + wgpu::{renderer::MainRendererConfig, AppBuilder}, }; use wasm_bindgen_futures::wasm_bindgen; @@ -17,10 +17,7 @@ mod palettes; #[cfg(target_arch = "wasm32")] fn setup() { - use tracing_subscriber::{ - filter::LevelFilter, fmt::format::Pretty, layer::SubscriberExt, util::SubscriberInitExt, - Layer, - }; + use tracing_subscriber::{filter::LevelFilter, fmt::format::Pretty, Layer}; use tracing_web::{performance_layer, MakeWebConsoleWriter}; let fmt_layer = tracing_subscriber::fmt::layer() @@ -59,9 +56,9 @@ fn setup() { pub fn run() { setup(); - App::builder() + AppBuilder::new() .with_title("Palette Editor") - .with_renderer_config(RendererConfig { debug_mode: false }) + .with_renderer_config(MainRendererConfig { debug_mode: false }) .run(app()) .unwrap(); } diff --git a/violet-wgpu/src/app.rs b/violet-wgpu/src/app.rs index 36a86cb..51b4363 100644 --- a/violet-wgpu/src/app.rs +++ b/violet-wgpu/src/app.rs @@ -19,12 +19,12 @@ use violet_core::{ executor::Executor, input::InputState, io::{self, Clipboard}, + layout::cache::LayoutUpdateEvent, style::{primary_surface, setup_stylesheet, stylesheet, Background, SizeExt}, systems::{ hydrate_text, invalidate_cached_layout_system, layout_system, templating_system, transform_system, }, - to_owned, unit::Unit, widget::{col, WidgetExt}, Frame, FutureEffect, Rect, Scope, Widget, @@ -32,7 +32,7 @@ use violet_core::{ use crate::{ graphics::Gpu, - renderer::{RendererConfig, WindowRenderer}, + renderer::{MainRendererConfig, WindowRenderer}, systems::{register_text_buffers, update_text_buffers}, text::TextSystem, }; @@ -62,7 +62,7 @@ impl Widget for Canvas { } pub struct AppBuilder { - renderer_config: RendererConfig, + renderer_config: MainRendererConfig, title: String, } @@ -80,22 +80,18 @@ impl AppBuilder { } /// Set the renderer config - pub fn with_renderer_config(mut self, renderer_config: RendererConfig) -> Self { + pub fn with_renderer_config(mut self, renderer_config: MainRendererConfig) -> Self { self.renderer_config = renderer_config; self } pub fn run(self, root: impl Widget) -> anyhow::Result<()> { - let executor = Executor::new(); - - let spawner = executor.spawner(); - - let mut frame = Frame::new(spawner, AssetCache::new(), World::new()); - let event_loop = EventLoopBuilder::new().build()?; #[allow(unused_mut)] - let mut builder = WindowBuilder::new().with_title(self.title); + let mut builder = WindowBuilder::new().with_title(self.title.clone()); + + let mut instance = AppInstance::new(root); #[cfg(target_arch = "wasm32")] { @@ -148,76 +144,34 @@ impl AppBuilder { .expect("Failed to add resize listener"); } - let stylesheet = setup_stylesheet().spawn(frame.world_mut()); - - let clipboard = frame.store_mut().insert(Arc::new(Clipboard::new())); - frame.set_atom(io::clipboard(), clipboard); - - // Mount the root widget - let root = frame.new_root(Canvas { - stylesheet, - size: vec2(0.0, 0.0), - root, - }); - - let mut input_state = InputState::new(root, Vec2::ZERO); - tracing::info!("creating gpu"); let window = Arc::new(window); - // TODO: async within violet's executor let (renderer_tx, mut renderer_rx) = oneshot::channel(); - let text_system = Arc::new(Mutex::new(TextSystem::new_with_defaults())); - let (layout_changes_tx, layout_changes_rx) = flume::unbounded(); - - frame.spawn(FutureEffect::new(Gpu::with_surface(window.clone()), { - to_owned![text_system]; - move |frame: &mut Frame, (gpu, surface)| { - let renderer = WindowRenderer::new( - frame, - gpu, - root, - text_system.clone(), - surface, - layout_changes_rx.clone(), - 1.0, - self.renderer_config, - ); - renderer_tx.send(renderer).ok(); - } - })); - - let schedule = Schedule::new() - .with_system(templating_system(layout_changes_tx)) - .flush() - .with_system(hydrate_text()) - .flush() - .with_system(register_text_buffers(text_system.clone())) - .flush() - .with_system(update_text_buffers(text_system.clone())) - .with_system(invalidate_cached_layout_system(&mut frame.world)) - .with_system(layout_system(root)) - .with_system(transform_system(root)); - - let start_time = Instant::now(); + instance + .frame + .spawn(FutureEffect::new(Gpu::with_surface(window.clone()), { + let text_system = instance.text_system.to_owned(); + let layout_changes_rx = instance.layout_changes_rx.to_owned(); + move |frame: &mut Frame, (gpu, surface)| { + renderer_tx + .send(WindowRenderer::new( + frame, + gpu, + instance.root, + text_system.clone(), + surface, + layout_changes_rx.clone(), + self.renderer_config, + )) + .ok(); + } + })); #[cfg(not(target_arch = "wasm32"))] let _puffin_server = setup_puffin(); - let mut instance = App { - frame, - renderer: None, - root, - scale_factor: window.scale_factor(), - stats: AppStats::new(16), - current_time: start_time, - start_time, - executor, - schedule, - window_size: window.inner_size(), - }; - let on_event = move |event, ctl: &EventLoopWindowTarget<()>| match event { Event::AboutToWait => { puffin::profile_scope!("AboutToWait"); @@ -258,20 +212,23 @@ impl AppBuilder { } WindowEvent::MouseInput { state, button, .. } => { puffin::profile_scope!("MouseInput"); - input_state.on_mouse_input(&mut instance.frame, state, button); + instance + .input_state + .on_mouse_input(&mut instance.frame, state, button); } WindowEvent::ModifiersChanged(modifiers) => { puffin::profile_scope!("ModifiersChanged"); - input_state.on_modifiers_change(modifiers.state()); + instance.input_state.on_modifiers_change(modifiers.state()); } WindowEvent::KeyboardInput { event, .. } => { puffin::profile_scope!("KeyboardInput", format!("{event:?}")); - input_state.on_keyboard_input(&mut instance.frame, event) + instance + .input_state + .on_keyboard_input(&mut instance.frame, event) } WindowEvent::CursorMoved { position, .. } => { puffin::profile_scope!("CursorMoved"); - let position = position.to_logical::(instance.scale_factor); - input_state.on_cursor_move( + instance.input_state.on_cursor_move( &mut instance.frame, vec2(position.x as f32, position.y as f32), ) @@ -281,12 +238,15 @@ impl AppBuilder { match delta { winit::event::MouseScrollDelta::LineDelta(x, y) => { const LINE_SIZE: f32 = 16.0; - input_state + instance + .input_state .on_scroll(&mut instance.frame, vec2(x * LINE_SIZE, y * LINE_SIZE)) } winit::event::MouseScrollDelta::PixelDelta(pos) => { let pos = pos.to_logical::(instance.scale_factor); - input_state.on_scroll(&mut instance.frame, vec2(pos.x, pos.y)) + instance + .input_state + .on_scroll(&mut instance.frame, vec2(pos.x, pos.y)) } } } @@ -329,7 +289,7 @@ impl AppBuilder { } /// A running application instance of violet -pub struct App { +pub struct AppInstance { frame: Frame, renderer: Option, root: Entity, @@ -340,9 +300,71 @@ pub struct App { executor: Executor, schedule: Schedule, window_size: PhysicalSize, + input_state: InputState, + text_system: Arc>, + layout_changes_rx: flume::Receiver<(Entity, LayoutUpdateEvent)>, } -impl App { +impl AppInstance { + pub fn new(root: impl Widget) -> AppInstance { + let executor = Executor::new(); + + let spawner = executor.spawner(); + + let mut frame = Frame::new(spawner, AssetCache::new(), World::new()); + + let stylesheet = setup_stylesheet().spawn(frame.world_mut()); + + let clipboard = frame.store_mut().insert(Arc::new(Clipboard::new())); + frame.set_atom(io::clipboard(), clipboard); + + // Mount the root widget + let root = frame.new_root(Canvas { + stylesheet, + size: vec2(0.0, 0.0), + root, + }); + + let text_system = Arc::new(Mutex::new(TextSystem::new_with_defaults())); + let (layout_changes_tx, layout_changes_rx) = flume::unbounded(); + + let schedule = Schedule::new() + .with_system(templating_system(layout_changes_tx)) + .flush() + .with_system(hydrate_text()) + .flush() + .with_system(register_text_buffers(text_system.clone())) + .flush() + .with_system(update_text_buffers(text_system.clone())) + .with_system(invalidate_cached_layout_system(&mut frame.world)) + .with_system(layout_system(root)) + .with_system(transform_system(root)); + + let input_state = InputState::new(root, Vec2::ZERO); + + let start_time = Instant::now(); + + Self { + frame, + renderer: None, + root, + scale_factor: 1.0, + stats: AppStats::new(60), + current_time: start_time, + start_time, + executor, + schedule, + window_size: Default::default(), + input_state, + text_system, + layout_changes_rx, + } + } + + pub fn insert_renderer(&mut self, renderer: WindowRenderer) { + self.renderer = Some(renderer); + } + pub fn builder() -> AppBuilder { AppBuilder::new() } diff --git a/violet-wgpu/src/renderer/debug_renderer.rs b/violet-wgpu/src/renderer/debug_renderer.rs index 5f51ed2..97a7189 100644 --- a/violet-wgpu/src/renderer/debug_renderer.rs +++ b/violet-wgpu/src/renderer/debug_renderer.rs @@ -2,17 +2,19 @@ use std::{collections::BTreeMap, sync::Arc}; use flax::{fetch::entity_refs, Entity, Query}; use glam::{vec2, vec3, vec4, Mat4, Quat, Vec2, Vec3, Vec4}; +use image::DynamicImage; use itertools::Itertools; use violet_core::{ + assets::Asset, components::{layout_args, rect, screen_clip_mask, screen_transform}, layout::{ - cache::{layout_cache, LayoutUpdate}, + cache::{layout_cache, LayoutUpdateEvent}, Direction, }, stored::{self, Handle}, Frame, Rect, }; -use wgpu::{BindGroup, BindGroupLayout, SamplerDescriptor, ShaderStages}; +use wgpu::{BindGroup, BindGroupLayout, SamplerDescriptor, ShaderStages, TextureFormat}; use crate::{ graphics::{ @@ -20,13 +22,17 @@ use crate::{ Vertex, VertexDesc, }, mesh_buffer::MeshHandle, - renderer::Gpu, }; -use super::{rect_renderer::ImageFromColor, DrawCommand, ObjectData, RendererProps, RendererStore}; +use super::{ + rect_renderer::ImageFromColor, DrawCommand, ObjectData, RendererContext, RendererStore, +}; pub struct DebugRenderer { + white_image: Asset, + layout: BindGroupLayout, bind_group: Handle, + sampler: wgpu::Sampler, mesh: Arc, @@ -34,28 +40,29 @@ pub struct DebugRenderer { border_shader: stored::Handle, solid_shader: stored::Handle, - layout_changes_rx: flume::Receiver<(Entity, LayoutUpdate)>, - layout_changes: BTreeMap<(Entity, LayoutUpdate), usize>, + layout_changes_rx: flume::Receiver<(Entity, LayoutUpdateEvent)>, + layout_changes: BTreeMap<(Entity, LayoutUpdateEvent), usize>, objects: Vec<(DrawCommand, ObjectData)>, } impl DebugRenderer { pub fn new( - gpu: &mut Gpu, + ctx: &mut RendererContext, frame: &Frame, - props: &mut RendererProps, + color_format: TextureFormat, object_bind_group_layout: &BindGroupLayout, store: &mut RendererStore, + layout_changes_rx: flume::Receiver<(Entity, LayoutUpdateEvent)>, ) -> Self { let layout = BindGroupLayoutBuilder::new("RectRenderer::layout") .bind_sampler(ShaderStages::FRAGMENT) .bind_texture(ShaderStages::FRAGMENT) - .build(gpu); + .build(&ctx.gpu); let white_image = frame.assets.load(&ImageFromColor([255, 255, 255, 255])); - let texture = Texture::from_image(gpu, &white_image); + let texture = Texture::from_image(&ctx.gpu, &white_image); - let sampler = gpu.device.create_sampler(&SamplerDescriptor { + let sampler = ctx.gpu.device.create_sampler(&SamplerDescriptor { label: Some("ShapeRenderer::sampler"), anisotropy_clamp: 16, mag_filter: wgpu::FilterMode::Linear, @@ -68,7 +75,7 @@ impl DebugRenderer { BindGroupBuilder::new("DebugRenderer::textured_bind_group") .bind_sampler(&sampler) .bind_texture(&texture.view(&Default::default())) - .build(gpu, &layout), + .build(&ctx.gpu, &layout), ); let vertices = [ @@ -80,50 +87,40 @@ impl DebugRenderer { let indices = [0, 1, 2, 2, 3, 0]; - let mesh = Arc::new(props.globals.mesh_buffer.insert(gpu, &vertices, &indices)); + let mesh = Arc::new(ctx.mesh_buffer.insert(&ctx.gpu, &vertices, &indices)); let corner_shader = store.shaders.insert(Shader::new( - gpu, + &ctx.gpu, &ShaderDesc { label: "ShapeRenderer::shader", source: include_str!("../../../assets/shaders/debug_indicator.wgsl"), - format: props.color_format, + format: color_format, vertex_layouts: &[Vertex::layout()], - layouts: &[&props.globals.layout, &object_bind_group_layout, &layout], + layouts: &[&ctx.globals_layout, &object_bind_group_layout, &layout], }, )); - let border_shader = store.shaders.insert(Shader::new( - gpu, + &ctx.gpu, &ShaderDesc { label: "ShapeRenderer::shader", source: include_str!("../../../assets/shaders/border_shader.wgsl"), - format: props.color_format, + format: color_format, vertex_layouts: &[Vertex::layout()], - layouts: &[&props.globals.layout, &object_bind_group_layout, &layout], + layouts: &[&ctx.globals_layout, &object_bind_group_layout, &layout], }, )); - - let solid_shader = store.shaders.insert(Shader::new( - gpu, - &ShaderDesc { - label: "ShapeRenderer::shader", - source: include_str!("../../../assets/shaders/solid.wgsl"), - format: props.color_format, - vertex_layouts: &[Vertex::layout()], - layouts: &[&props.globals.layout, &object_bind_group_layout, &layout], - }, - )); - Self { + white_image, + layout, bind_group, + sampler, mesh, corner_shader, border_shader, - layout_changes_rx: props.layout_changes_rx.clone(), + layout_changes_rx, layout_changes: BTreeMap::new(), objects: Vec::new(), - solid_shader, + solid_shader: todo!(), } } @@ -319,10 +316,10 @@ impl DebugRenderer { } } -fn indicator_color(layout: &LayoutUpdate) -> Vec4 { +fn indicator_color(layout: &LayoutUpdateEvent) -> Vec4 { match layout { - LayoutUpdate::Explicit => vec4(1.0, 0.0, 0.0, 1.0), - LayoutUpdate::SizeQueryUpdate => vec4(0.0, 1.0, 0.0, 1.0), - LayoutUpdate::LayoutUpdate => vec4(0.0, 0.0, 1.0, 1.0), + LayoutUpdateEvent::Explicit => vec4(1.0, 0.0, 0.0, 1.0), + LayoutUpdateEvent::SizeQueryUpdate => vec4(0.0, 1.0, 0.0, 1.0), + LayoutUpdateEvent::LayoutUpdate => vec4(0.0, 0.0, 1.0, 1.0), } } diff --git a/violet-wgpu/src/renderer/mod.rs b/violet-wgpu/src/renderer/mod.rs index bc333eb..719e399 100644 --- a/violet-wgpu/src/renderer/mod.rs +++ b/violet-wgpu/src/renderer/mod.rs @@ -4,20 +4,23 @@ use bytemuck::Zeroable; use flax::{ entity_ids, fetch::{entity_refs, EntityRefs, NthRelation}, - CommandBuffer, Component, Entity, Fetch, Query, QueryBorrow, RelationExt, + CommandBuffer, Component, Entity, EntityRef, Fetch, Query, QueryBorrow, RelationExt, World, }; use glam::{vec4, Mat4, Vec2, Vec4}; use itertools::Itertools; use palette::Srgba; use parking_lot::Mutex; +use smallvec::SmallVec; use violet_core::{ - components::draw_shape, - hierarchy::OrderedDfsIterator, - layout::cache::LayoutUpdate, + components::{children, draw_shape}, + layout::cache::LayoutUpdateEvent, stored::{self, Store}, Frame, Rect, }; -use wgpu::{BindGroup, BindGroupLayout, BufferUsages, RenderPass, ShaderStages, TextureFormat}; +use wgpu::{ + BindGroup, BindGroupLayout, BufferUsages, CommandEncoder, Operations, RenderPassDescriptor, + ShaderStages, StoreOp, TextureFormat, TextureView, +}; use crate::{ components::{draw_cmd, object_data}, @@ -44,7 +47,7 @@ mod window_renderer; pub use window_renderer::WindowRenderer; #[derive(Debug, Clone, Default)] -pub struct RendererConfig { +pub struct MainRendererConfig { /// Enables the debug renderer for extra information during development: /// - Draw layout invalidations using slanted corners of combined colors /// - Red: direct invalidation due to change of a widgets size @@ -53,28 +56,29 @@ pub struct RendererConfig { pub debug_mode: bool, } -/// Contains global state to be shared between the renderers, such as global uniforms for cameras -/// and scene properties. -pub struct GlobalBuffers { +/// Contains the global rendering state and buffers +pub struct RendererContext { + pub gpu: Gpu, pub globals: Globals, pub globals_buffer: TypedBuffer, - pub bind_group: BindGroup, - pub layout: BindGroupLayout, pub mesh_buffer: MeshBuffer, + pub globals_bind_group: BindGroup, + pub globals_layout: BindGroupLayout, } -impl GlobalBuffers { - pub fn new(gpu: &mut Gpu) -> Self { +impl RendererContext { + /// Creates a new renderer context from the provided gpu + pub fn new(gpu: Gpu) -> Self { let globals_layout = BindGroupLayoutBuilder::new("WindowRenderer::globals_layout") .bind_uniform_buffer(ShaderStages::VERTEX) - .build(gpu); + .build(&gpu); let globals = Globals { projview: Mat4::IDENTITY, }; let globals_buffer = TypedBuffer::new( - gpu, + &gpu, "WindowRenderer::globals_buffer", BufferUsages::UNIFORM | BufferUsages::COPY_DST, &[globals], @@ -82,16 +86,17 @@ impl GlobalBuffers { let globals_bind_group = BindGroupBuilder::new("WindowRenderer::globals") .bind_buffer(globals_buffer.buffer()) - .build(gpu, &globals_layout); + .build(&gpu, &globals_layout); - let mesh_buffer = MeshBuffer::new(gpu, "MeshBuffer", 4); + let mesh_buffer = MeshBuffer::new(&gpu, "MeshBuffer", 4); Self { + globals_layout, globals, + globals_bind_group, globals_buffer, - bind_group: globals_bind_group, - layout: globals_layout, mesh_buffer, + gpu, } } } @@ -145,12 +150,12 @@ impl DrawQuery { } fn create_object_bindings( - gpu: &Gpu, + ctx: &mut RendererContext, bind_group_layout: &BindGroupLayout, object_count: usize, ) -> (BindGroup, TypedBuffer) { let object_buffer = TypedBuffer::new_uninit( - gpu, + &ctx.gpu, "ShapeRenderer::object_buffer", BufferUsages::UNIFORM | BufferUsages::COPY_DST | BufferUsages::COPY_SRC, object_count, @@ -158,22 +163,12 @@ fn create_object_bindings( let bind_group = BindGroupBuilder::new("ShapeRenderer::object_bind_group") .bind_buffer(object_buffer.buffer()) - .build(gpu, bind_group_layout); + .build(&ctx.gpu, bind_group_layout); (bind_group, object_buffer) } -pub(crate) struct RendererProps<'a> { - pub root: Entity, - pub text_system: Arc>, - pub color_format: TextureFormat, - pub globals: &'a mut GlobalBuffers, - pub layout_changes_rx: flume::Receiver<(Entity, LayoutUpdate)>, - pub config: RendererConfig, - pub scale_factor: f64, -} - -/// Draws shapes from the frame +/// Main renderer for a frame pub struct MainRenderer { store: RendererStore, quad: Mesh, @@ -194,11 +189,19 @@ pub struct MainRenderer { } impl MainRenderer { - pub(crate) fn new(frame: &mut Frame, gpu: &mut Gpu, mut props: RendererProps) -> Self { + pub fn new( + frame: &mut Frame, + ctx: &mut RendererContext, + root: Entity, + text_system: Arc>, + color_format: TextureFormat, + layout_changes_rx: flume::Receiver<(Entity, LayoutUpdateEvent)>, + config: MainRendererConfig, + ) -> Self { let object_bind_group_layout = - BindGroupLayoutBuilder::new("ShapeRenderer::object_bind_group_layout") + BindGroupLayoutBuilder::new("MainRenderer::object_bind_group_layout") .bind_uniform_buffer(ShaderStages::VERTEX) - .build(gpu); + .build(&ctx.gpu); let register_objects = flax::system::System::builder() .with_cmd_mut() @@ -213,84 +216,113 @@ impl MainRenderer { let mut store = RendererStore::default(); Self { - quad: Mesh::quad(gpu), + quad: Mesh::quad(&ctx.gpu), object_data: Vec::new(), commands: Vec::new(), rect_renderer: RectRenderer::new( - gpu, + ctx, frame, - &mut props, + color_format, &object_bind_group_layout, &mut store, ), text_renderer: TextRenderer::new( - gpu, - &mut props, + ctx, + text_system, + color_format, &object_bind_group_layout, &mut store, ), - debug_renderer: props.config.debug_mode.then(|| { + debug_renderer: config.debug_mode.then(|| { DebugRenderer::new( - gpu, + ctx, frame, - &mut props, + color_format, &object_bind_group_layout, &mut store, + layout_changes_rx, ) }), store, register_objects, object_bind_group_layout, object_buffers: Vec::new(), - root: props.root, - scale_factor: props.scale_factor, + root, + scale_factor: 1.0, } } + /// Updates renderer state before draw + pub fn update(&mut self, ctx: &mut RendererContext, frame: &mut Frame) -> anyhow::Result<()> { + self.register_objects.run(&mut frame.world)?; + self.rect_renderer.update(&ctx.gpu, frame); + self.rect_renderer + .build_commands(&ctx.gpu, frame, &mut self.store); + + self.text_renderer + .update_meshes(ctx, frame, &mut self.store); + + self.text_renderer.update(&ctx.gpu, frame); + + if let Some(debug_renderer) = &mut self.debug_renderer { + debug_renderer.update(frame); + } + + Ok(()) + } + + /// Draws the frame using the provided render pass + /// + /// **Note**: provided render pass target must match the provided target texture format pub fn draw<'a>( &'a mut self, - gpu: &'a Gpu, - globals: &'a mut GlobalBuffers, + ctx: &'a mut RendererContext, frame: &mut Frame, - render_pass: &mut RenderPass<'a>, + encoder: &mut CommandEncoder, + target_view: &TextureView, ) -> anyhow::Result<()> { puffin::profile_function!(); - let _span = tracing::info_span!("draw").entered(); - self.quad.bind(render_pass); - self.register_objects.run(&mut frame.world)?; + let mut render_pass = encoder.begin_render_pass(&RenderPassDescriptor { + label: Some("MainRenderer::draw"), + color_attachments: &[Some(wgpu::RenderPassColorAttachment { + view: target_view, + resolve_target: None, + ops: Operations { + load: wgpu::LoadOp::Clear(wgpu::Color { + r: 0.0, + g: 0.0, + b: 0.0, + a: 0.0, + }), + store: StoreOp::Store, + }, + })], + depth_stencil_attachment: None, + ..Default::default() + }); - { - puffin::profile_scope!("update_renderers"); - self.rect_renderer.update(gpu, frame); - self.rect_renderer - .build_commands(gpu, frame, &mut self.store); - - self.text_renderer - .update_meshes(gpu, globals, frame, &mut self.store); - self.text_renderer.update(gpu, frame); - if let Some(debug_renderer) = &mut self.debug_renderer { - debug_renderer.update(frame); - } - } + self.quad.bind(&mut render_pass); { puffin::profile_scope!("create_draw_commands"); let query = DrawQuery::new(); - let commands = - OrderedDfsIterator::new(&frame.world, frame.world.entity(self.root).unwrap()) - .filter_map(|entity| { - let mut query = entity.query(&query); - let item = query.get()?; + let commands = RendererIter { + world: &frame.world, + stack: smallvec::smallvec![frame.world.entity(self.root).unwrap()], + } + .filter_map(|entity| { + let mut query = entity.query(&query); + let item = query.get()?; - Some((item.draw_cmd.clone(), *item.object_data)) - }) - .chain( - self.debug_renderer - .iter() - .flat_map(|v| v.draw_commands().iter().cloned()), - ); + Some((item.draw_cmd.clone(), *item.object_data)) + }) + .chain( + self.debug_renderer + .iter() + .flat_map(|v| v.draw_commands().iter().cloned()), + ); self.commands.clear(); self.object_data.clear(); @@ -302,7 +334,7 @@ impl MainRenderer { if num_chunks > self.object_buffers.len() { self.object_buffers .extend((self.object_buffers.len()..num_chunks).map(|_| { - create_object_bindings(gpu, &self.object_bind_group_layout, CHUNK_SIZE) + create_object_bindings(ctx, &self.object_bind_group_layout, CHUNK_SIZE) })) } @@ -311,10 +343,10 @@ impl MainRenderer { .chunks(CHUNK_SIZE) .zip(&self.object_buffers) { - buffer.write(&gpu.queue, 0, objects); + buffer.write(&ctx.gpu.queue, 0, objects); } - globals.mesh_buffer.bind(render_pass); + ctx.mesh_buffer.bind(&mut render_pass); } puffin::profile_scope!("dispatch_draw_commands"); @@ -341,7 +373,7 @@ impl MainRenderer { render_pass.set_pipeline(shader.pipeline()); - render_pass.set_bind_group(0, &globals.bind_group, &[]); + render_pass.set_bind_group(0, &ctx.globals_bind_group, &[]); render_pass.set_bind_group(1, &chunk.0, &[]); render_pass.set_bind_group(2, bind_group, &[]); @@ -382,11 +414,6 @@ fn collect_draw_commands( .enumerate() .map(|(i, (draw_cmd, object))| { objects.push(object); - // let first_instance = instance_index as u32; - // instance_index += 1; - // objects.push(*item.object_data); - - // let draw_cmd = item.draw_cmd; InstancedDrawCommand { draw_cmd: draw_cmd.clone(), first_instance: i as u32, @@ -419,6 +446,29 @@ pub(crate) struct ObjectData { pub(crate) color: Vec4, } +struct RendererIter<'a> { + world: &'a World, + stack: SmallVec<[EntityRef<'a>; 16]>, +} + +impl<'a> Iterator for RendererIter<'a> { + type Item = EntityRef<'a>; + + fn next(&mut self) -> Option { + let entity = self.stack.pop()?; + if let Ok(children) = entity.get(children()) { + self.stack.extend( + children + .iter() + .rev() + .map(|&id| self.world.entity(id).unwrap()), + ); + } + + Some(entity) + } +} + #[derive(Clone, Copy, bytemuck::Pod, bytemuck::Zeroable)] #[repr(C)] /// TODO: move to main renderer diff --git a/violet-wgpu/src/renderer/rect_renderer.rs b/violet-wgpu/src/renderer/rect_renderer.rs index 4ac36a2..4d39684 100644 --- a/violet-wgpu/src/renderer/rect_renderer.rs +++ b/violet-wgpu/src/renderer/rect_renderer.rs @@ -8,7 +8,7 @@ use flax::{ use glam::{vec2, vec3, Mat4, Quat, Vec2, Vec4}; use image::{DynamicImage, ImageBuffer}; use palette::Srgba; -use wgpu::{BindGroup, BindGroupLayout, SamplerDescriptor, ShaderStages}; +use wgpu::{BindGroup, BindGroupLayout, SamplerDescriptor, ShaderStages, TextureFormat}; use violet_core::{ assets::{map::HandleMap, Asset, AssetCache, AssetKey}, @@ -26,10 +26,11 @@ use crate::{ Vertex, VertexDesc, }, mesh_buffer::MeshHandle, - renderer::{srgba_to_vec4, Gpu}, + renderer::{srgba_to_vec4, RendererContext}, + Gpu, }; -use super::{DrawCommand, ObjectData, RendererProps, RendererStore}; +use super::{DrawCommand, ObjectData, RendererStore}; #[derive(Debug, Clone, Hash, PartialEq, Eq)] pub struct ImageFromColor(pub [u8; 4]); @@ -126,20 +127,20 @@ pub struct RectRenderer { impl RectRenderer { pub fn new( - gpu: &mut Gpu, + ctx: &mut RendererContext, frame: &Frame, - props: &mut RendererProps, + color_format: TextureFormat, object_bind_group_layout: &BindGroupLayout, store: &mut RendererStore, ) -> Self { let layout = BindGroupLayoutBuilder::new("RectRenderer::layout") .bind_sampler(ShaderStages::FRAGMENT) .bind_texture(ShaderStages::FRAGMENT) - .build(gpu); + .build(&ctx.gpu); let white_image = frame.assets.load(&ImageFromColor([255, 255, 255, 255])); - let sampler = gpu.device.create_sampler(&SamplerDescriptor { + let sampler = ctx.gpu.device.create_sampler(&SamplerDescriptor { label: Some("ShapeRenderer::sampler"), anisotropy_clamp: 16, mag_filter: wgpu::FilterMode::Linear, @@ -157,16 +158,16 @@ impl RectRenderer { let indices = [0, 1, 2, 2, 3, 0]; - let mesh = Arc::new(props.globals.mesh_buffer.insert(gpu, &vertices, &indices)); + let mesh = Arc::new(ctx.mesh_buffer.insert(&ctx.gpu, &vertices, &indices)); let shader = store.shaders.insert(Shader::new( - gpu, + &ctx.gpu, &ShaderDesc { label: "ShapeRenderer::shader", source: include_str!("../../../assets/shaders/solid.wgsl"), - format: props.color_format, + format: color_format, vertex_layouts: &[Vertex::layout()], - layouts: &[&props.globals.layout, &object_bind_group_layout, &layout], + layouts: &[&ctx.globals_layout, object_bind_group_layout, &layout], }, )); diff --git a/violet-wgpu/src/renderer/text_renderer.rs b/violet-wgpu/src/renderer/text_renderer.rs index a5334c3..536a882 100644 --- a/violet-wgpu/src/renderer/text_renderer.rs +++ b/violet-wgpu/src/renderer/text_renderer.rs @@ -39,7 +39,7 @@ use crate::{ Gpu, }; -use super::{DrawCommand, GlobalBuffers, ObjectData, RendererProps, RendererStore}; +use super::{DrawCommand, ObjectData, RendererContext, RendererStore}; #[derive(Fetch)] struct ObjectQuery { @@ -334,16 +334,17 @@ pub(crate) struct TextRenderer { impl TextRenderer { pub(crate) fn new( - gpu: &mut Gpu, - props: &mut RendererProps, + ctx: &mut RendererContext, + text_system: Arc>, + color_format: TextureFormat, object_layout: &BindGroupLayout, store: &mut RendererStore, ) -> Self { let mesh_generator = MeshGenerator::new( - gpu, - &mut props.globals.mesh_buffer, - &props.globals.layout, - props.color_format, + &mut ctx.gpu, + &mut ctx.mesh_buffer, + &ctx.globals_layout, + color_format, object_layout, store, ); @@ -351,15 +352,14 @@ impl TextRenderer { object_query: Query::new(ObjectQuery::new()).with(text()), mesh_generator, mesh_query: Query::new(TextMeshQuery::new().modified()), - text_system: props.text_system.clone(), - scale_factor: props.scale_factor, + text_system, + scale_factor: 1.0, } } pub fn update_meshes( &mut self, - gpu: &Gpu, - globals: &mut GlobalBuffers, + ctx: &mut RendererContext, frame: &mut Frame, store: &mut RendererStore, ) { @@ -400,12 +400,12 @@ impl TextRenderer { let text_mesh = match item.text_mesh { Some(v) => v, - None => new_mesh.insert(Arc::new(globals.mesh_buffer.allocate(gpu, 0, 0))), + None => new_mesh.insert(Arc::new(ctx.mesh_buffer.allocate(&ctx.gpu, 0, 0))), }; let index_count = self.mesh_generator.update_mesh( - gpu, - &mut globals.mesh_buffer, + &ctx.gpu, + &mut ctx.mesh_buffer, &frame.assets, text_system, &mut item.state.buffer, diff --git a/violet-wgpu/src/renderer/window_renderer.rs b/violet-wgpu/src/renderer/window_renderer.rs index e7a5f0c..5b522ed 100644 --- a/violet-wgpu/src/renderer/window_renderer.rs +++ b/violet-wgpu/src/renderer/window_renderer.rs @@ -5,54 +5,49 @@ use flax::Entity; use glam::Mat4; use parking_lot::Mutex; use puffin::profile_scope; -use wgpu::{Operations, RenderPassDescriptor, StoreOp, SurfaceError}; +use wgpu::SurfaceError; use winit::dpi::{LogicalSize, PhysicalSize}; -use violet_core::{layout::cache::LayoutUpdate, Frame}; +use violet_core::{layout::cache::LayoutUpdateEvent, Frame}; -use crate::{graphics::Surface, text::TextSystem}; +use crate::{graphics::Surface, text::TextSystem, Gpu}; -use super::{GlobalBuffers, Gpu, MainRenderer, RendererConfig, RendererProps}; +use super::{MainRenderer, MainRendererConfig, RendererContext}; /// Renders to a window surface pub struct WindowRenderer { - gpu: Gpu, surface: Surface, - globals: GlobalBuffers, + + ctx: RendererContext, main_renderer: MainRenderer, } impl WindowRenderer { pub fn new( frame: &mut Frame, - mut gpu: Gpu, + gpu: Gpu, root: Entity, text_system: Arc>, surface: Surface, - layout_changes_rx: flume::Receiver<(Entity, LayoutUpdate)>, - scale_factor: f64, - config: RendererConfig, + layout_changes_rx: flume::Receiver<(Entity, LayoutUpdateEvent)>, + config: MainRendererConfig, ) -> Self { - let mut globals = GlobalBuffers::new(&mut gpu); + let mut ctx = RendererContext::new(gpu); + let widget_renderer = MainRenderer::new( frame, - &mut gpu, - RendererProps { - root, - text_system, - color_format: surface.surface_format(), - globals: &mut globals, - layout_changes_rx, - config, - scale_factor, - }, + &mut ctx, + root, + text_system, + surface.surface_format(), + layout_changes_rx, + config, ); Self { surface, main_renderer: widget_renderer, - globals, - gpu, + ctx, } } @@ -62,14 +57,14 @@ impl WindowRenderer { let h = logical_size.height; // tracing::info!("resizing canvas size to {w}x{h}"); - self.globals.globals.projview = Mat4::orthographic_lh(0.0, w, h, 0.0, 0.0, 1000.0); - self.globals + self.ctx.globals.projview = Mat4::orthographic_lh(0.0, w, h, 0.0, 0.0, 1000.0); + self.ctx .globals_buffer - .write(&self.gpu.queue, 0, &[self.globals.globals]); + .write(&self.ctx.gpu.queue, 0, &[self.ctx.globals]); self.main_renderer - .resize(&self.gpu, physical_size, scale_factor); - self.surface.resize(&self.gpu, physical_size); + .resize(&self.ctx.gpu, physical_size, scale_factor); + self.surface.resize(&self.ctx.gpu, physical_size); } pub fn draw(&mut self, frame: &mut Frame) -> anyhow::Result<()> { @@ -80,49 +75,31 @@ impl WindowRenderer { let target = match self.surface.get_current_texture() { Ok(v) => v, Err(SurfaceError::Lost | SurfaceError::Outdated) => { - self.surface.reconfigure(&self.gpu); + self.surface.reconfigure(&self.ctx.gpu); return Ok(()); } Err(err) => return Err(err).context("Failed to acquire surface texture"), }; + self.main_renderer.update(&mut self.ctx, frame)?; + let view = target.texture.create_view(&Default::default()); - let mut encoder = self - .gpu - .device - .create_command_encoder(&wgpu::CommandEncoderDescriptor { - label: Some("WindowRenderer::draw"), - }); + let mut encoder = + self.ctx + .gpu + .device + .create_command_encoder(&wgpu::CommandEncoderDescriptor { + label: Some("WindowRenderer::draw"), + }); - { - let mut render_pass = encoder.begin_render_pass(&RenderPassDescriptor { - label: Some("WindowRenderer::draw"), - color_attachments: &[Some(wgpu::RenderPassColorAttachment { - view: &view, - resolve_target: None, - ops: Operations { - load: wgpu::LoadOp::Clear(wgpu::Color { - r: 0.4, - g: 0.05, - b: 0.2, - a: 1.0, - }), - store: StoreOp::Store, - }, - })], - depth_stencil_attachment: None, - ..Default::default() - }); - - self.main_renderer - .draw(&self.gpu, &mut self.globals, frame, &mut render_pass) - .context("Failed to draw shapes")?; - } + self.main_renderer + .draw(&mut self.ctx, frame, &mut encoder, &view) + .context("Failed to draw shapes")?; { profile_scope!("submit"); - self.gpu.queue.submit([encoder.finish()]); + self.ctx.gpu.queue.submit([encoder.finish()]); target.present(); } From 0a96493ce463cbb3d81ef4f343c9bc8d1f639b12 Mon Sep 17 00:00:00 2001 From: Tei Leelo Roberts Date: Fri, 16 Aug 2024 12:47:16 +0200 Subject: [PATCH 2/6] chore: update deps --- .gitmodules | 3 - Cargo.lock | 1727 ++++++++++++-------- Cargo.toml | 38 +- violet-core/src/assets/mod.rs | 4 - violet-core/src/assets/provider.rs | 6 - violet-core/src/layout/float.rs | 17 +- violet-core/src/layout/flow.rs | 40 +- violet-core/src/layout/mod.rs | 68 +- violet-core/src/layout/stack.rs | 26 +- violet-core/src/systems.rs | 1 - violet-core/src/widget/mod.rs | 6 +- violet-demo/src/palettes/editor.rs | 2 +- violet-wgpu/src/app.rs | 423 +++-- violet-wgpu/src/graphics/gpu.rs | 127 +- violet-wgpu/src/graphics/shader.rs | 22 +- violet-wgpu/src/renderer/debug_renderer.rs | 118 +- violet-wgpu/src/renderer/rect_renderer.rs | 10 +- violet-wgpu/src/renderer/text_renderer.rs | 4 +- violet-wgpu/src/systems.rs | 2 +- violet-wgpu/src/text.rs | 4 +- 20 files changed, 1400 insertions(+), 1248 deletions(-) delete mode 100644 violet-core/src/assets/provider.rs diff --git a/.gitmodules b/.gitmodules index 3eb6e5e..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "flax"] - path = flax - url = https://github.com/ten3roberts/flax diff --git a/Cargo.lock b/Cargo.lock index 35c1252..fb51238 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "ab_glyph" -version = "0.2.23" +version = "0.2.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80179d7dd5d7e8c285d67c4a1e652972a92de7475beddfb92028c76463b13225" +checksum = "79faae4620f45232f599d9bc7b290f88247a0834162c4495ab2f02d60004adfb" dependencies = [ "ab_glyph_rasterizer", "owned_ttf_parser", @@ -20,9 +20,9 @@ checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" [[package]] name = "addr2line" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "gimli", ] @@ -35,9 +35,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.8.7" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "getrandom", @@ -48,27 +48,27 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "android-activity" -version = "0.5.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee91c0c2905bae44f84bfa4e044536541df26b7703fd0888deeb9060fcc44289" +checksum = "ef6978589202a00cd7e118380c448a08b6ed394c3a8df3a430d0898e3a42d046" dependencies = [ "android-properties", - "bitflags 2.4.2", + "bitflags 2.6.0", "cc", "cesu8", "jni", @@ -77,7 +77,7 @@ dependencies = [ "log", "ndk", "ndk-context", - "ndk-sys", + "ndk-sys 0.6.0+11769913", "num_enum", "thiserror", ] @@ -99,9 +99,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "approx" @@ -114,28 +114,27 @@ dependencies = [ [[package]] name = "arboard" -version = "3.3.2" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2041f1943049c7978768d84e6d0fd95de98b76d6c4727b09e78ec253d29fa58" +checksum = "9fb4009533e8ff8f1450a5bcbc30f4242a1d34442221f72314bea1f5dc9c7f89" dependencies = [ "clipboard-win", "core-graphics", - "image 0.24.9", + "image", "log", - "objc", - "objc-foundation", - "objc_id", + "objc2", + "objc2-app-kit", + "objc2-foundation", "parking_lot", - "thiserror", "windows-sys 0.48.0", "x11rb", ] [[package]] name = "arrayref" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" +checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" [[package]] name = "arrayvec" @@ -151,11 +150,11 @@ checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" [[package]] name = "ash" -version = "0.37.3+1.3.251" +version = "0.38.0+1.3.281" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e9c3835d686b0a6084ab4234fcd1b07dbf6e4767dce60874b12356a25ecd4a" +checksum = "0bb44936d800fea8f016d7f2311c6a4f97aebd5dc86f09906139ec848cf3a46f" dependencies = [ - "libloading 0.7.4", + "libloading", ] [[package]] @@ -178,90 +177,79 @@ dependencies = [ [[package]] name = "async-broadcast" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258b52a1aa741b9f09783b2d86cf0aeeb617bbf847f6933340a39644227acbdb" +checksum = "20cd0e2e25ea8e5f7e9df04578dc6cf5c83577fd09b1a46aaf5c85e1c33f2a7e" dependencies = [ - "event-listener 5.2.0", - "event-listener-strategy 0.5.0", + "event-listener", + "event-listener-strategy", "futures-core", "pin-project-lite", ] [[package]] name = "async-channel" -version = "2.2.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" dependencies = [ "concurrent-queue", - "event-listener 5.2.0", - "event-listener-strategy 0.5.0", + "event-listener-strategy", "futures-core", "pin-project-lite", ] [[package]] name = "async-executor" -version = "1.8.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" +checksum = "d7ebdfa2ebdab6b1760375fa7d6f382b9f486eac35fc994625a00e89280bdbb7" dependencies = [ - "async-lock 3.3.0", "async-task", "concurrent-queue", - "fastrand", - "futures-lite", + "fastrand 2.1.0", + "futures-lite 2.3.0", "slab", ] [[package]] name = "async-fs" -version = "2.1.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc19683171f287921f2405677dd2ed2549c3b3bda697a563ebc3a121ace2aba1" +checksum = "ebcd09b382f40fcd159c2d695175b2ae620ffa5f3bd6f664131efff4e8b9e04a" dependencies = [ - "async-lock 3.3.0", + "async-lock", "blocking", - "futures-lite", + "futures-lite 2.3.0", ] [[package]] name = "async-io" -version = "2.3.2" +version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884" +checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" dependencies = [ - "async-lock 3.3.0", + "async-lock", "cfg-if", "concurrent-queue", "futures-io", - "futures-lite", + "futures-lite 2.3.0", "parking", "polling", "rustix", "slab", "tracing", - "windows-sys 0.52.0", -] - -[[package]] -name = "async-lock" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" -dependencies = [ - "event-listener 2.5.3", + "windows-sys 0.59.0", ] [[package]] name = "async-lock" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener 4.0.3", - "event-listener-strategy 0.4.0", + "event-listener", + "event-listener-strategy", "pin-project-lite", ] @@ -273,46 +261,48 @@ checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7" dependencies = [ "async-io", "blocking", - "futures-lite", + "futures-lite 2.3.0", ] [[package]] name = "async-process" -version = "2.1.0" +version = "2.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "451e3cf68011bd56771c79db04a9e333095ab6349f7e47592b788e9b98720cc8" +checksum = "a8a07789659a4d385b79b18b9127fc27e1a59e1e89117c78c5ea3b806f016374" dependencies = [ "async-channel", "async-io", - "async-lock 3.3.0", + "async-lock", "async-signal", + "async-task", "blocking", "cfg-if", - "event-listener 5.2.0", - "futures-lite", + "event-listener", + "futures-lite 2.3.0", "rustix", - "windows-sys 0.52.0", + "tracing", + "windows-sys 0.59.0", ] [[package]] name = "async-recursion" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30c5ef0ede93efbf733c1a727f3b6b5a1060bbedd5600183e66f6e4be4af0ec5" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.74", ] [[package]] name = "async-signal" -version = "0.2.5" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" +checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3" dependencies = [ "async-io", - "async-lock 2.8.0", + "async-lock", "atomic-waker", "cfg-if", "futures-core", @@ -320,24 +310,24 @@ dependencies = [ "rustix", "signal-hook-registry", "slab", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] name = "async-task" -version = "4.7.0" +version = "4.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.78" +version = "0.1.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "461abc97219de0eaaf81fe3ef974a540158f3d079c2ab200f891f1a2ef201e85" +checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.74", ] [[package]] @@ -354,15 +344,15 @@ checksum = "41e67cd8309bbd06cd603a9e693a784ac2e5d1e955f11286e355089fcab3047c" [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", @@ -384,18 +374,18 @@ dependencies = [ [[package]] name = "bit-set" -version = "0.5.3" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +checksum = "f0481a0e032742109b1133a095184ee93d88f3dc9e0d28a5d033dc77a073f44f" dependencies = [ "bit-vec", ] [[package]] name = "bit-vec" -version = "0.6.3" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +checksum = "d2c54ff287cfc0a34f38a6b832ea1bd8e448a330b3e40a50859e6488bee07f22" [[package]] name = "bitflags" @@ -405,9 +395,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bitvec" @@ -436,65 +426,58 @@ dependencies = [ "generic-array", ] -[[package]] -name = "block-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae85a0696e7ea3b835a453750bf002770776609115e6d25c6d2ff28a8200f7e7" -dependencies = [ - "objc-sys", -] - [[package]] name = "block2" -version = "0.3.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15b55663a85f33501257357e6421bb33e769d5c9ffb5ba0921c975a123e35e68" +checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" dependencies = [ - "block-sys", "objc2", ] [[package]] name = "blocking" -version = "1.5.1" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" dependencies = [ "async-channel", - "async-lock 3.3.0", "async-task", - "fastrand", "futures-io", - "futures-lite", + "futures-lite 2.3.0", "piper", - "tracing", ] [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "by_address" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64fa3c856b712db6612c019f14756e64e4bcea13337a6b33b696333a9eaa2d06" [[package]] name = "bytemuck" -version = "1.14.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" +checksum = "6fd4c6dcc3b0aea2f5c0b4b82c2b15fe39ddbc76041a310848f4706edf76bb31" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.5.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" +checksum = "0cc8b54b395f2fcfbb3d90c47b01c7f444d94d05bdeb775811dec868ac3bbc26" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.74", ] [[package]] @@ -503,19 +486,25 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +[[package]] +name = "byteorder-lite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" + [[package]] name = "bytes" -version = "1.5.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "calloop" -version = "0.12.4" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fba7adb4dd5aa98e5553510223000e7148f621165ec5f9acd7113f6ca4995298" +checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "log", "polling", "rustix", @@ -525,9 +514,9 @@ dependencies = [ [[package]] name = "calloop-wayland-source" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f0ea9b9476c7fad82841a8dbb380e2eae480c21910feba80725b46931ed8f02" +checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20" dependencies = [ "calloop", "rustix", @@ -537,12 +526,13 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.83" +version = "1.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "72db2f7947ecee9b03b510377e8bb9077afa27176fdbff55c51027e976fdcc48" dependencies = [ "jobserver", "libc", + "shlex", ] [[package]] @@ -563,11 +553,17 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "clipboard-win" -version = "5.3.0" +version = "5.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d517d4b86184dbb111d3556a10f1c8a04da7428d2987bf1081602bf11c3aa9ee" +checksum = "15efe7a882b08f34e38556b14f2fb3daa98769d06c7f0c1b076dfd0d983bc892" dependencies = [ "error-code", ] @@ -588,12 +584,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ecdffb913a326b6c642290a0d0ec8e8d6597291acdc07cc4c9cb4b3635d44cf9" -[[package]] -name = "color_quant" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" - [[package]] name = "com" version = "0.6.0" @@ -627,9 +617,9 @@ dependencies = [ [[package]] name = "combine" -version = "4.6.6" +version = "4.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" dependencies = [ "bytes", "memchr", @@ -637,9 +627,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ "crossbeam-utils", ] @@ -666,15 +656,15 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "core-graphics" -version = "0.23.1" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "970a29baf4110c26fedbc7f82107d42c23f7e88e404c4577ed73fe99ff85a212" +checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -696,21 +686,21 @@ dependencies = [ [[package]] name = "cosmic-text" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fd9190de5c4b7d91a785c8ebf1cf1c1ecbfc1731eb0a171b3cb0972f58b4995" +checksum = "59fd57d82eb4bfe7ffa9b1cec0c05e2fd378155b47f255a67983cb4afe0e80c2" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "fontdb", - "libm", "log", "rangemap", + "rayon", "rustc-hash", "rustybuzz", "self_cell", "swash", "sys-locale", - "ttf-parser", + "ttf-parser 0.21.1", "unicode-bidi", "unicode-linebreak", "unicode-script", @@ -719,27 +709,27 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" dependencies = [ "libc", ] [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-channel" -version = "0.5.11" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ "crossbeam-utils", ] @@ -765,9 +755,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crypto-common" @@ -787,11 +777,12 @@ checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" [[package]] name = "dashmap" -version = "5.5.3" +version = "6.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +checksum = "804c8821570c3f8b70230c2ba75ffa5c0f9a4189b9a432b6656c536712acae28" dependencies = [ "cfg-if", + "crossbeam-utils", "hashbrown", "lock_api", "once_cell", @@ -809,6 +800,16 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "diatomic-waker" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92a510eb4dc7fa435297888c00e0f999aa2ee3e920a357221c35ab615a80bbcf" +dependencies = [ + "loom", + "waker-fn", +] + [[package]] name = "digest" version = "0.10.7" @@ -837,20 +838,35 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libloading 0.8.1", + "libloading", +] + +[[package]] +name = "document-features" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" +dependencies = [ + "litrs", ] [[package]] name = "downcast-rs" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + +[[package]] +name = "dpi" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f25c0e292a7ca6d6498557ff1df68f32c99850012b6ea401cf8daf771f22ff53" [[package]] name = "either" -version = "1.10.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "endi" @@ -860,9 +876,9 @@ checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" [[package]] name = "enumflags2" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3278c9d5fb675e0a51dabcf4c0d355f692b064171535ba72361be1528a9d8e8d" +checksum = "d232db7f5956f3f14313dc2f87985c58bd2c695ce124c8cdd984e08e15ac133d" dependencies = [ "enumflags2_derive", "serde", @@ -870,13 +886,13 @@ dependencies = [ [[package]] name = "enumflags2_derive" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" +checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.74", ] [[package]] @@ -887,9 +903,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -903,24 +919,18 @@ checksum = "a0474425d51df81997e2f90a21591180b38eccf27292d755f3e30750225c175b" [[package]] name = "euclid" -version = "0.22.9" +version = "0.22.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f253bc5c813ca05792837a0ff4b3a580336b224512d48f7eda1d7dd9210787" +checksum = "e0f0eb73b934648cd7a4a61f1b15391cd95dab0b4da6e2e66c2a072c144b4a20" dependencies = [ "num-traits", ] [[package]] name = "event-listener" -version = "2.5.3" +version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - -[[package]] -name = "event-listener" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" dependencies = [ "concurrent-queue", "parking", @@ -928,47 +938,35 @@ dependencies = [ ] [[package]] -name = "event-listener" -version = "5.2.0" +name = "event-listener-strategy" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b5fb89194fa3cad959b833185b3063ba881dbfc7030680b314250779fb4cc91" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ - "concurrent-queue", - "parking", + "event-listener", "pin-project-lite", ] [[package]] -name = "event-listener-strategy" -version = "0.4.0" +name = "fast-srgb8" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" -dependencies = [ - "event-listener 4.0.3", - "pin-project-lite", -] +checksum = "dd2e7510819d6fbf51a5545c8f922716ecfb14df168a3242f7d33e0239efe6a1" [[package]] -name = "event-listener-strategy" -version = "0.5.0" +name = "fastrand" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feedafcaa9b749175d5ac357452a9d41ea2911da598fde46ce1fe02c37751291" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" dependencies = [ - "event-listener 5.2.0", - "pin-project-lite", + "instant", ] -[[package]] -name = "fast-srgb8" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd2e7510819d6fbf51a5545c8f922716ecfb14df168a3242f7d33e0239efe6a1" - [[package]] name = "fastrand" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "fdeflate" @@ -981,9 +979,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "7f211bbe8e69bbd0cfdea405084f128ae8b4aaa6b0b522fc8f2b009084797920" dependencies = [ "crc32fast", "miniz_oxide", @@ -991,14 +989,15 @@ dependencies = [ [[package]] name = "flax" -version = "0.6.2" +version = "0.7.1" +source = "git+https://github.com/ten3roberts/flax#02f9f375c119b487ede481cce0a2bd27f6fb3fda" dependencies = [ "anyhow", "atomic_refcell", - "bitflags 2.4.2", + "bitflags 2.6.0", "flax-derive", "flume", - "itertools 0.11.0", + "itertools 0.12.1", "once_cell", "puffin", "rayon", @@ -1008,13 +1007,14 @@ dependencies = [ [[package]] name = "flax-derive" -version = "0.6.0" +version = "0.7.1" +source = "git+https://github.com/ten3roberts/flax#02f9f375c119b487ede481cce0a2bd27f6fb3fda" dependencies = [ "itertools 0.11.0", - "proc-macro-crate 2.0.1", + "proc-macro-crate 2.0.2", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.74", ] [[package]] @@ -1031,31 +1031,34 @@ dependencies = [ [[package]] name = "font-types" -version = "0.4.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bd7f3ea17572640b606b35df42cfb6ecdf003704b062580e59918692190b73d" +checksum = "8f0189ccb084f77c5523e08288d418cbaa09c451a08515678a0aa265df9a8b60" +dependencies = [ + "bytemuck", +] [[package]] name = "fontconfig-parser" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a595cb550439a117696039dfc69830492058211b771a2a165379f2a1a53d84d" +checksum = "c1fcfcd44ca6e90c921fee9fa665d530b21ef1327a4c1a6c5250ea44b776ada7" dependencies = [ "roxmltree", ] [[package]] name = "fontdb" -version = "0.16.0" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98b88c54a38407f7352dd2c4238830115a6377741098ffd1f997c813d0e088a6" +checksum = "b0299020c3ef3f60f526a4f64ab4a3d4ce116b1acbf24cdd22da0068e5d81dc3" dependencies = [ "fontconfig-parser", "log", "memmap2", "slotmap", "tinyvec", - "ttf-parser", + "ttf-parser 0.20.0", ] [[package]] @@ -1076,7 +1079,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.74", ] [[package]] @@ -1115,6 +1118,17 @@ dependencies = [ "futures-util", ] +[[package]] +name = "futures-buffered" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91fa130f3777d0d4b0993653c20bc433026d3290627693c4ed1b18dd237357ab" +dependencies = [ + "diatomic-waker", + "futures-core", + "pin-project-lite", +] + [[package]] name = "futures-channel" version = "0.3.30" @@ -1127,12 +1141,14 @@ dependencies = [ [[package]] name = "futures-concurrency" -version = "7.4.3" +version = "7.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef6712e11cdeed5c8cf21ea0b90fec40fbe64afc9bbf2339356197eeca829fc3" +checksum = "4b14ac911e85d57c5ea6eef76d7b4d4a3177ecd15f4bea2e61927e9e3823e19f" dependencies = [ "bitvec", + "futures-buffered", "futures-core", + "futures-lite 1.13.0", "pin-project", "slab", "smallvec", @@ -1161,13 +1177,28 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +[[package]] +name = "futures-lite" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +dependencies = [ + "fastrand 1.9.0", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + [[package]] name = "futures-lite" version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ - "fastrand", + "fastrand 2.1.0", "futures-core", "futures-io", "parking", @@ -1182,14 +1213,14 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.74", ] [[package]] name = "futures-signals" -version = "0.3.33" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b175f2f6600dd81d92d20cf10872b03ea9df6b2513ca7f672341260dacb1ab2" +checksum = "70abe9c40a0dccd69bf7c59ba58714ebeb6c15a88143a10c6be7130e895f1696" dependencies = [ "discard", "futures-channel", @@ -1231,6 +1262,19 @@ dependencies = [ "slab", ] +[[package]] +name = "generator" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e" +dependencies = [ + "cc", + "libc", + "log", + "rustversion", + "windows 0.48.0", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -1249,7 +1293,7 @@ checksum = "913dce4c5f06c2ea40fc178c06f777ac89fc6b1383e90c254fafb1abe4ba3c82" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.74", "uuid", ] @@ -1265,9 +1309,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "js-sys", @@ -1278,9 +1322,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "gl_generator" @@ -1295,9 +1339,9 @@ dependencies = [ [[package]] name = "glam" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e05e7e6723e3455f4818c7b26e855439f7546cf617ef669d1adedb8669e5cb9" +checksum = "779ae4bf7e8421cf91c0b3b64e7e8b40b862fba4d393f59150042de7c4965a94" dependencies = [ "bytemuck", ] @@ -1326,9 +1370,9 @@ dependencies = [ [[package]] name = "glutin_wgl_sys" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8098adac955faa2d31079b65dc48841251f69efd3ac25477903fc424362ead" +checksum = "0a4e1951bbd9434a81aa496fe59ccc2235af3820d27b85f9314e279609211e2c" dependencies = [ "gl_generator", ] @@ -1339,7 +1383,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "gpu-alloc-types", ] @@ -1349,40 +1393,40 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", ] [[package]] name = "gpu-allocator" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f56f6318968d03c18e1bcf4857ff88c61157e9da8e47c5f29055d60e1228884" +checksum = "fdd4240fc91d3433d5e5b0fc5b67672d771850dc19bbee03c1381e19322803d7" dependencies = [ "log", "presser", "thiserror", "winapi", - "windows", + "windows 0.52.0", ] [[package]] name = "gpu-descriptor" -version = "0.2.4" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc11df1ace8e7e564511f53af41f3e42ddc95b56fd07b3f4445d2a6048bc682c" +checksum = "9c08c1f623a8d0b722b8b99f821eb0ba672a1618f0d3b16ddbee1cedd2dd8557" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "gpu-descriptor-types", "hashbrown", ] [[package]] name = "gpu-descriptor-types" -version = "0.1.2" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bf0b36e6f090b7e1d8a4b49c0cb81c1f8376f72198c65dd3ad9ff3556b8b78c" +checksum = "fdf242682df893b86f33a73828fb09ca4b2d3bb6cc95249707fc684d27484b91" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", ] [[package]] @@ -1397,9 +1441,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", "allocator-api2", @@ -1411,10 +1455,10 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af2a7e73e1f34c48da31fb668a907f250794837e08faa144fd24f0b8b741e890" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "com", "libc", - "libloading 0.8.1", + "libloading", "thiserror", "widestring", "winapi", @@ -1426,6 +1470,12 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + [[package]] name = "hex" version = "0.4.3" @@ -1438,17 +1488,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" -[[package]] -name = "icrate" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d3aaff8a54577104bafdf686ff18565c3b6903ca5782a2026ef06e2c7aa319" -dependencies = [ - "block2", - "dispatch", - "objc2", -] - [[package]] name = "idna" version = "0.5.0" @@ -1461,43 +1500,48 @@ dependencies = [ [[package]] name = "image" -version = "0.24.9" +version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5690139d2f55868e080017335e4b94cb7414274c74f1669c84fb5feba2c9f69d" +checksum = "99314c8a2152b8ddb211f924cdae532d8c5e4c8bb54728e12fff1b0cd5963a10" dependencies = [ "bytemuck", - "byteorder", - "color_quant", + "byteorder-lite", "num-traits", "png", "tiff", -] - -[[package]] -name = "image" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9b4f005360d32e9325029b38ba47ebd7a56f3316df09249368939562d518645" -dependencies = [ - "bytemuck", - "byteorder", - "num-traits", - "png", "zune-core", "zune-jpeg", ] [[package]] name = "indexmap" -version = "2.1.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" dependencies = [ "equivalent", "hashbrown", "serde", ] +[[package]] +name = "instant" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.11.0" @@ -1516,11 +1560,20 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jni" @@ -1546,9 +1599,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "jobserver" -version = "0.1.28" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" dependencies = [ "libc", ] @@ -1561,9 +1614,9 @@ checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" [[package]] name = "js-sys" -version = "0.3.67" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] @@ -1575,7 +1628,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" dependencies = [ "libc", - "libloading 0.8.1", + "libloading", "pkg-config", ] @@ -1587,34 +1640,24 @@ checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.152" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" - -[[package]] -name = "libloading" -version = "0.7.4" +version = "0.2.156" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" -dependencies = [ - "cfg-if", - "winapi", -] +checksum = "a5f43f184355eefb8d17fc948dbecf6c13be3c141f20d834ae842193a448c72a" [[package]] name = "libloading" -version = "0.8.1" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" +checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "windows-sys 0.48.0", + "windows-targets 0.52.6", ] [[package]] @@ -1629,22 +1672,28 @@ version = "0.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3af92c55d7d839293953fcd0fda5ecfe93297cfde6ffbdec13b41d99c0ba6607" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "libc", "redox_syscall 0.4.1", ] [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "litrs" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -1652,24 +1701,37 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[package]] +name = "loom" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" +dependencies = [ + "cfg-if", + "generator", + "scoped-tls", + "tracing", + "tracing-subscriber", +] [[package]] name = "lru" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" +checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904" dependencies = [ "hashbrown", ] [[package]] name = "lz4_flex" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "912b45c753ff5f7f5208307e8ace7d2a2e30d024e26d3509f3dce546c044ce15" +checksum = "75761162ae2b0e580d7e7c390558127e5f01b4194debd6221fd8c207fc80e3f5" [[package]] name = "malloc_buf" @@ -1691,9 +1753,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" @@ -1706,20 +1768,20 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" dependencies = [ "autocfg", ] [[package]] name = "metal" -version = "0.27.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43f73953f8cbe511f021b58f18c3ce1c3d1ae13fe953293e13345bf83217f25" +checksum = "7ecfd3296f8c56b7c1f6fbac3c71cefa9d78ce009850c45000015f206dc7fa21" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "block", "core-graphics-types", "foreign-types", @@ -1736,9 +1798,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", "simd-adler32", @@ -1752,17 +1814,18 @@ checksum = "1fafa6961cabd9c63bcd77a45d7e3b7f3b552b70417831fb0f56db717e72407e" [[package]] name = "naga" -version = "0.19.0" +version = "22.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8878eb410fc90853da3908aebfe61d73d26d4437ef850b70050461f939509899" +checksum = "8bd5a652b6faf21496f2cfd88fc49989c8db0825d1f6746b1a71a6ede24a63ad" dependencies = [ + "arrayvec", "bit-set", - "bitflags 2.4.2", + "bitflags 2.6.0", + "cfg_aliases 0.1.1", "codespan-reporting", "hexf-parse", "indexmap", "log", - "num-traits", "rustc-hash", "spirv", "termcolor", @@ -1781,14 +1844,14 @@ dependencies = [ [[package]] name = "ndk" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7" +checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "jni-sys", "log", - "ndk-sys", + "ndk-sys 0.6.0+11769913", "num_enum", "raw-window-handle", "thiserror", @@ -1810,126 +1873,306 @@ dependencies = [ ] [[package]] -name = "nix" -version = "0.27.1" +name = "ndk-sys" +version = "0.6.0+11769913" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" +dependencies = [ + "jni-sys", +] + +[[package]] +name = "nix" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +dependencies = [ + "bitflags 2.6.0", + "cfg-if", + "libc", + "memoffset", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "nu-ansi-term" +version = "0.50.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4a28e057d01f97e61255210fcff094d74ed0466038633e95017f5beb68e4399" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_enum" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" +dependencies = [ + "proc-macro-crate 2.0.2", + "proc-macro2", + "quote", + "syn 2.0.74", +] + +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", +] + +[[package]] +name = "objc-foundation" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" +dependencies = [ + "block", + "objc", + "objc_id", +] + +[[package]] +name = "objc-sys" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" + +[[package]] +name = "objc2" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" +dependencies = [ + "objc-sys", + "objc2-encode", +] + +[[package]] +name = "objc2-app-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" +dependencies = [ + "bitflags 2.6.0", + "block2", + "libc", + "objc2", + "objc2-core-data", + "objc2-core-image", + "objc2-foundation", + "objc2-quartz-core", +] + +[[package]] +name = "objc2-cloud-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-core-location", + "objc2-foundation", +] + +[[package]] +name = "objc2-contacts" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +checksum = "a5ff520e9c33812fd374d8deecef01d4a840e7b41862d849513de77e44aa4889" dependencies = [ - "bitflags 2.4.2", - "cfg-if", - "libc", - "memoffset", + "block2", + "objc2", + "objc2-foundation", ] [[package]] -name = "nom" -version = "7.1.3" +name = "objc2-core-data" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" dependencies = [ - "memchr", - "minimal-lexical", + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-foundation", ] [[package]] -name = "nu-ansi-term" -version = "0.46.0" +name = "objc2-core-image" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" dependencies = [ - "overload", - "winapi", + "block2", + "objc2", + "objc2-foundation", + "objc2-metal", ] [[package]] -name = "nu-ansi-term" -version = "0.49.0" +name = "objc2-core-location" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c073d3c1930d0751774acf49e66653acecb416c3a54c6ec095a9b11caddb5a68" +checksum = "000cfee34e683244f284252ee206a27953279d370e309649dc3ee317b37e5781" dependencies = [ - "windows-sys 0.48.0", + "block2", + "objc2", + "objc2-contacts", + "objc2-foundation", ] [[package]] -name = "num-traits" -version = "0.2.17" +name = "objc2-encode" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] +checksum = "7891e71393cd1f227313c9379a26a584ff3d7e6e7159e988851f0934c993f0f8" [[package]] -name = "num_enum" -version = "0.7.2" +name = "objc2-foundation" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" dependencies = [ - "num_enum_derive", + "bitflags 2.6.0", + "block2", + "dispatch", + "libc", + "objc2", ] [[package]] -name = "num_enum_derive" -version = "0.7.2" +name = "objc2-link-presentation" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +checksum = "a1a1ae721c5e35be65f01a03b6d2ac13a54cb4fa70d8a5da293d7b0020261398" dependencies = [ - "proc-macro-crate 2.0.1", - "proc-macro2", - "quote", - "syn 2.0.48", + "block2", + "objc2", + "objc2-app-kit", + "objc2-foundation", ] [[package]] -name = "objc" -version = "0.2.7" +name = "objc2-metal" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" dependencies = [ - "malloc_buf", - "objc_exception", + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-foundation", ] [[package]] -name = "objc-foundation" -version = "0.1.1" +name = "objc2-quartz-core" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" +checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" dependencies = [ - "block", - "objc", - "objc_id", + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-foundation", + "objc2-metal", ] [[package]] -name = "objc-sys" -version = "0.3.2" +name = "objc2-symbols" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7c71324e4180d0899963fc83d9d241ac39e699609fc1025a850aadac8257459" +checksum = "0a684efe3dec1b305badae1a28f6555f6ddd3bb2c2267896782858d5a78404dc" +dependencies = [ + "objc2", + "objc2-foundation", +] [[package]] -name = "objc2" -version = "0.4.1" +name = "objc2-ui-kit" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "559c5a40fdd30eb5e344fbceacf7595a81e242529fb4e21cf5f43fb4f11ff98d" +checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f" dependencies = [ - "objc-sys", - "objc2-encode", + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-cloud-kit", + "objc2-core-data", + "objc2-core-image", + "objc2-core-location", + "objc2-foundation", + "objc2-link-presentation", + "objc2-quartz-core", + "objc2-symbols", + "objc2-uniform-type-identifiers", + "objc2-user-notifications", ] [[package]] -name = "objc2-encode" -version = "3.0.0" +name = "objc2-uniform-type-identifiers" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d079845b37af429bfe5dfa76e6d087d788031045b25cfc6fd898486fd9847666" +checksum = "44fa5f9748dbfe1ca6c0b79ad20725a11eca7c2218bceb4b005cb1be26273bfe" +dependencies = [ + "block2", + "objc2", + "objc2-foundation", +] [[package]] -name = "objc_exception" -version = "0.1.2" +name = "objc2-user-notifications" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" +checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3" dependencies = [ - "cc", + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-core-location", + "objc2-foundation", ] [[package]] @@ -1943,9 +2186,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.2" +version = "0.36.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9" dependencies = [ "memchr", ] @@ -1967,9 +2210,9 @@ dependencies = [ [[package]] name = "ordered-float" -version = "4.2.0" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76df7075c7d4d01fdcb46c912dd17fba5b60c78ea480b475f2b6ab6f666584e" +checksum = "4a91171844676f8c7990ce64959210cd2eaef32c2612c50f9fae9f8aaa6065a6" dependencies = [ "num-traits", ] @@ -1992,17 +2235,17 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "owned_ttf_parser" -version = "0.20.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4586edfe4c648c71797a74c84bacb32b52b212eff5dfe2bb9f2c599844023e7" +checksum = "490d3a563d3122bf7c911a59b0add9389e5ec0f5f0c3ac6b91ff235a0e6a7f90" dependencies = [ - "ttf-parser", + "ttf-parser 0.24.1", ] [[package]] name = "palette" -version = "0.7.5" -source = "git+https://github.com/Ogeon/palette#c54efbd43c03267713da337bd72005c9d0390598" +version = "0.7.6" +source = "git+https://github.com/Ogeon/palette#fab441283dc4b7307cb1b8b8cc1153214861c1fe" dependencies = [ "approx", "fast-srgb8", @@ -2013,12 +2256,13 @@ dependencies = [ [[package]] name = "palette_derive" -version = "0.7.5" -source = "git+https://github.com/Ogeon/palette#c54efbd43c03267713da337bd72005c9d0390598" +version = "0.7.6" +source = "git+https://github.com/Ogeon/palette#fab441283dc4b7307cb1b8b8cc1153214861c1fe" dependencies = [ + "by_address", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.74", ] [[package]] @@ -2029,9 +2273,9 @@ checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -2039,22 +2283,22 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", + "redox_syscall 0.5.3", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "percent-encoding" @@ -2092,7 +2336,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.74", ] [[package]] @@ -2106,29 +2350,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.3" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.3" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.74", ] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -2138,26 +2382,26 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "piper" -version = "0.2.1" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" dependencies = [ "atomic-waker", - "fastrand", + "fastrand 2.1.0", "futures-io", ] [[package]] name = "pkg-config" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "png" -version = "0.17.11" +version = "0.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f6c3c3e617595665b8ea2ff95a86066be38fb121ff920a9c0eb282abcd1da5a" +checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1" dependencies = [ "bitflags 1.3.2", "crc32fast", @@ -2168,16 +2412,17 @@ dependencies = [ [[package]] name = "polling" -version = "3.5.0" +version = "3.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24f040dee2588b4963afb4e420540439d126f73fdacf4a9c486a96d840bac3c9" +checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" dependencies = [ "cfg-if", "concurrent-queue", + "hermit-abi", "pin-project-lite", "rustix", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2188,9 +2433,12 @@ checksum = "22686f4785f02a4fcc856d3b3bb19bf6c8160d103f7a99cc258bddd0251dc7f2" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "presser" @@ -2210,9 +2458,9 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "2.0.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97dc5fea232fc28d2f597b37c4876b348a40e33f3b02cc975c8d006d78d94b1a" +checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" dependencies = [ "toml_datetime", "toml_edit 0.20.2", @@ -2220,29 +2468,30 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "profiling" -version = "1.0.13" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d135ede8821cf6376eb7a64148901e1690b788c11ae94dc297ae917dbc91dc0e" +checksum = "43d84d1d7a6ac92673717f9f6d1518374ef257669c24ebc5ac25d5033828be58" [[package]] name = "puffin" -version = "0.19.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f76ad4bb049fded4e572df72cbb6381ff5d1f41f85c3a04b56e4eca287a02f" +checksum = "fa9dae7b05c02ec1a6bc9bcf20d8bc64a7dcbf57934107902a872014899b741f" dependencies = [ "anyhow", "bincode", "byteorder", "cfg-if", + "itertools 0.10.5", "lz4_flex", "once_cell", "parking_lot", @@ -2251,9 +2500,9 @@ dependencies = [ [[package]] name = "puffin_http" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4936c085e48efc86f6d96609dc5086d1d236afe3ec4676f09b157a4f4be83ff6" +checksum = "739a3c7f56604713b553d7addd7718c226e88d598979ae3450320800bd0e9810" dependencies = [ "anyhow", "crossbeam-channel", @@ -2264,18 +2513,18 @@ dependencies = [ [[package]] name = "quick-xml" -version = "0.31.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" +checksum = "6f24d770aeca0eacb81ac29dfbc55ebcc09312fdd1f8bbecdc7e4a84e000e3b4" dependencies = [ "memchr", ] [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -2318,21 +2567,21 @@ dependencies = [ [[package]] name = "rangemap" -version = "1.4.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "977b1e897f9d764566891689e642653e5ed90c6895106acd005eb4c1d0203991" +checksum = "f60fcc7d6849342eff22c4350c8b9a989ee8ceabc4b481253e8946b9fe83d684" [[package]] name = "raw-window-handle" -version = "0.6.0" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42a9830a0e1b9fb145ebb365b8bc4ccd75f290f98c0247deafbbe2c75cefb544" +checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" [[package]] name = "rayon" -version = "1.8.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -2350,41 +2599,42 @@ dependencies = [ [[package]] name = "read-fonts" -version = "0.15.3" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1362980db95801b70031dd592dc052a44b1810ca9da8fbcf7b25983f3174ed0" +checksum = "8c141b9980e1150201b2a3a32879001c8f975fe313ec3df5471a9b5c79a880cd" dependencies = [ + "bytemuck", "font-types", ] [[package]] name = "redox_syscall" -version = "0.3.5" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] [[package]] name = "redox_syscall" -version = "0.4.1" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", ] [[package]] name = "regex" -version = "1.10.2" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.3", - "regex-syntax 0.8.2", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -2398,13 +2648,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax 0.8.4", ] [[package]] @@ -2415,21 +2665,21 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "renderdoc-sys" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216080ab382b992234dda86873c18d4c48358f5cfcb70fd693d7f6f2131b628b" +checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" [[package]] name = "rfd" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "373d2fc6310e2d14943d4e66ebed5b774a2b6b3b1610e7377edf124fb2760d6b" +checksum = "25a73a7337fc24366edfca76ec521f51877b114e42dab584008209cca6719251" dependencies = [ "ashpd", "block", @@ -2460,15 +2710,15 @@ dependencies = [ [[package]] name = "roxmltree" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cd14fd5e3b777a7422cca79358c57a8f6e3a703d9ac187448d0daf220c2407f" +checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97" [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -2478,28 +2728,34 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.38.31" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", "windows-sys 0.52.0", ] +[[package]] +name = "rustversion" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + [[package]] name = "rustybuzz" -version = "0.12.1" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0ae5692c5beaad6a9e22830deeed7874eae8a4e3ba4076fb48e12c56856222c" +checksum = "cfb9cf8877777222e4a3bc7eb247e398b56baba500c38c1c46842431adc8b55c" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "bytemuck", "libm", "smallvec", - "ttf-parser", + "ttf-parser 0.21.1", "unicode-bidi-mirroring", "unicode-ccc", "unicode-properties", @@ -2508,9 +2764,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" @@ -2535,9 +2791,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sctk-adwaita" -version = "0.8.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82b2eaf3a5b264a521b988b2e73042e742df700c4f962cde845d1541adb46550" +checksum = "b6277f0217056f77f1d8f49f2950ac6c278c0d607c45f5ee99328d792ede24ec" dependencies = [ "ab_glyph", "log", @@ -2548,50 +2804,51 @@ dependencies = [ [[package]] name = "self_cell" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58bf37232d3bb9a2c4e641ca2a11d83b5062066f88df7fed36c28772046d65ba" +checksum = "d369a96f978623eb3dc28807c4852d6cc617fed53da5d3c400feff1ef34a714a" [[package]] name = "serde" -version = "1.0.195" +version = "1.0.208" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" +checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.195" +version = "1.0.208" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" +checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.74", ] [[package]] name = "serde_json" -version = "1.0.111" +version = "1.0.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" +checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] [[package]] name = "serde_repr" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.74", ] [[package]] @@ -2614,11 +2871,17 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -2635,6 +2898,16 @@ version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" +[[package]] +name = "skrifa" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abea4738067b1e628c6ce28b2c216c19e9ea95715cdb332680e821c3bec2ef23" +dependencies = [ + "bytemuck", + "read-fonts", +] + [[package]] name = "slab" version = "0.4.9" @@ -2655,17 +2928,17 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "smithay-client-toolkit" -version = "0.18.1" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "922fd3eeab3bd820d76537ce8f582b1cf951eceb5475c28500c7457d9d17f53a" +checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "calloop", "calloop-wayland-source", "cursor-icon", @@ -2686,9 +2959,9 @@ dependencies = [ [[package]] name = "smol_str" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6845563ada680337a52d43bb0b29f396f2d911616f6573012645b9e3d048a49" +checksum = "dd538fb6910ac1099850255cf94a94df6551fbdd602454387d0adb2d1ca6dead" dependencies = [ "serde", ] @@ -2708,7 +2981,7 @@ version = "0.3.0+sdk-1.3.268.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", ] [[package]] @@ -2731,17 +3004,17 @@ checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731" [[package]] name = "svg_fmt" -version = "0.4.1" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb1df15f412ee2e9dfc1c504260fa695c1c3f10fe9f4a6ee2d2184d7d6450e2" +checksum = "20e16a0f46cf5fd675563ef54f26e83e20f2366bcf027bcb3cc3ed2b98aaf2ca" [[package]] name = "swash" -version = "0.1.12" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d06ff4664af8923625604261c645f5c4cc610cc83c84bec74b50d76237089de7" +checksum = "93cdc334a50fcc2aa3f04761af3b28196280a6aaadb1ef11215c478ae32615ac" dependencies = [ - "read-fonts", + "skrifa", "yazi", "zeno", ] @@ -2759,9 +3032,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "1fceb41e3d546d0bd83421d3409b1460cc7444cd389341a4c880fe7a042cb3d7" dependencies = [ "proc-macro2", "quote", @@ -2770,9 +3043,9 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "384595c11a4e2969895cad5a8c4029115f5ab956a9e5ef4de79d11a426e5f20c" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" [[package]] name = "sys-locale" @@ -2794,14 +3067,15 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.10.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if", - "fastrand", + "fastrand 2.1.0", + "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2815,29 +3089,29 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.74", ] [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", @@ -2881,9 +3155,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -2896,9 +3170,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.36.0" +version = "1.39.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" dependencies = [ "backtrace", "pin-project-lite", @@ -2907,13 +3181,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.74", ] [[package]] @@ -2963,7 +3237,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.74", ] [[package]] @@ -3007,11 +3281,11 @@ dependencies = [ [[package]] name = "tracing-tree" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65139ecd2c3f6484c3b99bc01c77afe21e95473630747c7aca525e78b0666675" +checksum = "f459ca79f1b0d5f71c54ddfde6debfc59c8b6eeb46808ae492077f739dc7b49c" dependencies = [ - "nu-ansi-term 0.49.0", + "nu-ansi-term 0.50.1", "tracing-core", "tracing-log", "tracing-subscriber", @@ -3036,11 +3310,23 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4" +[[package]] +name = "ttf-parser" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c591d83f69777866b9126b24c6dd9a18351f177e49d625920d19f989fd31cf8" + +[[package]] +name = "ttf-parser" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be21190ff5d38e8b4a2d3b6a3ae57f612cc39c96e83cedeaf7abc338a8bac4a" + [[package]] name = "tynm" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc08441e69e42a4695d4dde68282419a9fc8379723aa7e51a67c52cedd992069" +checksum = "bd30d05e69d1478e13fe3e7a853409cfec82cebc2cf9b8d613b3c6b0081781ed" dependencies = [ "nom", ] @@ -3070,15 +3356,15 @@ checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-bidi-mirroring" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56d12260fb92d52f9008be7e4bca09f584780eb2266dc8fecc6a192bec561694" +checksum = "23cb788ffebc92c5948d0e997106233eeb1d8b9512f93f41651f52b6c5f5af86" [[package]] name = "unicode-ccc" -version = "0.1.2" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2520efa644f8268dce4dcd3050eaa7fc044fca03961e9998ac7e2e92b77cf1" +checksum = "1df77b101bcc4ea3d78dafc5ad7e4f58ceffe0b2b16bf446aeb50b6cb4157656" [[package]] name = "unicode-ident" @@ -3109,21 +3395,21 @@ checksum = "e4259d9d4425d9f0661581b804cb85fe66a4c631cadd8f490d1c13a35d5d9291" [[package]] name = "unicode-script" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d817255e1bed6dfd4ca47258685d14d2bdcfbc64fdc9e3819bd5848057b8ecc" +checksum = "ad8d71f5726e5f285a935e9fe8edfd53f0491eb6e9a5774097fdabee7cd8c9cd" [[package]] name = "unicode-segmentation" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "unicode-xid" @@ -3133,9 +3419,9 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", @@ -3151,9 +3437,9 @@ checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" [[package]] name = "uuid" -version = "1.7.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" dependencies = [ "getrandom", ] @@ -3166,9 +3452,9 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "violet" @@ -3181,7 +3467,7 @@ dependencies = [ "futures", "futures-signals", "glam", - "itertools 0.12.1", + "itertools 0.13.0", "lru", "palette", "serde_json", @@ -3192,7 +3478,7 @@ dependencies = [ "violet-core", "violet-demo", "violet-wgpu", - "web-time 1.0.0", + "web-time", ] [[package]] @@ -3215,8 +3501,8 @@ dependencies = [ "futures-signals", "glam", "gloo-timers", - "image 0.25.0", - "itertools 0.12.1", + "image", + "itertools 0.13.0", "more-asserts", "once_cell", "palette", @@ -3234,7 +3520,7 @@ dependencies = [ "unicode-segmentation", "wasm-bindgen-futures", "web-sys", - "web-time 1.0.0", + "web-time", "winit", ] @@ -3249,7 +3535,7 @@ dependencies = [ "glam", "heck", "indexmap", - "itertools 0.12.1", + "itertools 0.13.0", "ordered-float", "puffin", "rfd", @@ -3277,8 +3563,8 @@ dependencies = [ "futures", "glam", "guillotiere", - "image 0.25.0", - "itertools 0.12.1", + "image", + "itertools 0.13.0", "palette", "parking_lot", "puffin", @@ -3288,16 +3574,22 @@ dependencies = [ "violet-core", "wasm-bindgen", "web-sys", - "web-time 1.0.0", + "web-time", "wgpu", "winit", ] +[[package]] +name = "waker-fn" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" + [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -3311,34 +3603,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.91" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.91" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.74", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.40" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" +checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" dependencies = [ "cfg-if", "js-sys", @@ -3348,9 +3641,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.91" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3358,28 +3651,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.91" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.74", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.91" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "wayland-backend" -version = "0.3.3" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d50fa61ce90d76474c87f5fc002828d81b32677340112b4ef08079a9d459a40" +checksum = "f90e11ce2ca99c97b940ee83edbae9da2d56a08f9ea8158550fd77fa31722993" dependencies = [ "cc", "downcast-rs", @@ -3391,11 +3684,11 @@ dependencies = [ [[package]] name = "wayland-client" -version = "0.31.2" +version = "0.31.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82fb96ee935c2cea6668ccb470fb7771f6215d1691746c2d896b447a00ad3f1f" +checksum = "7e321577a0a165911bdcfb39cf029302479d7527b517ee58ab0f6ad09edf0943" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "rustix", "wayland-backend", "wayland-scanner", @@ -3407,16 +3700,16 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "cursor-icon", "wayland-backend", ] [[package]] name = "wayland-cursor" -version = "0.31.1" +version = "0.31.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71ce5fa868dd13d11a0d04c5e2e65726d0897be8de247c0c5a65886e283231ba" +checksum = "6ef9489a8df197ebf3a8ce8a7a7f0a2320035c3743f3c1bd0bdbccf07ce64f95" dependencies = [ "rustix", "wayland-client", @@ -3425,11 +3718,11 @@ dependencies = [ [[package]] name = "wayland-protocols" -version = "0.31.2" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f81f365b8b4a97f422ac0e8737c438024b5951734506b0e1d775c73030561f4" +checksum = "62989625a776e827cc0f15d41444a3cea5205b963c3a25be48ae1b52d6b4daaa" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "wayland-backend", "wayland-client", "wayland-scanner", @@ -3437,11 +3730,11 @@ dependencies = [ [[package]] name = "wayland-protocols-plasma" -version = "0.2.0" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23803551115ff9ea9bce586860c5c5a971e360825a0309264102a9495a5ff479" +checksum = "f79f2d57c7fcc6ab4d602adba364bf59a5c24de57bd194486bf9b8360e06bfc4" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "wayland-backend", "wayland-client", "wayland-protocols", @@ -3450,11 +3743,11 @@ dependencies = [ [[package]] name = "wayland-protocols-wlr" -version = "0.2.0" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6" +checksum = "fd993de54a40a40fbe5601d9f1fbcaef0aebcc5fda447d7dc8f6dcbaae4f8953" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "wayland-backend", "wayland-client", "wayland-protocols", @@ -3463,9 +3756,9 @@ dependencies = [ [[package]] name = "wayland-scanner" -version = "0.31.1" +version = "0.31.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63b3a62929287001986fb58c789dce9b67604a397c15c611ad9f747300b6c283" +checksum = "d7b56f89937f1cf2ee1f1259cf2936a17a1f45d8f0aa1019fae6d470d304cfa6" dependencies = [ "proc-macro2", "quick-xml", @@ -3474,9 +3767,9 @@ dependencies = [ [[package]] name = "wayland-sys" -version = "0.31.1" +version = "0.31.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15a0c8eaff5216d07f226cb7a549159267f3467b289d9a2e52fd3ef5aae2b7af" +checksum = "43676fe2daf68754ecf1d72026e4e6c15483198b5d24e888b74d3f22f887a148" dependencies = [ "dlib", "log", @@ -3486,19 +3779,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "web-time" -version = "0.2.4" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa30049b1c872b72c89866d458eae9f20380ab280ffd1b1e18df2d3e2d98cfe0" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ "js-sys", "wasm-bindgen", @@ -3506,9 +3789,9 @@ dependencies = [ [[package]] name = "web-time" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ee269d72cc29bf77a2c4bc689cc750fb39f5cbd493d2205bbb3f5c7779cf7b0" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" dependencies = [ "js-sys", "wasm-bindgen", @@ -3522,13 +3805,13 @@ checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" [[package]] name = "wgpu" -version = "0.19.1" +version = "22.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfe9a310dcf2e6b85f00c46059aaeaf4184caa8e29a1ecd4b7a704c3482332d" +checksum = "e1d1c4ba43f80542cf63a0a6ed3134629ae73e8ab51e4b765a67f3aa062eb433" dependencies = [ "arrayvec", - "cfg-if", - "cfg_aliases", + "cfg_aliases 0.1.1", + "document-features", "js-sys", "log", "parking_lot", @@ -3546,15 +3829,15 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.19.0" +version = "22.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b15e451d4060ada0d99a64df44e4d590213496da7c4f245572d51071e8e30ed" +checksum = "0348c840d1051b8e86c3bcd31206080c5e71e5933dabd79be1ce732b0b2f089a" dependencies = [ "arrayvec", "bit-vec", - "bitflags 2.4.2", - "cfg_aliases", - "codespan-reporting", + "bitflags 2.6.0", + "cfg_aliases 0.1.1", + "document-features", "indexmap", "log", "naga", @@ -3565,22 +3848,21 @@ dependencies = [ "rustc-hash", "smallvec", "thiserror", - "web-sys", "wgpu-hal", "wgpu-types", ] [[package]] name = "wgpu-hal" -version = "0.19.1" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bb47856236bfafc0bc591a925eb036ac19cd987624a447ff353e7a7e7e6f72" +checksum = "f6bbf4b4de8b2a83c0401d9e5ae0080a2792055f25859a02bf9be97952bbed4f" dependencies = [ "android_system_properties", "arrayvec", "ash", - "bitflags 2.4.2", - "cfg_aliases", + "bitflags 2.6.0", + "cfg_aliases 0.1.1", "core-graphics-types", "glow", "glutin_wgl_sys", @@ -3591,10 +3873,11 @@ dependencies = [ "js-sys", "khronos-egl", "libc", - "libloading 0.8.1", + "libloading", "log", "metal", "naga", + "ndk-sys 0.5.0+25.2.9519653", "objc", "once_cell", "parking_lot", @@ -3612,20 +3895,20 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.19.0" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "895fcbeb772bfb049eb80b2d6e47f6c9af235284e9703c96fc0218a42ffd5af2" +checksum = "bc9d91f0e2c4b51434dfa6db77846f2793149d8e73f800fa2e41f52b8eac3c5d" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "js-sys", "web-sys", ] [[package]] name = "widestring" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" +checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" [[package]] name = "winapi" @@ -3645,11 +3928,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "winapi", + "windows-sys 0.59.0", ] [[package]] @@ -3658,6 +3941,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets 0.48.5", +] + [[package]] name = "windows" version = "0.52.0" @@ -3665,7 +3957,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ "windows-core", - "windows-targets 0.52.3", + "windows-targets 0.52.6", ] [[package]] @@ -3674,7 +3966,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.3", + "windows-targets 0.52.6", ] [[package]] @@ -3701,7 +3993,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.3", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -3736,17 +4037,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d380ba1dc7187569a8a9e91ed34b8ccfc33123bbacb8c0aed2d1ad7f3ef2dc5f" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.3", - "windows_aarch64_msvc 0.52.3", - "windows_i686_gnu 0.52.3", - "windows_i686_msvc 0.52.3", - "windows_x86_64_gnu 0.52.3", - "windows_x86_64_gnullvm 0.52.3", - "windows_x86_64_msvc 0.52.3", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -3763,9 +4065,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68e5dcfb9413f53afd9c8f86e56a7b4d86d9a2fa26090ea2dc9e40fba56c6ec6" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -3781,9 +4083,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dab469ebbc45798319e69eebf92308e541ce46760b49b18c6b3fe5e8965b30f" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -3799,9 +4101,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a4e9b6a7cac734a8b4138a4e1044eac3404d8326b6c0f939276560687a033fb" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -3817,9 +4125,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b0ec9c422ca95ff34a78755cfa6ad4a51371da2a5ace67500cf7ca5f232c58" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -3835,9 +4143,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704131571ba93e89d7cd43482277d6632589b18ecf4468f591fbae0a8b101614" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -3853,9 +4161,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42079295511643151e98d61c38c0acc444e52dd42ab456f7ccfd5152e8ecf21c" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -3871,43 +4179,47 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0770833d60a970638e989b3fa9fd2bb1aaadcf88963d1659fd7d9990196ed2d6" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winit" -version = "0.29.11" +version = "0.30.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "272be407f804517512fdf408f0fe6c067bf24659a913c61af97af176bfd5aa92" +checksum = "0be9e76a1f1077e04a411f0b989cbd3c93339e1771cb41e71ac4aee95bfd2c67" dependencies = [ "ahash", "android-activity", "atomic-waker", - "bitflags 2.4.2", + "bitflags 2.6.0", + "block2", "bytemuck", "calloop", - "cfg_aliases", + "cfg_aliases 0.2.1", + "concurrent-queue", "core-foundation", "core-graphics", "cursor-icon", - "icrate", + "dpi", "js-sys", "libc", - "log", "memmap2", "ndk", - "ndk-sys", "objc2", - "once_cell", + "objc2-app-kit", + "objc2-foundation", + "objc2-ui-kit", "orbclient", "percent-encoding", + "pin-project", "raw-window-handle", - "redox_syscall 0.3.5", + "redox_syscall 0.4.1", "rustix", "sctk-adwaita", "smithay-client-toolkit", "smol_str", + "tracing", "unicode-segmentation", "wasm-bindgen", "wasm-bindgen-futures", @@ -3916,8 +4228,8 @@ dependencies = [ "wayland-protocols", "wayland-protocols-plasma", "web-sys", - "web-time 0.2.4", - "windows-sys 0.48.0", + "web-time", + "windows-sys 0.52.0", "x11-dl", "x11rb", "xkbcommon-dl", @@ -3925,9 +4237,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.5.34" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7cf47b659b318dccbd69cc4797a39ae128f533dce7902a1096044d1967b9c16" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" dependencies = [ "memchr", ] @@ -3954,14 +4266,14 @@ dependencies = [ [[package]] name = "x11rb" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8f25ead8c7e4cba123243a6367da5d3990e0d3affa708ea19dce96356bd9f1a" +checksum = "5d91ffca73ee7f68ce055750bf9f6eca0780b8c85eff9bc046a3b0da41755e12" dependencies = [ "as-raw-xcb-connection", "gethostname", "libc", - "libloading 0.8.1", + "libloading", "once_cell", "rustix", "x11rb-protocol", @@ -3969,24 +4281,24 @@ dependencies = [ [[package]] name = "x11rb-protocol" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e63e71c4b8bd9ffec2c963173a4dc4cbde9ee96961d4fcb4429db9929b606c34" +checksum = "ec107c4503ea0b4a98ef47356329af139c0a4f7750e621cf2973cd3385ebcb3d" [[package]] name = "xcursor" -version = "0.3.5" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a0ccd7b4a5345edfcd0c3535718a4e9ff7798ffc536bb5b5a0e26ff84732911" +checksum = "0ef33da6b1660b4ddbfb3aef0ade110c8b8a781a3b6382fa5f2b5b040fd55f61" [[package]] name = "xdg-home" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e5a325c3cb8398ad6cf859c1135b25dd29e186679cf2da7581d9679f63b38e" +checksum = "ec1cdab258fb55c0da61328dc52c8764709b249011b2cad0454c72f0bf10a1f6" dependencies = [ "libc", - "winapi", + "windows-sys 0.59.0", ] [[package]] @@ -3995,7 +4307,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "dlib", "log", "once_cell", @@ -4004,15 +4316,15 @@ dependencies = [ [[package]] name = "xkeysym" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "054a8e68b76250b253f671d1268cb7f1ae089ec35e195b2efb2a4e9a836d0621" +checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56" [[package]] name = "xml-rs" -version = "0.8.19" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" +checksum = "539a77ee7c0de333dcc6da69b177380a0b81e0dacfa4f7344c465a36871ee601" [[package]] name = "yazi" @@ -4030,7 +4342,7 @@ dependencies = [ "async-executor", "async-fs", "async-io", - "async-lock 3.3.0", + "async-lock", "async-process", "async-recursion", "async-task", @@ -4038,7 +4350,7 @@ dependencies = [ "blocking", "derivative", "enumflags2", - "event-listener 5.2.0", + "event-listener", "futures-core", "futures-sink", "futures-util", @@ -4092,22 +4404,23 @@ checksum = "dd15f8e0dbb966fd9245e7498c7e9e5055d9e5c8b676b95bd67091cd11a1e697" [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ + "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.74", ] [[package]] @@ -4118,9 +4431,9 @@ checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a" [[package]] name = "zune-jpeg" -version = "0.4.11" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec866b44a2a1fd6133d363f073ca1b179f438f99e7e5bfb1e33f7181facfe448" +checksum = "16099418600b4d8f028622f73ff6e3deaabdff330fb9a2a131dea781ee8b0768" dependencies = [ "zune-core", ] diff --git a/Cargo.toml b/Cargo.toml index 9d8e12b..e4447ce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,60 +24,60 @@ documentation = "https://docs.rs/violet" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [workspace.dependencies] -flax = { path = "./flax", version = "0.6.0", features = [ +flax = { git = "https://github.com/ten3roberts/flax", version = "0.7.0", features = [ "derive", "puffin", ] } atomic_refcell = "0.1" futures-signals = "0.3" -itertools = "0.12" -glam = { version = "0.27", features = ["bytemuck"] } +itertools = "0.13" +glam = { version = "0.28", features = ["bytemuck"] } futures = "0.3" -futures-concurrency = "7.0" +futures-concurrency = "7.6" flume = "0.11" parking_lot = "0.12" slotmap = "1.0" anyhow = "1.0" -once_cell = "1.18" +once_cell = "1.19" slab = "0.4" tynm ="0.1" -tokio = { version = "1.0", default-features = false, features = ["macros", "rt"] } +tokio = { version = "1.39", default-features = false, features = ["macros", "rt"] } arrayvec = "0.7" sync_wrapper = "1.0" -smallvec = "1.0" -arboard = "3.0" +smallvec = "1.13" +arboard = "3.4" -bytemuck = { version = "1.13", features = ["derive"] } -winit = "0.29" -wgpu = { version = "0.19", default-features = false, features = ["fragile-send-sync-non-atomic-wasm", "webgl", "wgsl"] } +bytemuck = { version = "1.17", features = ["derive"] } +winit = "0.30" +wgpu = { version = "22.1", default-features = false, features = ["fragile-send-sync-non-atomic-wasm", "webgl", "wgsl"] } palette = { version = "0.7", features = ["serializing"] } -dashmap = "5.4" +dashmap = "6.0" image = { version = "0.25", default_features = false, features = ["png", "jpeg"] } color-hex = "0.2" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -indexmap = { version = "2.0", features = ["serde"] } +indexmap = { version = "2.4", features = ["serde"] } rfd = "0.14" tracing = "0.1" pin-project = "1.1" -cosmic-text = { version = "0.11", features = ["wasm-web"] } +cosmic-text = { version = "0.12", features = ["wasm-web"] } guillotiere = "0.6" -bytes = "1.5" +bytes = "1.7" more-asserts = "0.3" -unicode-segmentation="1.0" +unicode-segmentation="1.11" lru = "0.12" puffin = "0.19" puffin_http = "0.16" gloo-timers = "0.3" -web-time = "1.0" +web-time = "1.1" wasm-bindgen-futures = "0.4" wasm-bindgen = "0.2" web-sys = { version = "0.3", features = ["Clipboard"] } -tracing-tree = "0.3" +tracing-tree = "0.4" heck = "0.5" ordered-float = "4.2" ropey = "1.6" @@ -101,7 +101,7 @@ color-hex.workspace = true tracing.workspace = true futures.workspace = true -tokio = { version = "1.0", default_features= false, features = ["macros"] } +tokio = { version = "1.39", default_features= false, features = ["macros"] } serde_json = "1.0" tracing-tree.workspace = true diff --git a/violet-core/src/assets/mod.rs b/violet-core/src/assets/mod.rs index 458ebbd..a45ba7b 100644 --- a/violet-core/src/assets/mod.rs +++ b/violet-core/src/assets/mod.rs @@ -12,7 +12,6 @@ pub mod cell; pub mod fs; mod handle; pub mod map; -mod provider; pub use handle::Asset; use image::{DynamicImage, ImageError, ImageResult}; @@ -175,9 +174,6 @@ mod tests { #[test] fn asset_cache() { - #[derive(Hash, Eq, PartialEq, Clone, Debug)] - struct Key(String); - impl AssetKey<()> for Path { type Error = Infallible; diff --git a/violet-core/src/assets/provider.rs b/violet-core/src/assets/provider.rs deleted file mode 100644 index 0d48ab7..0000000 --- a/violet-core/src/assets/provider.rs +++ /dev/null @@ -1,6 +0,0 @@ -/// Plugin source for assets -pub trait AssetProvider: Send + Sync {} - -pub struct FsProvider {} - -impl AssetProvider for FsProvider {} diff --git a/violet-core/src/layout/float.rs b/violet-core/src/layout/float.rs index cd0b047..6b08700 100644 --- a/violet-core/src/layout/float.rs +++ b/violet-core/src/layout/float.rs @@ -3,11 +3,11 @@ use glam::{BVec2, Vec2}; use crate::{ components, - layout::{query_size, Direction, SizingHints}, + layout::{query_size, Direction, LayoutArgs, SizingHints}, Edges, Rect, }; -use super::{apply_layout, Block, LayoutArgs, LayoutLimits, QueryArgs, Sizing}; +use super::{apply_layout, ApplyLayoutArgs, Block, LayoutLimits, QueryArgs, Sizing}; /// A floating layout positions its children similar to the stack layout, but it does grow to accommodate the children. /// @@ -18,19 +18,11 @@ use super::{apply_layout, Block, LayoutArgs, LayoutLimits, QueryArgs, Sizing}; pub struct FloatLayout {} impl FloatLayout { - pub(crate) fn apply( - &self, - world: &World, - _: &EntityRef, - children: &[Entity], - args: LayoutArgs, - _: Vec2, - _: Vec2, - ) -> Block { + pub(crate) fn apply(&self, world: &World, _: &EntityRef, args: ApplyLayoutArgs) -> Block { puffin::profile_function!(); let _span = tracing::debug_span!("FloatLayout::apply").entered(); - children.iter().for_each(|&child| { + args.children.iter().for_each(|&child| { let entity = world.entity(child).expect("invalid child"); // let pos = resolve_pos(&entity, content_area, preferred_size); @@ -46,7 +38,6 @@ impl FloatLayout { LayoutArgs { content_area: args.content_area, limits, - overflow_limit: Vec2::MAX, }, ); diff --git a/violet-core/src/layout/flow.rs b/violet-core/src/layout/flow.rs index 1b09e8c..a625dbb 100644 --- a/violet-core/src/layout/flow.rs +++ b/violet-core/src/layout/flow.rs @@ -14,8 +14,8 @@ use crate::{ }; use super::{ - apply_layout, cache::LayoutCache, resolve_pos, Block, Direction, LayoutArgs, LayoutLimits, - QueryArgs, Sizing, + apply_layout, cache::LayoutCache, resolve_pos, ApplyLayoutArgs, Block, Direction, LayoutArgs, + LayoutLimits, QueryArgs, Sizing, }; #[derive(Debug, Clone)] @@ -314,27 +314,16 @@ impl FlowLayout { /// Position and size the children of the given entity using all the provided available space /// /// Returns the inner rect - pub(crate) fn apply( - &self, - world: &World, - entity: &EntityRef, - cache: &mut LayoutCache, - children: &[Entity], - args: LayoutArgs, - preferred_size: Vec2, - offset: Vec2, - ) -> Block { + pub(crate) fn apply(&self, world: &World, entity: &EntityRef, args: ApplyLayoutArgs) -> Block { puffin::profile_function!(); - let _span = - tracing::debug_span!("Flow::apply", %entity, %args.content_area, ?args.limits, flow=?self) - .entered(); + let _span = tracing::debug_span!("Flow::apply", ?args.limits, flow=?self).entered(); // Query the minimum and preferred size of this flow layout, optimizing for minimum size in // the direction of this axis. let row = self.query_row( world, - cache, - children, + args.cache, + args.children, QueryArgs { limits: args.limits, content_area: args.content_area, @@ -342,8 +331,18 @@ impl FlowLayout { }, ); - // tracing::debug!(?row.margin, "row margins to be contained"); - self.distribute_children(world, entity, &row, args, preferred_size, offset) + // tracing::info!(?row.margin, "row margins to be contained"); + self.distribute_children( + world, + entity, + &row, + LayoutArgs { + content_area: args.content_area, + limits: args.limits, + }, + args.preferred_size, + args.offset, + ) } fn distribute_children( @@ -442,8 +441,6 @@ impl FlowLayout { // accordingly. // // The child may return a size *less* than the specified limit - let overflow_limit = (args.overflow_limit.dot(axis) - cursor.main_cursor) * axis - + (args.overflow_limit - child_margin.size()) * cross_axis; // tracing::info!("overflow limit: {}", overflow_limit); @@ -469,7 +466,6 @@ impl FlowLayout { LayoutArgs { content_area: args.content_area, limits: child_limits, - overflow_limit, }, ); diff --git a/violet-core/src/layout/mod.rs b/violet-core/src/layout/mod.rs index bb5423a..30ce816 100644 --- a/violet-core/src/layout/mod.rs +++ b/violet-core/src/layout/mod.rs @@ -73,6 +73,15 @@ impl Direction { } } +pub(crate) struct ApplyLayoutArgs<'a> { + cache: &'a mut LayoutCache, + children: &'a [Entity], + content_area: Vec2, + limits: LayoutLimits, + preferred_size: Vec2, + offset: Vec2, +} + #[derive(Debug, Clone)] pub enum Layout { Stack(StackLayout), @@ -81,22 +90,11 @@ pub enum Layout { } impl Layout { - pub(crate) fn apply( - &self, - world: &World, - entity: &EntityRef, - cache: &mut LayoutCache, - children: &[Entity], - args: LayoutArgs, - preferred_size: Vec2, - offset: Vec2, - ) -> Block { + pub(crate) fn apply(&self, world: &World, entity: &EntityRef, ctx: ApplyLayoutArgs) -> Block { match self { - Layout::Stack(v) => v.apply(world, entity, children, args, preferred_size, offset), - Layout::Flow(v) => { - v.apply(world, entity, cache, children, args, preferred_size, offset) - } - Layout::Float(v) => v.apply(world, entity, children, args, preferred_size, offset), + Layout::Stack(v) => v.apply(world, entity, ctx), + Layout::Flow(v) => v.apply(world, entity, ctx), + Layout::Float(v) => v.apply(world, entity, ctx), } } @@ -387,7 +385,6 @@ pub struct LayoutArgs { // The size of the potentially available space for the subtree pub content_area: Vec2, pub limits: LayoutLimits, - pub overflow_limit: Vec2, } impl Default for LayoutArgs { @@ -395,7 +392,6 @@ impl Default for LayoutArgs { Self { content_area: Vec2::ZERO, limits: LayoutLimits::default(), - overflow_limit: Vec2::MAX, } } } @@ -487,21 +483,17 @@ pub(crate) fn apply_layout(world: &World, entity: &EntityRef, args: LayoutArgs) let block = layout.apply( world, entity, - cache, - children, - LayoutArgs { - // The size of the potentially available space for the subtree - content_area: args.content_area - padding.size(), + ApplyLayoutArgs { + cache, + children, + content_area: args.content_area, limits: LayoutLimits { min_size: (limits.min_size - padding.size()).max(Vec2::ZERO), max_size: (limits.max_size - padding.size()).max(Vec2::ZERO), }, - overflow_limit: (args.overflow_limit - padding.size()) - .max(Vec2::ZERO) - .min(max_size), + preferred_size: resolved_size - padding.size(), + offset: vec2(padding.left, padding.top), }, - resolved_size - padding.size(), - vec2(padding.left, padding.top), ); Block { @@ -554,17 +546,17 @@ pub(crate) fn apply_layout(world: &World, entity: &EntityRef, args: LayoutArgs) .update_dedup(components::layout_args(), args) .unwrap(); - if block.rect.size().x > args.overflow_limit.x + LAYOUT_TOLERANCE - || block.rect.size().y > args.overflow_limit.y + LAYOUT_TOLERANCE - { - tracing::warn!( - %entity, - size=%block.rect.size(), - %args.limits, - %args.overflow_limit, - "Widget size exceeds constraints" - ); - } + // if block.rect.size().x > args.overflow_limit.x + LAYOUT_TOLERANCE + // || block.rect.size().y > args.overflow_limit.y + LAYOUT_TOLERANCE + // { + // tracing::warn!( + // %entity, + // size=%block.rect.size(), + // %args.limits, + // %args.overflow_limit, + // "Widget size exceeds constraints" + // ); + // } // Widget size is limited by itself and is not affected by the size of the parent // if let Some(max_size) = max_size { diff --git a/violet-core/src/layout/stack.rs b/violet-core/src/layout/stack.rs index af30d02..7855031 100644 --- a/violet-core/src/layout/stack.rs +++ b/violet-core/src/layout/stack.rs @@ -8,7 +8,9 @@ use crate::{ Edges, Rect, }; -use super::{apply_layout, resolve_pos, Alignment, Block, LayoutLimits, QueryArgs, Sizing}; +use super::{ + apply_layout, resolve_pos, Alignment, ApplyLayoutArgs, Block, LayoutLimits, QueryArgs, Sizing, +}; /// The stack layout /// @@ -33,15 +35,7 @@ pub struct StackLayout { } impl StackLayout { - pub(crate) fn apply( - &self, - world: &World, - entity: &EntityRef, - children: &[Entity], - args: LayoutArgs, - preferred_size: Vec2, - offset: Vec2, - ) -> Block { + pub(crate) fn apply(&self, world: &World, entity: &EntityRef, args: ApplyLayoutArgs) -> Block { puffin::profile_function!(); let _span = tracing::debug_span!("StackLayout::apply", %self.clip, %entity).entered(); @@ -57,7 +51,8 @@ impl StackLayout { // overflow_limit: limits.max_size, }; - let blocks = children + let blocks = args + .children .iter() .map(|&child| { let entity = world.entity(child).expect("invalid child"); @@ -71,26 +66,25 @@ impl StackLayout { LayoutArgs { content_area: args.content_area, limits: child_limits, - overflow_limit: Vec2::MAX * c + args.overflow_limit * (1.0 - c), }, ); - bounds = bounds.merge(block.rect.translate(offset)); + bounds = bounds.merge(block.rect.translate(args.offset)); (entity, block) }) .collect_vec(); // The size used for alignment calculation - let size = bounds.size().max(preferred_size); + let size = bounds.size().max(args.preferred_size); // .clamp(limits.min_size, limits.max_size); let mut aligned_bounds = - StackableBounds::from_rect(Rect::from_size_pos(preferred_size, offset)); + StackableBounds::from_rect(Rect::from_size_pos(args.preferred_size, args.offset)); let mut can_grow = BVec2::FALSE; - let offset = offset + resolve_pos(entity, args.content_area, size); + let offset = args.offset + resolve_pos(entity, args.content_area, size); for (entity, block) in blocks { let block_size = block.rect.size(); diff --git a/violet-core/src/systems.rs b/violet-core/src/systems.rs index c362187..cb238d7 100644 --- a/violet-core/src/systems.rs +++ b/violet-core/src/systems.rs @@ -184,7 +184,6 @@ pub fn layout_system(root: Entity) -> BoxedSystem { min_size: Vec2::ZERO, max_size: canvas_rect.size(), }, - overflow_limit: canvas_rect.size(), }, ); diff --git a/violet-core/src/widget/mod.rs b/violet-core/src/widget/mod.rs index b60af27..19000b8 100644 --- a/violet-core/src/widget/mod.rs +++ b/violet-core/src/widget/mod.rs @@ -60,6 +60,8 @@ where } } +pub type OnChangeCallback = dyn Fn(Option<&T>); + pub trait WidgetExt: Widget + Sized { fn boxed<'a>(self) -> Box where @@ -78,7 +80,7 @@ pub trait WidgetExt: Widget + Sized { fn monitor( self, component: Component, - on_change: Box)>, + on_change: Box>, ) -> Monitor { Monitor { widget: self, @@ -105,7 +107,7 @@ pub trait WidgetExt: Widget + Sized { pub struct Monitor { widget: W, component: Component, - on_change: Box)>, + on_change: Box>, } impl Widget for Monitor { diff --git a/violet-demo/src/palettes/editor.rs b/violet-demo/src/palettes/editor.rs index 1fa980c..3410557 100644 --- a/violet-demo/src/palettes/editor.rs +++ b/violet-demo/src/palettes/editor.rs @@ -146,7 +146,7 @@ pub fn rgb_editor(color: Mutable) -> impl Widget { let rgb_color = Arc::new( color .map_ref(|v| &v.color, |v| &mut v.color) - .map(|v| Rgb::from_color(v), |v: Rgb| Oklch::from_color(v)) + .map(Rgb::from_color, |v: Rgb| Oklch::from_color(v)) .memo(Default::default()), ); diff --git a/violet-wgpu/src/app.rs b/violet-wgpu/src/app.rs index 51b4363..15cacdd 100644 --- a/violet-wgpu/src/app.rs +++ b/violet-wgpu/src/app.rs @@ -1,15 +1,15 @@ -use futures::channel::oneshot; use parking_lot::Mutex; use std::sync::Arc; -use web_time::{Duration, Instant}; +use web_time::Instant; -use flax::{components::name, entity_ids, Entity, Query, Schedule, World}; +use flax::{components::name, Entity, Schedule, World}; use glam::{vec2, Vec2}; use winit::{ + application::ApplicationHandler, dpi::{LogicalSize, PhysicalSize}, - event::{Event, WindowEvent}, - event_loop::{ControlFlow, EventLoopBuilder, EventLoopWindowTarget}, - window::WindowBuilder, + event::WindowEvent, + event_loop::{ControlFlow, EventLoop}, + window::Window, }; use violet_core::{ @@ -39,7 +39,6 @@ use crate::{ pub struct Canvas { stylesheet: Entity, - size: Vec2, root: W, } @@ -47,9 +46,7 @@ impl Widget for Canvas { fn mount(self, scope: &mut Scope<'_>) { scope .set(name(), "Canvas".into()) - .set(stylesheet(self.stylesheet), ()) - .set(max_size(), Unit::px(self.size)) - .set(size(), Unit::px(self.size)); + .set(stylesheet(self.stylesheet), ()); scope.attach( col(self.root) @@ -86,12 +83,9 @@ impl AppBuilder { } pub fn run(self, root: impl Widget) -> anyhow::Result<()> { - let event_loop = EventLoopBuilder::new().build()?; + let event_loop = EventLoop::builder().build()?; - #[allow(unused_mut)] - let mut builder = WindowBuilder::new().with_title(self.title.clone()); - - let mut instance = AppInstance::new(root); + let instance = AppInstance::new(root); #[cfg(target_arch = "wasm32")] { @@ -109,8 +103,6 @@ impl AppBuilder { builder = builder.with_canvas(Some(canvas)); } - let window = builder.build(&event_loop)?; - #[cfg(target_arch = "wasm32")] { use wasm_bindgen::JsCast; @@ -145,138 +137,23 @@ impl AppBuilder { } tracing::info!("creating gpu"); - let window = Arc::new(window); - - let (renderer_tx, mut renderer_rx) = oneshot::channel(); - - instance - .frame - .spawn(FutureEffect::new(Gpu::with_surface(window.clone()), { - let text_system = instance.text_system.to_owned(); - let layout_changes_rx = instance.layout_changes_rx.to_owned(); - move |frame: &mut Frame, (gpu, surface)| { - renderer_tx - .send(WindowRenderer::new( - frame, - gpu, - instance.root, - text_system.clone(), - surface, - layout_changes_rx.clone(), - self.renderer_config, - )) - .ok(); - } - })); + + let (renderer_tx, renderer_rx) = flume::unbounded(); #[cfg(not(target_arch = "wasm32"))] let _puffin_server = setup_puffin(); - let on_event = move |event, ctl: &EventLoopWindowTarget<()>| match event { - Event::AboutToWait => { - puffin::profile_scope!("AboutToWait"); - - if let Some(mut renderer) = renderer_rx.try_recv().ok().flatten() { - renderer.resize(instance.window_size, instance.scale_factor); - instance.renderer = Some(renderer); - } - - instance.update(); - - if !instance.is_minimized() { - let archetypes = instance.frame.world.archetype_info(); - let pruned = instance.frame.world.prune_archetypes(); - let entity_count = Query::new(entity_ids()) - .borrow(&instance.frame.world) - .iter() - .count(); - tracing::debug!(archetype_count = archetypes.len(), entity_count, pruned); - // let report = instance.?stats.report(); - - // window.set_title(&format!( - // "Violet - {:>4.1?} {:>4.1?} {:>4.1?}", - // report.min_frame_time, report.average_frame_time, report.max_frame_time, - // )); - } - - ctl.set_control_flow(ControlFlow::Poll); - window.request_redraw(); - puffin::GlobalProfiler::lock().new_frame(); - } - Event::WindowEvent { window_id, event } => match event { - WindowEvent::RedrawRequested => { - puffin::profile_scope!("RedrawRequested"); - if let Err(err) = instance.draw() { - tracing::error!("Failed to draw to window: {err:?}"); - } - } - WindowEvent::MouseInput { state, button, .. } => { - puffin::profile_scope!("MouseInput"); - instance - .input_state - .on_mouse_input(&mut instance.frame, state, button); - } - WindowEvent::ModifiersChanged(modifiers) => { - puffin::profile_scope!("ModifiersChanged"); - instance.input_state.on_modifiers_change(modifiers.state()); - } - WindowEvent::KeyboardInput { event, .. } => { - puffin::profile_scope!("KeyboardInput", format!("{event:?}")); - instance - .input_state - .on_keyboard_input(&mut instance.frame, event) - } - WindowEvent::CursorMoved { position, .. } => { - puffin::profile_scope!("CursorMoved"); - instance.input_state.on_cursor_move( - &mut instance.frame, - vec2(position.x as f32, position.y as f32), - ) - } - WindowEvent::MouseWheel { delta, .. } => { - puffin::profile_scope!("MouseWheel"); - match delta { - winit::event::MouseScrollDelta::LineDelta(x, y) => { - const LINE_SIZE: f32 = 16.0; - instance - .input_state - .on_scroll(&mut instance.frame, vec2(x * LINE_SIZE, y * LINE_SIZE)) - } - winit::event::MouseScrollDelta::PixelDelta(pos) => { - let pos = pos.to_logical::(instance.scale_factor); - instance - .input_state - .on_scroll(&mut instance.frame, vec2(pos.x, pos.y)) - } - } - } - WindowEvent::ScaleFactorChanged { - scale_factor: s, .. - } => { - tracing::info!("Scale factor changed to {s}"); - instance.scale_factor = s; - - let size = instance.window_size; - instance.on_resize(size); - } - WindowEvent::Resized(size) => { - instance.on_resize(size); - } - WindowEvent::CloseRequested => { - ctl.exit(); - } - event => { - tracing::trace!(?event, ?window_id, "Window event") - } - }, - event => { - tracing::trace!(?event, "Event") - } - }; - #[cfg(not(target_arch = "wasm32"))] { - event_loop.run(on_event)?; + event_loop.run_app(&mut WindowEventHandler { + instance, + renderer: None, + window: None, + renderer_tx, + renderer_rx, + renderer_config: self.renderer_config, + title: self.title, + })?; } #[cfg(target_arch = "wasm32")] { @@ -291,10 +168,8 @@ impl AppBuilder { /// A running application instance of violet pub struct AppInstance { frame: Frame, - renderer: Option, root: Entity, scale_factor: f64, - stats: AppStats, current_time: Instant, start_time: Instant, executor: Executor, @@ -319,11 +194,7 @@ impl AppInstance { frame.set_atom(io::clipboard(), clipboard); // Mount the root widget - let root = frame.new_root(Canvas { - stylesheet, - size: vec2(0.0, 0.0), - root, - }); + let root = frame.new_root(Canvas { stylesheet, root }); let text_system = Arc::new(Mutex::new(TextSystem::new_with_defaults())); let (layout_changes_tx, layout_changes_rx) = flume::unbounded(); @@ -346,10 +217,8 @@ impl AppInstance { Self { frame, - renderer: None, root, scale_factor: 1.0, - stats: AppStats::new(60), current_time: start_time, start_time, executor, @@ -361,10 +230,6 @@ impl AppInstance { } } - pub fn insert_renderer(&mut self, renderer: WindowRenderer) { - self.renderer = Some(renderer); - } - pub fn builder() -> AppBuilder { AppBuilder::new() } @@ -390,12 +255,6 @@ impl AppInstance { Rect::from_size(vec2(logical_size.width, logical_size.height)), ) .unwrap(); - - self.schedule.execute_seq(&mut self.frame.world).unwrap(); - - if let Some(renderer) = &mut self.renderer { - renderer.resize(physical_size, self.scale_factor); - } } pub fn update(&mut self) { @@ -405,10 +264,7 @@ impl AppInstance { let new_time = Instant::now(); - let frame_time = new_time.duration_since(self.current_time); - self.current_time = new_time; - self.stats.record_frame(frame_time); self.executor.tick(&mut self.frame); @@ -419,17 +275,187 @@ impl AppInstance { } } + pub fn is_minimized(&self) -> bool { + self.window_size.width == 0 || self.window_size.height == 0 + } + + pub fn set_scale_factor(&mut self, scale_factor: f64) { + self.scale_factor = scale_factor; + } + + pub fn input_state(&self) -> &InputState { + &self.input_state + } + + pub fn input_state_mut(&mut self) -> &mut InputState { + &mut self.input_state + } + + pub fn frame(&self) -> &Frame { + &self.frame + } +} + +struct WindowEventHandler { + instance: AppInstance, + renderer: Option, + window: Option>, + renderer_rx: flume::Receiver, + renderer_tx: flume::Sender, + renderer_config: MainRendererConfig, + title: String, +} + +impl WindowEventHandler { pub fn draw(&mut self) -> anyhow::Result<()> { puffin::profile_function!(); if let Some(renderer) = &mut self.renderer { - puffin::profile_scope!("Draw"); - renderer.draw(&mut self.frame)?; + renderer.draw(&mut self.instance.frame)?; } Ok(()) } - pub fn is_minimized(&self) -> bool { - self.window_size.width == 0 || self.window_size.height == 0 +} + +impl ApplicationHandler for WindowEventHandler { + fn resumed(&mut self, event_loop: &winit::event_loop::ActiveEventLoop) { + if self.window.is_none() { + let Ok(window) = event_loop + .create_window(Window::default_attributes().with_title(self.title.clone())) + else { + tracing::error!("Failed to create window"); + event_loop.exit(); + return; + }; + + let window = Arc::new(window); + let root = self.instance.root; + let renderer_tx = self.renderer_tx.clone(); + let renderer_config = self.renderer_config.clone(); + let text_system = self.instance.text_system.to_owned(); + let layout_changes_rx = self.instance.layout_changes_rx.to_owned(); + + self.instance + .frame + .spawn(FutureEffect::new(Gpu::with_surface(window.clone()), { + move |frame: &mut Frame, (gpu, surface)| { + let window_renderer = WindowRenderer::new( + frame, + gpu, + root, + text_system.clone(), + surface, + layout_changes_rx.clone(), + renderer_config, + ); + renderer_tx.send(window_renderer).ok(); + } + })); + + self.window = Some(window); + } + } + + fn window_event( + &mut self, + event_loop: &winit::event_loop::ActiveEventLoop, + window_id: winit::window::WindowId, + event: WindowEvent, + ) { + let instance = &mut self.instance; + + match event { + WindowEvent::RedrawRequested => { + puffin::profile_scope!("RedrawRequested"); + if let Err(err) = self.draw() { + tracing::error!("Failed to draw to window: {err:?}"); + } + } + WindowEvent::MouseInput { state, button, .. } => { + puffin::profile_scope!("MouseInput"); + instance + .input_state + .on_mouse_input(&mut instance.frame, state, button); + } + WindowEvent::ModifiersChanged(modifiers) => { + puffin::profile_scope!("ModifiersChanged"); + instance.input_state.on_modifiers_change(modifiers.state()); + } + WindowEvent::KeyboardInput { event, .. } => { + puffin::profile_scope!("KeyboardInput", format!("{event:?}")); + instance + .input_state + .on_keyboard_input(&mut instance.frame, event) + } + WindowEvent::CursorMoved { position, .. } => { + puffin::profile_scope!("CursorMoved"); + instance.input_state.on_cursor_move( + &mut instance.frame, + vec2(position.x as f32, position.y as f32), + ) + } + WindowEvent::MouseWheel { delta, .. } => { + puffin::profile_scope!("MouseWheel"); + match delta { + winit::event::MouseScrollDelta::LineDelta(x, y) => { + const LINE_SIZE: f32 = 16.0; + instance + .input_state + .on_scroll(&mut instance.frame, vec2(x * LINE_SIZE, y * LINE_SIZE)) + } + winit::event::MouseScrollDelta::PixelDelta(pos) => { + let pos = pos.to_logical::(instance.scale_factor); + instance + .input_state + .on_scroll(&mut instance.frame, vec2(pos.x, pos.y)) + } + } + } + WindowEvent::ScaleFactorChanged { + scale_factor: s, .. + } => { + instance.set_scale_factor(s); + + let size = instance.window_size; + instance.on_resize(size); + if let Some(renderer) = &mut self.renderer { + renderer.resize(size, self.instance.scale_factor); + } + } + WindowEvent::Resized(size) => { + instance.on_resize(size); + if let Some(renderer) = &mut self.renderer { + renderer.resize(size, self.instance.scale_factor); + } + } + WindowEvent::CloseRequested => event_loop.exit(), + event => { + tracing::trace!(?event, ?window_id, "Window event") + } + } + } + + fn about_to_wait(&mut self, event_loop: &winit::event_loop::ActiveEventLoop) { + let Some(window) = &self.window else { + return; + }; + + puffin::profile_scope!("AboutToWait"); + + if let Ok(mut window_renderer) = self.renderer_rx.try_recv() { + window_renderer.resize(self.instance.window_size, self.instance.scale_factor); + self.renderer = Some(window_renderer); + } + + self.instance.update(); + + if !self.instance.is_minimized() { + self.instance.frame.world.prune_archetypes(); + } + + event_loop.set_control_flow(ControlFlow::Poll); + window.request_redraw(); + puffin::GlobalProfiler::lock().new_frame(); } } @@ -454,62 +480,3 @@ impl Default for AppBuilder { Self::new() } } - -pub struct AppStats { - frames: Vec, - max_frames: usize, -} - -impl AppStats { - pub fn new(max_frames: usize) -> Self { - Self { - frames: Vec::with_capacity(max_frames), - max_frames, - } - } - - fn record_frame(&mut self, frame_time: Duration) { - if self.frames.len() >= self.max_frames { - self.frames.remove(0); - } - self.frames.push(AppFrame { frame_time }); - } - - pub fn report(&self) -> StatsReport { - let average = self - .frames - .iter() - .map(|f| f.frame_time) - .sum::() - .div_f32(self.frames.len() as f32); - - let min = self - .frames - .iter() - .map(|f| f.frame_time) - .min() - .unwrap_or_default(); - let max = self - .frames - .iter() - .map(|f| f.frame_time) - .max() - .unwrap_or_default(); - - StatsReport { - average_frame_time: average, - min_frame_time: min, - max_frame_time: max, - } - } -} - -pub struct StatsReport { - pub average_frame_time: Duration, - pub min_frame_time: Duration, - pub max_frame_time: Duration, -} - -struct AppFrame { - frame_time: Duration, -} diff --git a/violet-wgpu/src/graphics/gpu.rs b/violet-wgpu/src/graphics/gpu.rs index 64c3f0d..1bcc295 100644 --- a/violet-wgpu/src/graphics/gpu.rs +++ b/violet-wgpu/src/graphics/gpu.rs @@ -1,24 +1,68 @@ use std::sync::Arc; -use wgpu::{Backends, SurfaceConfiguration, SurfaceError, SurfaceTexture, TextureFormat}; +use wgpu::{Adapter, Backends, SurfaceConfiguration, SurfaceError, SurfaceTexture, TextureFormat}; use winit::{dpi::PhysicalSize, window::Window}; -/// Represents the basic graphics state, such as the device and queue. +/// Represents the Gpu and graphics state #[derive(Debug)] pub struct Gpu { - pub device: Arc, - pub queue: Arc, + pub adapter: Adapter, + pub device: wgpu::Device, + pub queue: wgpu::Queue, } -impl Gpu { - /// Creates a new GPu instaence from an aready existing device and queue. - /// - /// This is used to embed Violet within an already existing wgpu application. - pub fn from_device(device: Arc, queue: Arc) -> Self { - Self { device, queue } +pub struct Surface { + size: Option>, + surface: wgpu::Surface<'static>, + config: SurfaceConfiguration, +} + +impl Surface { + pub fn get_current_texture(&self) -> Result { + self.surface.get_current_texture() + } + + pub fn surface_config(&self) -> &SurfaceConfiguration { + &self.config + } + + pub fn resize(&mut self, gpu: &Gpu, new_size: PhysicalSize) { + tracing::info_span!("resize", ?new_size); + if Some(new_size) == self.size { + tracing::info!(size=?new_size, "Duplicate resize message ignored"); + return; + } + + if new_size.width > 0 && new_size.height > 0 { + // self.size = new_size; + self.config.width = new_size.width; + self.config.height = new_size.height; + self.size = Some(new_size); + self.reconfigure(gpu); + } else { + self.size = None; + } } - /// Creates a new Gpu instance with a surface. + pub fn has_size(&self) -> bool { + self.size.is_some() + } + + pub fn reconfigure(&mut self, gpu: &Gpu) { + self.surface.configure(&gpu.device, &self.config); + } + + pub fn surface_format(&self) -> TextureFormat { + self.config.format + } + + pub fn size(&self) -> Option> { + self.size + } +} + +impl Gpu { + // Creating some of the wgpu types requires async code pub async fn with_surface(window: Arc) -> (Self, Surface) { tracing::info!("creating with surface"); @@ -60,15 +104,12 @@ impl Gpu { // WebGL doesn't support all of wgpu's features, so if // we're building for the web we'll have to disable some. required_limits: if cfg!(target_arch = "wasm32") { - wgpu::Limits { - // Support higher resolution displays, may not be supported on all devices. - max_texture_dimension_2d: 4096, - ..wgpu::Limits::downlevel_webgl2_defaults() - } + wgpu::Limits::downlevel_webgl2_defaults() } else { wgpu::Limits::default() }, label: None, + memory_hints: Default::default(), }, None, // Trace path ) @@ -97,8 +138,9 @@ impl Gpu { ( Self { - device: Arc::new(device), - queue: Arc::new(queue), + adapter, + device, + queue, }, Surface { surface, @@ -112,52 +154,3 @@ impl Gpu { // &self.surface_caps // } } -pub struct Surface { - size: Option>, - surface: wgpu::Surface<'static>, - config: SurfaceConfiguration, -} - -impl Surface { - pub fn get_current_texture(&self) -> Result { - self.surface.get_current_texture() - } - - pub fn surface_config(&self) -> &SurfaceConfiguration { - &self.config - } - - pub fn resize(&mut self, gpu: &Gpu, new_size: PhysicalSize) { - tracing::info_span!("resize", ?new_size); - if Some(new_size) == self.size { - tracing::info!(size=?new_size, "Duplicate resize message ignored"); - return; - } - - if new_size.width > 0 && new_size.height > 0 { - // self.size = new_size; - self.config.width = new_size.width; - self.config.height = new_size.height; - self.size = Some(new_size); - self.reconfigure(gpu); - } else { - self.size = None; - } - } - - pub fn has_size(&self) -> bool { - self.size.is_some() - } - - pub fn reconfigure(&mut self, gpu: &Gpu) { - self.surface.configure(&gpu.device, &self.config); - } - - pub fn surface_format(&self) -> TextureFormat { - self.config.format - } - - pub fn size(&self) -> Option> { - self.size - } -} diff --git a/violet-wgpu/src/graphics/shader.rs b/violet-wgpu/src/graphics/shader.rs index a0c61ef..76c4a2f 100644 --- a/violet-wgpu/src/graphics/shader.rs +++ b/violet-wgpu/src/graphics/shader.rs @@ -42,8 +42,9 @@ impl Shader { layout: Some(&layout), vertex: wgpu::VertexState { module: &shader, - entry_point: "vs_main", // 1. - buffers: desc.vertex_layouts, // 2. + entry_point: "vs_main", // 1. + buffers: desc.vertex_layouts, + compilation_options: Default::default(), }, fragment: Some(wgpu::FragmentState { // 3. @@ -55,26 +56,25 @@ impl Shader { blend: Some(wgpu::BlendState::ALPHA_BLENDING), write_mask: wgpu::ColorWrites::ALL, })], + compilation_options: Default::default(), }), primitive: wgpu::PrimitiveState { - topology: wgpu::PrimitiveTopology::TriangleList, // 1. + topology: wgpu::PrimitiveTopology::TriangleList, strip_index_format: None, - front_face: wgpu::FrontFace::Ccw, // 2. + front_face: wgpu::FrontFace::Ccw, cull_mode: None, - // Setting this to anything other than Fill requires Features::NON_FILL_POLYGON_MODE polygon_mode: wgpu::PolygonMode::Fill, - // Requires Features::DEPTH_CLIP_CONTROL unclipped_depth: false, - // Requires Features::CONSERVATIVE_RASTERIZATION conservative: false, }, depth_stencil: None, multisample: wgpu::MultisampleState { - count: 1, // 2. - mask: !0, // 3. - alpha_to_coverage_enabled: false, // 4. + count: 1, + mask: !0, + alpha_to_coverage_enabled: false, }, - multiview: None, // 5. + multiview: None, + cache: Default::default(), }); Self { pipeline } diff --git a/violet-wgpu/src/renderer/debug_renderer.rs b/violet-wgpu/src/renderer/debug_renderer.rs index 97a7189..73bbe71 100644 --- a/violet-wgpu/src/renderer/debug_renderer.rs +++ b/violet-wgpu/src/renderer/debug_renderer.rs @@ -1,16 +1,11 @@ use std::{collections::BTreeMap, sync::Arc}; use flax::{fetch::entity_refs, Entity, Query}; -use glam::{vec2, vec3, vec4, Mat4, Quat, Vec2, Vec3, Vec4}; -use image::DynamicImage; +use glam::{vec2, vec3, vec4, Mat4, Quat, Vec4}; use itertools::Itertools; use violet_core::{ - assets::Asset, components::{layout_args, rect, screen_clip_mask, screen_transform}, - layout::{ - cache::{layout_cache, LayoutUpdateEvent}, - Direction, - }, + layout::cache::{layout_cache, LayoutUpdateEvent}, stored::{self, Handle}, Frame, Rect, }; @@ -29,14 +24,10 @@ use super::{ }; pub struct DebugRenderer { - white_image: Asset, - layout: BindGroupLayout, bind_group: Handle, - sampler: wgpu::Sampler, mesh: Arc, - corner_shader: stored::Handle, border_shader: stored::Handle, solid_shader: stored::Handle, @@ -89,16 +80,17 @@ impl DebugRenderer { let mesh = Arc::new(ctx.mesh_buffer.insert(&ctx.gpu, &vertices, &indices)); - let corner_shader = store.shaders.insert(Shader::new( - &ctx.gpu, - &ShaderDesc { - label: "ShapeRenderer::shader", - source: include_str!("../../../assets/shaders/debug_indicator.wgsl"), - format: color_format, - vertex_layouts: &[Vertex::layout()], - layouts: &[&ctx.globals_layout, &object_bind_group_layout, &layout], - }, - )); + // let corner_shader = store.shaders.insert(Shader::new( + // &ctx.gpu, + // &ShaderDesc { + // label: "ShapeRenderer::shader", + // source: include_str!("../../../assets/shaders/debug_indicator.wgsl"), + // format: color_format, + // vertex_layouts: &[Vertex::layout()], + // layouts: &[&ctx.globals_layout, object_bind_group_layout, &layout], + // }, + // )); + let border_shader = store.shaders.insert(Shader::new( &ctx.gpu, &ShaderDesc { @@ -106,16 +98,12 @@ impl DebugRenderer { source: include_str!("../../../assets/shaders/border_shader.wgsl"), format: color_format, vertex_layouts: &[Vertex::layout()], - layouts: &[&ctx.globals_layout, &object_bind_group_layout, &layout], + layouts: &[&ctx.globals_layout, object_bind_group_layout, &layout], }, )); Self { - white_image, - layout, bind_group, - sampler, mesh, - corner_shader, border_shader, layout_changes_rx, layout_changes: BTreeMap::new(), @@ -142,8 +130,6 @@ impl DebugRenderer { query .iter() .filter_map(|(entity, &args, &rect)| { - let diff = (rect.size() - args.overflow_limit).max(Vec2::ZERO); - let transform = entity.get_copy(screen_transform()).ok()?; let clip_mask = entity.get_copy(screen_clip_mask()).ok()?; @@ -178,83 +164,12 @@ impl DebugRenderer { )); }; - if diff.x > 0.0 { - // tracing::error!(%entity, %diff, ?args, %rect, "horizontal overflow detected"); - let rect = Rect::new( - vec2(args.overflow_limit.x, rect.min.y), - vec2(rect.max.x, rect.max.y), - ); - - draw(rect); - } - - if diff.y > 0.0 { - // tracing::error!(%entity, %diff, ?args, %rect, "vertical overflow detected"); - let rect = Rect::new( - vec2(rect.min.x, args.overflow_limit.y), - vec2(rect.max.x, rect.max.y), - ); - - draw(rect); - } - Some(()) }) .for_each(|_| {}); let mut query = Query::new((entity_refs(), layout_cache())); - let mut query = query.borrow(&frame.world); - - let clamped_indicators = query.iter().filter_map(|(entity, v)| { - let can_grow_vert = if v - .get_query(Direction::Vertical) - .iter() - .any(|v| v.value.hints.can_grow.any()) - { - vec3(0.5, 0.0, 0.0) - } else { - Vec3::ZERO - }; - - let can_grow_hor = if v - .get_query(Direction::Horizontal) - .iter() - .any(|v| v.value.hints.can_grow.any()) - { - vec3(0.0, 0.5, 0.0) - } else { - Vec3::ZERO - }; - - let can_grow = if v.layout().is_some_and(|v| v.value.can_grow.any()) { - vec3(0.0, 0.0, 0.5) - } else { - Vec3::ZERO - }; - - let color: Vec3 = [can_grow_vert, can_grow_hor, can_grow].into_iter().sum(); - - if color == Vec3::ZERO { - None - } else { - Some((entity, &self.corner_shader, color.extend(1.0))) - } - }); - - // let mut query = Query::new((entity_refs(), layout_cache())); - // let mut query = query.borrow(&frame.world); - - // let fixed_indicators = query.iter().filter_map(|(entity, v)| { - // let color = if v.fixed_size() { - // vec4(1.0, 1.0, 0.0, 1.0) - // } else { - // return None; - // }; - - // Some((entity, color)) - // }); - - let groups = self.layout_changes.iter().group_by(|v| v.0 .0); + let groups = self.layout_changes.iter().chunk_by(|v| v.0 .0); let objects = groups.into_iter().filter_map(|(id, group)| { let color: Vec4 = group @@ -268,8 +183,7 @@ impl DebugRenderer { Some((entity, &self.border_shader, color)) }); - let objects = clamped_indicators - .chain(objects) + let objects = objects .filter_map(|(entity, shader, color)| { let rect = entity.get_copy(rect()).ok()?.align_to_grid(); let transform = entity.get_copy(screen_transform()).ok()?; diff --git a/violet-wgpu/src/renderer/rect_renderer.rs b/violet-wgpu/src/renderer/rect_renderer.rs index 4d39684..63c3b81 100644 --- a/violet-wgpu/src/renderer/rect_renderer.rs +++ b/violet-wgpu/src/renderer/rect_renderer.rs @@ -2,8 +2,9 @@ use std::{convert::Infallible, sync::Arc}; use flax::{ entity_ids, + fetch::entity_refs, filter::{All, With}, - CommandBuffer, Component, EntityIds, Fetch, FetchExt, Mutable, Opt, OptOr, Query, + CommandBuffer, Component, EntityIds, EntityRef, Fetch, FetchExt, Mutable, Opt, OptOr, Query, }; use glam::{vec2, vec3, Mat4, Quat, Vec2, Vec4}; use image::{DynamicImage, ImageBuffer}; @@ -92,7 +93,8 @@ impl RectObjectQuery { #[fetch(transforms = [Modified])] struct RectDrawQuery { #[fetch(ignore)] - id: EntityIds, + id: flax::fetch::EntityRefs, + image: Opt>>, shape: Component<()>, clip_mask: Component, @@ -101,7 +103,7 @@ struct RectDrawQuery { impl RectDrawQuery { fn new() -> Self { Self { - id: entity_ids(), + id: entity_refs(), image: image().opt(), shape: draw_shape(shape::shape_rectangle()), clip_mask: screen_clip_mask(), @@ -213,7 +215,7 @@ impl RectRenderer { }); cmd.set( - item.id, + item.id.id(), draw_cmd(), DrawCommand { bind_group: bind_group.clone(), diff --git a/violet-wgpu/src/renderer/text_renderer.rs b/violet-wgpu/src/renderer/text_renderer.rs index 536a882..df05537 100644 --- a/violet-wgpu/src/renderer/text_renderer.rs +++ b/violet-wgpu/src/renderer/text_renderer.rs @@ -388,8 +388,8 @@ impl TextRenderer { font_size: item.font_size * sf, line_height: item.font_size * sf, }, - (item.layout_bounds.x + 5.0) * sf, - (item.layout_bounds.y + 5.0) * sf, + Some((item.layout_bounds.x + 5.0) * sf), + Some((item.layout_bounds.y + 5.0) * sf), ); // buffer.set_size(item.layout_bounds.x + 5.0, item.layout_bounds.y + 5.0); diff --git a/violet-wgpu/src/systems.rs b/violet-wgpu/src/systems.rs index 80fb3c9..fdf2671 100644 --- a/violet-wgpu/src/systems.rs +++ b/violet-wgpu/src/systems.rs @@ -95,7 +95,7 @@ pub(crate) fn update_text_buffers(text_system: Arc>) -> BoxedS // item.layout_bounds.y + 5.0, // ); - // buffer.shape_until_scroll(true); + // buffer.set_size(&mut text_system.font_system, Some(size.x), Some(size.y)); // *item.layout_glyphs = item.state.layout_glyphs(); }); diff --git a/violet-wgpu/src/text.rs b/violet-wgpu/src/text.rs index 78c8d05..3e51c91 100644 --- a/violet-wgpu/src/text.rs +++ b/violet-wgpu/src/text.rs @@ -165,7 +165,9 @@ impl TextSizeResolver { let mut buffer = state.buffer.borrow_with(&mut text_system.font_system); - buffer.set_metrics_and_size(Metrics::new(font_size, font_size), size.x, size.y); + let metrics = Metrics::new(font_size, font_size); + buffer.set_metrics(metrics); + buffer.set_size(Some(size.x), Some(size.y)); buffer.shape_until_scroll(true); From a5b6782c49853de30563b2992a1e712389805700 Mon Sep 17 00:00:00 2001 From: Freja Roberts Date: Wed, 16 Oct 2024 00:03:56 +0200 Subject: [PATCH 3/6] Revert "chore: unify `RendererContext` and `Gpu`" This reverts commit 0a191bfce8dcc7164214fe8ef0e8945ea1d97c25. --- violet-core/src/systems.rs | 5 +++-- violet-wgpu/src/renderer/mod.rs | 2 +- violet-wgpu/src/renderer/text_renderer.rs | 7 ++++++- violet-wgpu/src/renderer/window_renderer.rs | 4 ++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/violet-core/src/systems.rs b/violet-core/src/systems.rs index cb238d7..1048af5 100644 --- a/violet-core/src/systems.rs +++ b/violet-core/src/systems.rs @@ -1,12 +1,12 @@ use std::{ - collections::HashSet, + collections::{BTreeMap, HashSet}, sync::{Arc, Weak}, }; use atomic_refcell::AtomicRefCell; use flax::{ archetype::Storage, - component::ComponentValue, + component::{ComponentDesc, ComponentKey, ComponentValue}, components::child_of, entity_ids, events::{EventData, EventSubscriber}, @@ -15,6 +15,7 @@ use flax::{ Query, QueryBorrow, System, World, }; use glam::{Mat4, Vec2, Vec3, Vec3Swizzles}; +use itertools::Itertools; use crate::{ components::{ diff --git a/violet-wgpu/src/renderer/mod.rs b/violet-wgpu/src/renderer/mod.rs index 719e399..fb21206 100644 --- a/violet-wgpu/src/renderer/mod.rs +++ b/violet-wgpu/src/renderer/mod.rs @@ -392,7 +392,7 @@ impl MainRenderer { fn resize( &mut self, - ctx: &Gpu, + ctx: &RendererContext, physical_size: winit::dpi::PhysicalSize, scale_factor: f64, ) { diff --git a/violet-wgpu/src/renderer/text_renderer.rs b/violet-wgpu/src/renderer/text_renderer.rs index df05537..b08c74d 100644 --- a/violet-wgpu/src/renderer/text_renderer.rs +++ b/violet-wgpu/src/renderer/text_renderer.rs @@ -455,7 +455,12 @@ impl TextRenderer { }) } - pub(crate) fn resize(&mut self, _: &Gpu, _: winit::dpi::PhysicalSize, scale_factor: f64) { + pub(crate) fn resize( + &mut self, + _: &RendererContext, + _: winit::dpi::PhysicalSize, + scale_factor: f64, + ) { if self.scale_factor != scale_factor { self.mesh_generator.rasterizer.clear(); } diff --git a/violet-wgpu/src/renderer/window_renderer.rs b/violet-wgpu/src/renderer/window_renderer.rs index 5b522ed..9d46364 100644 --- a/violet-wgpu/src/renderer/window_renderer.rs +++ b/violet-wgpu/src/renderer/window_renderer.rs @@ -55,7 +55,6 @@ impl WindowRenderer { let logical_size: LogicalSize = physical_size.to_logical(scale_factor); let w = logical_size.width; let h = logical_size.height; - // tracing::info!("resizing canvas size to {w}x{h}"); self.ctx.globals.projview = Mat4::orthographic_lh(0.0, w, h, 0.0, 0.0, 1000.0); self.ctx @@ -63,7 +62,8 @@ impl WindowRenderer { .write(&self.ctx.gpu.queue, 0, &[self.ctx.globals]); self.main_renderer - .resize(&self.ctx.gpu, physical_size, scale_factor); + .resize(&self.ctx, physical_size, scale_factor); + self.surface.resize(&self.ctx.gpu, physical_size); } From 9d3c0b3d75ad9510e3061be146ed6b8bbb300021 Mon Sep 17 00:00:00 2001 From: Freja Roberts Date: Thu, 17 Oct 2024 00:01:31 +0200 Subject: [PATCH 4/6] chore: cleanup --- violet-core/src/systems.rs | 1 - violet-wgpu/src/renderer/rect_renderer.rs | 8 +++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/violet-core/src/systems.rs b/violet-core/src/systems.rs index 1048af5..f9212d2 100644 --- a/violet-core/src/systems.rs +++ b/violet-core/src/systems.rs @@ -15,7 +15,6 @@ use flax::{ Query, QueryBorrow, System, World, }; use glam::{Mat4, Vec2, Vec3, Vec3Swizzles}; -use itertools::Itertools; use crate::{ components::{ diff --git a/violet-wgpu/src/renderer/rect_renderer.rs b/violet-wgpu/src/renderer/rect_renderer.rs index 63c3b81..d9efb77 100644 --- a/violet-wgpu/src/renderer/rect_renderer.rs +++ b/violet-wgpu/src/renderer/rect_renderer.rs @@ -2,7 +2,6 @@ use std::{convert::Infallible, sync::Arc}; use flax::{ entity_ids, - fetch::entity_refs, filter::{All, With}, CommandBuffer, Component, EntityIds, EntityRef, Fetch, FetchExt, Mutable, Opt, OptOr, Query, }; @@ -93,8 +92,7 @@ impl RectObjectQuery { #[fetch(transforms = [Modified])] struct RectDrawQuery { #[fetch(ignore)] - id: flax::fetch::EntityRefs, - + id: EntityIds, image: Opt>>, shape: Component<()>, clip_mask: Component, @@ -103,7 +101,7 @@ struct RectDrawQuery { impl RectDrawQuery { fn new() -> Self { Self { - id: entity_refs(), + id: entity_ids(), image: image().opt(), shape: draw_shape(shape::shape_rectangle()), clip_mask: screen_clip_mask(), @@ -215,7 +213,7 @@ impl RectRenderer { }); cmd.set( - item.id.id(), + item.id, draw_cmd(), DrawCommand { bind_group: bind_group.clone(), From 2db10ad33da205341d3a92aaf441fc75416a1b1b Mon Sep 17 00:00:00 2001 From: Freja Roberts Date: Thu, 17 Oct 2024 00:08:09 +0200 Subject: [PATCH 5/6] chore: remove flax subdep --- .gitmodules | 0 Cargo.toml | 1 - flax | 1 - 3 files changed, 2 deletions(-) delete mode 100644 .gitmodules delete mode 160000 flax diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index e69de29..0000000 diff --git a/Cargo.toml b/Cargo.toml index e4447ce..11b54f5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,5 @@ [workspace] members = [ "violet-wgpu", "violet-core", "violet-demo" ] -exclude = [ "flax" ] [workspace.package] version = "0.0.1" diff --git a/flax b/flax deleted file mode 160000 index db625c0..0000000 --- a/flax +++ /dev/null @@ -1 +0,0 @@ -Subproject commit db625c0d1ed3c93220902034bd81a478ceded9a1 From 78a781a49851efe88a4f8021dbacc854bdecadfa Mon Sep 17 00:00:00 2001 From: Freja Roberts Date: Thu, 17 Oct 2024 00:13:28 +0200 Subject: [PATCH 6/6] chore: update deps and fix warnings --- Cargo.lock | 8 +- Cargo.toml | 4 +- violet-core/src/editor.rs | 2 +- violet-core/src/layout/mod.rs | 2 +- violet-core/src/layout/stack.rs | 2 +- violet-core/src/systems.rs | 4 +- violet-wgpu/src/app.rs | 3 +- violet-wgpu/src/renderer/debug_renderer.rs | 115 ++++++--------------- violet-wgpu/src/renderer/rect_renderer.rs | 2 +- violet-wgpu/src/renderer/text_renderer.rs | 6 +- violet-wgpu/src/systems.rs | 6 +- 11 files changed, 50 insertions(+), 104 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fb51238..031a78f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -990,7 +990,7 @@ dependencies = [ [[package]] name = "flax" version = "0.7.1" -source = "git+https://github.com/ten3roberts/flax#02f9f375c119b487ede481cce0a2bd27f6fb3fda" +source = "git+https://github.com/ten3roberts/flax#29c82199f8793c9942d57134c8d34a28c1ec9887" dependencies = [ "anyhow", "atomic_refcell", @@ -1008,7 +1008,7 @@ dependencies = [ [[package]] name = "flax-derive" version = "0.7.1" -source = "git+https://github.com/ten3roberts/flax#02f9f375c119b487ede481cce0a2bd27f6fb3fda" +source = "git+https://github.com/ten3roberts/flax#29c82199f8793c9942d57134c8d34a28c1ec9887" dependencies = [ "itertools 0.11.0", "proc-macro-crate 2.0.2", @@ -1657,7 +1657,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-targets 0.48.5", ] [[package]] @@ -1946,7 +1946,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate 2.0.2", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 2.0.74", diff --git a/Cargo.toml b/Cargo.toml index 11b54f5..12cf17f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -52,7 +52,7 @@ winit = "0.30" wgpu = { version = "22.1", default-features = false, features = ["fragile-send-sync-non-atomic-wasm", "webgl", "wgsl"] } palette = { version = "0.7", features = ["serializing"] } dashmap = "6.0" -image = { version = "0.25", default_features = false, features = ["png", "jpeg"] } +image = { version = "0.25", default-features = false, features = ["png", "jpeg"] } color-hex = "0.2" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" @@ -100,7 +100,7 @@ color-hex.workspace = true tracing.workspace = true futures.workspace = true -tokio = { version = "1.39", default_features= false, features = ["macros"] } +tokio = { version = "1.39", default-features= false, features = ["macros"] } serde_json = "1.0" tracing-tree.workspace = true diff --git a/violet-core/src/editor.rs b/violet-core/src/editor.rs index 7597bef..ad9086b 100644 --- a/violet-core/src/editor.rs +++ b/violet-core/src/editor.rs @@ -1,4 +1,4 @@ -use std::{fmt::Display, ops::RangeInclusive}; +use std::fmt::Display; use itertools::Itertools; use unicode_segmentation::UnicodeSegmentation; diff --git a/violet-core/src/layout/mod.rs b/violet-core/src/layout/mod.rs index 30ce816..126111c 100644 --- a/violet-core/src/layout/mod.rs +++ b/violet-core/src/layout/mod.rs @@ -13,7 +13,7 @@ use crate::{ self, anchor, aspect_ratio, children, layout, max_size, maximize, min_size, offset, padding, size, size_resolver, }, - layout::cache::{validate_cached_layout, validate_cached_query, CachedValue, LAYOUT_TOLERANCE}, + layout::cache::{validate_cached_layout, validate_cached_query, CachedValue}, Edges, Rect, }; diff --git a/violet-core/src/layout/stack.rs b/violet-core/src/layout/stack.rs index 7855031..6cd4610 100644 --- a/violet-core/src/layout/stack.rs +++ b/violet-core/src/layout/stack.rs @@ -24,7 +24,7 @@ use super::{ /// - Overlaying widgets /// - Horizontal or vertical alignment /// - Padding and margin with background colors (widgets don't inherently have a concept of "inner" -/// content, as they are their own content) +/// content, as they are their own content) /// - Centering widgets (this isn't HTML :P) /// - Limiting and expanding size of widgets #[derive(Default, Debug, Clone)] diff --git a/violet-core/src/systems.rs b/violet-core/src/systems.rs index f9212d2..cb238d7 100644 --- a/violet-core/src/systems.rs +++ b/violet-core/src/systems.rs @@ -1,12 +1,12 @@ use std::{ - collections::{BTreeMap, HashSet}, + collections::HashSet, sync::{Arc, Weak}, }; use atomic_refcell::AtomicRefCell; use flax::{ archetype::Storage, - component::{ComponentDesc, ComponentKey, ComponentValue}, + component::ComponentValue, components::child_of, entity_ids, events::{EventData, EventSubscriber}, diff --git a/violet-wgpu/src/app.rs b/violet-wgpu/src/app.rs index 15cacdd..f4bf1ab 100644 --- a/violet-wgpu/src/app.rs +++ b/violet-wgpu/src/app.rs @@ -15,7 +15,7 @@ use winit::{ use violet_core::{ animation::update_animations, assets::AssetCache, - components::{self, max_size, size}, + components::{self}, executor::Executor, input::InputState, io::{self, Clipboard}, @@ -25,7 +25,6 @@ use violet_core::{ hydrate_text, invalidate_cached_layout_system, layout_system, templating_system, transform_system, }, - unit::Unit, widget::{col, WidgetExt}, Frame, FutureEffect, Rect, Scope, Widget, }; diff --git a/violet-wgpu/src/renderer/debug_renderer.rs b/violet-wgpu/src/renderer/debug_renderer.rs index 73bbe71..c2b4543 100644 --- a/violet-wgpu/src/renderer/debug_renderer.rs +++ b/violet-wgpu/src/renderer/debug_renderer.rs @@ -1,13 +1,13 @@ use std::{collections::BTreeMap, sync::Arc}; -use flax::{fetch::entity_refs, Entity, Query}; +use flax::Entity; use glam::{vec2, vec3, vec4, Mat4, Quat, Vec4}; use itertools::Itertools; use violet_core::{ - components::{layout_args, rect, screen_clip_mask, screen_transform}, - layout::cache::{layout_cache, LayoutUpdateEvent}, + components::{rect, screen_clip_mask, screen_transform}, + layout::cache::LayoutUpdateEvent, stored::{self, Handle}, - Frame, Rect, + Frame, }; use wgpu::{BindGroup, BindGroupLayout, SamplerDescriptor, ShaderStages, TextureFormat}; @@ -29,7 +29,6 @@ pub struct DebugRenderer { mesh: Arc, border_shader: stored::Handle, - solid_shader: stored::Handle, layout_changes_rx: flume::Receiver<(Entity, LayoutUpdateEvent)>, layout_changes: BTreeMap<(Entity, LayoutUpdateEvent), usize>, @@ -108,7 +107,6 @@ impl DebugRenderer { layout_changes_rx, layout_changes: BTreeMap::new(), objects: Vec::new(), - solid_shader: todo!(), } } @@ -122,53 +120,6 @@ impl DebugRenderer { self.objects.clear(); - let mut overflow = Vec::new(); - - let mut query = Query::new((entity_refs(), layout_args(), rect())); - let mut query = query.borrow(&frame.world); - - query - .iter() - .filter_map(|(entity, &args, &rect)| { - let transform = entity.get_copy(screen_transform()).ok()?; - let clip_mask = entity.get_copy(screen_clip_mask()).ok()?; - - // let model_matrix = Mat4::from_scale_rotation_translation( - // screen_rect.size().extend(1.0), - // Quat::IDENTITY, - // screen_rect.pos().extend(0.2), - // ); - - let mut draw = |rect: Rect| { - let model_matrix = transform - * Mat4::from_scale_rotation_translation( - rect.size().extend(1.0), - Quat::IDENTITY, - rect.pos().extend(0.2), - ); - - let object_data = ObjectData { - model_matrix, - color: vec4(1.0, 0.0, 0.0, 0.5), - }; - - overflow.push(( - DrawCommand { - shader: self.solid_shader.clone(), - bind_group: self.bind_group.clone(), - mesh: self.mesh.clone(), - index_count: 6, - clip_mask, - }, - object_data, - )); - }; - - Some(()) - }) - .for_each(|_| {}); - - let mut query = Query::new((entity_refs(), layout_cache())); let groups = self.layout_changes.iter().chunk_by(|v| v.0 .0); let objects = groups.into_iter().filter_map(|(id, group)| { @@ -183,36 +134,34 @@ impl DebugRenderer { Some((entity, &self.border_shader, color)) }); - let objects = objects - .filter_map(|(entity, shader, color)| { - let rect = entity.get_copy(rect()).ok()?.align_to_grid(); - let transform = entity.get_copy(screen_transform()).ok()?; - let clip_mask = entity.get_copy(screen_clip_mask()).ok()?; - - let model_matrix = transform - * Mat4::from_scale_rotation_translation( - rect.size().extend(1.0), - Quat::IDENTITY, - rect.pos().extend(0.2), - ); - - let object_data = ObjectData { - model_matrix, - color, - }; - - Some(( - DrawCommand { - shader: shader.clone(), - bind_group: self.bind_group.clone(), - mesh: self.mesh.clone(), - index_count: 6, - clip_mask, - }, - object_data, - )) - }) - .chain(overflow); + let objects = objects.filter_map(|(entity, shader, color)| { + let rect = entity.get_copy(rect()).ok()?.align_to_grid(); + let transform = entity.get_copy(screen_transform()).ok()?; + let clip_mask = entity.get_copy(screen_clip_mask()).ok()?; + + let model_matrix = transform + * Mat4::from_scale_rotation_translation( + rect.size().extend(1.0), + Quat::IDENTITY, + rect.pos().extend(0.2), + ); + + let object_data = ObjectData { + model_matrix, + color, + }; + + Some(( + DrawCommand { + shader: shader.clone(), + bind_group: self.bind_group.clone(), + mesh: self.mesh.clone(), + index_count: 6, + clip_mask, + }, + object_data, + )) + }); self.objects.clear(); self.objects.extend(objects); diff --git a/violet-wgpu/src/renderer/rect_renderer.rs b/violet-wgpu/src/renderer/rect_renderer.rs index d9efb77..4d39684 100644 --- a/violet-wgpu/src/renderer/rect_renderer.rs +++ b/violet-wgpu/src/renderer/rect_renderer.rs @@ -3,7 +3,7 @@ use std::{convert::Infallible, sync::Arc}; use flax::{ entity_ids, filter::{All, With}, - CommandBuffer, Component, EntityIds, EntityRef, Fetch, FetchExt, Mutable, Opt, OptOr, Query, + CommandBuffer, Component, EntityIds, Fetch, FetchExt, Mutable, Opt, OptOr, Query, }; use glam::{vec2, vec3, Mat4, Quat, Vec2, Vec4}; use image::{DynamicImage, ImageBuffer}; diff --git a/violet-wgpu/src/renderer/text_renderer.rs b/violet-wgpu/src/renderer/text_renderer.rs index b08c74d..cb18b6f 100644 --- a/violet-wgpu/src/renderer/text_renderer.rs +++ b/violet-wgpu/src/renderer/text_renderer.rs @@ -159,7 +159,7 @@ impl MeshGenerator { source: include_str!("../../../assets/shaders/text.wgsl"), format: color_format, vertex_layouts: &[Vertex::layout()], - layouts: &[&globals_layout, object_layout, &text_layout], + layouts: &[globals_layout, object_layout, &text_layout], }, )); @@ -172,7 +172,7 @@ impl MeshGenerator { ..Default::default() })); - let sentinel = Arc::new(mesh_buffer.allocate(&gpu, 0, 0)); + let sentinel = Arc::new(mesh_buffer.allocate(gpu, 0, 0)); Self { rasterizer: FontRasterizer::new(gpu, sampler, text_layout, store), shader, @@ -180,6 +180,7 @@ impl MeshGenerator { } } + #[allow(clippy::too_many_arguments)] fn update_mesh( &mut self, gpu: &Gpu, @@ -187,7 +188,6 @@ impl MeshGenerator { assets: &AssetCache, text_system: &mut TextSystem, buffer: &mut Buffer, - // text: &str, mesh: &mut Arc, store: &mut RendererStore, scale_factor: f64, diff --git a/violet-wgpu/src/systems.rs b/violet-wgpu/src/systems.rs index fdf2671..fd8c7c3 100644 --- a/violet-wgpu/src/systems.rs +++ b/violet-wgpu/src/systems.rs @@ -1,6 +1,6 @@ use std::sync::Arc; -use cosmic_text::{Metrics, Wrap}; +use cosmic_text::Wrap; use flax::{ components::child_of, entity_ids, @@ -8,15 +8,13 @@ use flax::{ BoxedSystem, CommandBuffer, Component, EntityIds, Fetch, FetchExt, Mutable, OptOr, Query, QueryBorrow, RelationExt, System, World, }; -use glam::Vec2; use parking_lot::Mutex; use puffin::profile_scope; use violet_core::{ - components::{font_size, layout_bounds, layout_glyphs, rect, size_resolver, text, text_wrap}, + components::{font_size, layout_glyphs, size_resolver, text, text_wrap}, style::stylesheet, text::{LayoutGlyphs, TextSegment}, - Rect, }; use crate::text::TextSystem;