From 1bb2e2bc5d466577ae52ce872b2962a0b099bcc8 Mon Sep 17 00:00:00 2001 From: mathiasmagnusson Date: Wed, 18 May 2022 14:45:04 +0200 Subject: [PATCH 1/5] Move shaders to own directory; make clippy happy --- rendering/{ => shaders}/bindless_shader.wgsl | 0 rendering/{ => shaders}/deferred-light.wgsl | 0 rendering/{ => shaders}/deferred.wgsl | 0 rendering/{ => shaders}/egui_shader.wgsl | 0 rendering/{ => shaders}/gbuffer_copy.wgsl | 0 rendering/{ => shaders}/line_shader.wgsl | 0 rendering/{ => shaders}/shader.wgsl | 0 rendering/src/model.rs | 2 +- rendering/src/renderer.rs | 10 ++++------ rendering/src/renderer/gbuffer.rs | 2 +- rendering/src/renderer/world.rs | 17 ++++++++-------- rendering/src/ui.rs | 21 +++++++++----------- 12 files changed, 23 insertions(+), 29 deletions(-) rename rendering/{ => shaders}/bindless_shader.wgsl (100%) rename rendering/{ => shaders}/deferred-light.wgsl (100%) rename rendering/{ => shaders}/deferred.wgsl (100%) rename rendering/{ => shaders}/egui_shader.wgsl (100%) rename rendering/{ => shaders}/gbuffer_copy.wgsl (100%) rename rendering/{ => shaders}/line_shader.wgsl (100%) rename rendering/{ => shaders}/shader.wgsl (100%) diff --git a/rendering/bindless_shader.wgsl b/rendering/shaders/bindless_shader.wgsl similarity index 100% rename from rendering/bindless_shader.wgsl rename to rendering/shaders/bindless_shader.wgsl diff --git a/rendering/deferred-light.wgsl b/rendering/shaders/deferred-light.wgsl similarity index 100% rename from rendering/deferred-light.wgsl rename to rendering/shaders/deferred-light.wgsl diff --git a/rendering/deferred.wgsl b/rendering/shaders/deferred.wgsl similarity index 100% rename from rendering/deferred.wgsl rename to rendering/shaders/deferred.wgsl diff --git a/rendering/egui_shader.wgsl b/rendering/shaders/egui_shader.wgsl similarity index 100% rename from rendering/egui_shader.wgsl rename to rendering/shaders/egui_shader.wgsl diff --git a/rendering/gbuffer_copy.wgsl b/rendering/shaders/gbuffer_copy.wgsl similarity index 100% rename from rendering/gbuffer_copy.wgsl rename to rendering/shaders/gbuffer_copy.wgsl diff --git a/rendering/line_shader.wgsl b/rendering/shaders/line_shader.wgsl similarity index 100% rename from rendering/line_shader.wgsl rename to rendering/shaders/line_shader.wgsl diff --git a/rendering/shader.wgsl b/rendering/shaders/shader.wgsl similarity index 100% rename from rendering/shader.wgsl rename to rendering/shaders/shader.wgsl diff --git a/rendering/src/model.rs b/rendering/src/model.rs index 73154dc..c2e7b97 100644 --- a/rendering/src/model.rs +++ b/rendering/src/model.rs @@ -398,7 +398,7 @@ fn load_material( texture::Texture::load(device, queue, containing_folder.join(diffuse_path))?; let normal_path = mat.normal_texture; - let normal_texture = if normal_path == "" { + let normal_texture = if normal_path.is_empty() { let img = image::Rgb32FImage::from_pixel(1, 1, image::Rgb([0.0, 0.0, 1.0])); texture::Texture::from_image( device, diff --git a/rendering/src/renderer.rs b/rendering/src/renderer.rs index b10a231..445e228 100644 --- a/rendering/src/renderer.rs +++ b/rendering/src/renderer.rs @@ -1,7 +1,6 @@ use std::iter; use std::mem; -use egui; use pollster::FutureExt; use raw_window_handle::HasRawWindowHandle; @@ -297,11 +296,11 @@ impl Renderer { let shader = device.create_shader_module(&wgpu::ShaderModuleDescriptor { label: Some("shader.wgsl"), - source: wgpu::ShaderSource::Wgsl(include_str!("../shader.wgsl").into()), + source: wgpu::ShaderSource::Wgsl(include_str!("../shaders/shader.wgsl").into()), }); let line_shader = device.create_shader_module(&wgpu::ShaderModuleDescriptor { label: Some("line_shader.wgsl"), - source: wgpu::ShaderSource::Wgsl(include_str!("../line_shader.wgsl").into()), + source: wgpu::ShaderSource::Wgsl(include_str!("../shaders/line_shader.wgsl").into()), }); let depth_texture = texture::Texture::new_depth_texture(&device, &config, true); @@ -380,7 +379,7 @@ impl Renderer { } pub fn update_camera(&mut self) { - self.worlds[0].camera = self.camera.clone(); + self.worlds[0].camera = self.camera; self.worlds[0].update_camera(&self.queue, self.painter.last_aspect); } @@ -482,8 +481,7 @@ impl Renderer { &mut ui_render_pass, meshes, pixels_per_point, - self.config.height, - self.config.width, + (self.config.width, self.config.height), ); } diff --git a/rendering/src/renderer/gbuffer.rs b/rendering/src/renderer/gbuffer.rs index 177d811..97e1154 100644 --- a/rendering/src/renderer/gbuffer.rs +++ b/rendering/src/renderer/gbuffer.rs @@ -158,7 +158,7 @@ impl GBuffer { } } - pub fn color_attachments<'a>(&'a self) -> [wgpu::RenderPassColorAttachment<'a>; 3] { + pub fn color_attachments(&self) -> [wgpu::RenderPassColorAttachment; 3] { let diffuse = wgpu::RenderPassColorAttachment { view: &self.diffuse.view, resolve_target: None, diff --git a/rendering/src/renderer/world.rs b/rendering/src/renderer/world.rs index d11af6e..105397e 100644 --- a/rendering/src/renderer/world.rs +++ b/rendering/src/renderer/world.rs @@ -174,11 +174,10 @@ impl Light { .. } = self; let almost_black = 1.0 / (5.0 / 256.0 / 12.92); // convert sRGB to linear - let radius = (-linear - + f32::sqrt(linear * linear - 4.0 * quadratic * (constant - almost_black * light_max))) - / (2.0 * quadratic); - radius + (-linear + + f32::sqrt(linear.powi(2) - 4.0 * quadratic * (constant - almost_black * light_max))) + / (2.0 * quadratic) } } @@ -552,7 +551,7 @@ impl World { let deferred_shader = rd .device - .create_shader_module(&wgpu::include_wgsl!("../../deferred.wgsl")); + .create_shader_module(&wgpu::include_wgsl!("../../shaders/deferred.wgsl")); let blend = Some(wgpu::BlendState { color: wgpu::BlendComponent::REPLACE, @@ -624,7 +623,7 @@ impl World { // this pipeline does nothing but copy over color data let copy_shader = rd .device - .create_shader_module(&wgpu::include_wgsl!("../../gbuffer_copy.wgsl")); + .create_shader_module(&wgpu::include_wgsl!("../../shaders/gbuffer_copy.wgsl")); let copy_pipeline_layout = rd.device .create_pipeline_layout(&wgpu::PipelineLayoutDescriptor { @@ -670,7 +669,7 @@ impl World { let light_shader = rd .device - .create_shader_module(&wgpu::include_wgsl!("../../deferred-light.wgsl")); + .create_shader_module(&wgpu::include_wgsl!("../../shaders/deferred-light.wgsl")); let light_pipeline_layout = rd.device .create_pipeline_layout(&wgpu::PipelineLayoutDescriptor { @@ -928,7 +927,7 @@ impl World { let mut render_pass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { label: Some("Render Pass"), color_attachments: &[wgpu::RenderPassColorAttachment { - view: &render_target, + view: render_target, resolve_target: None, ops: wgpu::Operations { load: wgpu::LoadOp::Clear(wgpu::Color { r, g, b, a: 1.0 }), @@ -1036,7 +1035,7 @@ impl World { let mut render_pass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { label: Some("Line Render Pass"), color_attachments: &[wgpu::RenderPassColorAttachment { - view: &render_target, + view: render_target, resolve_target: None, ops: wgpu::Operations { load: wgpu::LoadOp::Load, diff --git a/rendering/src/ui.rs b/rendering/src/ui.rs index 94c7c6b..d8f900e 100644 --- a/rendering/src/ui.rs +++ b/rendering/src/ui.rs @@ -135,7 +135,7 @@ impl Painter { let shader = device.create_shader_module(&wgpu::ShaderModuleDescriptor { label: Some("egui_shader.wgsl"), - source: wgpu::ShaderSource::Wgsl(include_str!("../egui_shader.wgsl").into()), + source: wgpu::ShaderSource::Wgsl(include_str!("../shaders/egui_shader.wgsl").into()), }); let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor { @@ -270,8 +270,7 @@ impl Painter { pass: &mut wgpu::RenderPass<'a>, meshes: Vec, pixels_per_point: f32, - physical_height: u32, - physical_width: u32, + physical_size: (u32, u32), ) { // find the highest number of vertices and whatnot beforehand // this is annoying to do in the loop later due to renderpass @@ -346,8 +345,8 @@ impl Painter { let ScissorRect { x, y, w, h } = transform_rect_to_ndc( clip_rect, pixels_per_point, - physical_height, - physical_width, + physical_size.0, + physical_size.1, ); // Skip rendering with zero-sized clip areas. if w == 0 || h == 0 { @@ -507,15 +506,13 @@ impl Painter { // the entry API, possibly we could move away from ahash altogether. let tex_exists = self.textures.get(&id).is_some(); - let texture; - - if tex_exists { - texture = &self.textures.get(&id).unwrap().tex; + let texture = if tex_exists { + &self.textures.get(&id).unwrap().tex } else { let tex = self.make_tex(id, device, texture_size); self.textures.insert(id, tex); - texture = &self.textures.get(&id).unwrap().tex; - } + &self.textures.get(&id).unwrap().tex + }; // I think offset is just an index into the image buffer? // if it isn't then this is **completely** wrong, @@ -575,8 +572,8 @@ struct ScissorRect { fn transform_rect_to_ndc( clip_rect: egui::Rect, pixels_per_point: f32, - physical_height: u32, physical_width: u32, + physical_height: u32, ) -> ScissorRect { // code from https://github.com/hasenbanck/egui_wgpu_backend From 0dc7a9b5a4162baa1d91099827707c1fd39f1123 Mon Sep 17 00:00:00 2001 From: mathiasmagnusson Date: Thu, 19 May 2022 17:06:25 +0200 Subject: [PATCH 2/5] =?UTF-8?q?Fix=20some=20deadly=20bugs=20=F0=9F=AA=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ecs/src/lib.rs | 2 +- ecs/src/query/macros.rs | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ecs/src/lib.rs b/ecs/src/lib.rs index ec7db73..9790aec 100644 --- a/ecs/src/lib.rs +++ b/ecs/src/lib.rs @@ -604,7 +604,7 @@ mod tests { let pos_id = world.component_registry_mut().register::(); let vel_id = world.component_registry_mut().register::(); - for i in 0..1000 { + for i in 0..100 { let entity = world.spawn(); world.add(entity, Position(i as f32)); world.add(entity, Velocity(1.5)); diff --git a/ecs/src/query/macros.rs b/ecs/src/query/macros.rs index 400f177..23012fe 100644 --- a/ecs/src/query/macros.rs +++ b/ecs/src/query/macros.rs @@ -249,6 +249,20 @@ macro_rules! _query_defvars_combs { ( $comps1:expr, $comps2:expr, $lt:expr, $entity:expr, ($name:tt: Entity) ) => { let $name = $entity; }; + // opt + ( $comps1:expr, $comps2:expr, $lt:expr, $entity:expr, ($name:tt: Option<$type:ty>) ) => { + let $name = unsafe { ( + $crate::query::_as_opt_ref_lt($lt, $comps1[0].cast::<$type>()), + $crate::query::_as_opt_ref_lt($lt, $comps2[0].cast::<$type>()), + ) }; + }; + // opt mut + ( $comps1:expr, $comps2:expr, $lt:expr, $entity:expr, ($name:tt: mut Option<$type:ty>) ) => { + let $name = unsafe { ( + $crate::query::_as_opt_mut_lt($lt, $comps1[0].cast::<$type>()), + $crate::query::_as_opt_mut_lt($lt, $comps2[0].cast::<$type>()), + ) }; + }; // comp ( $comps1:expr, $comps2:expr, $lt:expr, $entity:expr, ($name:tt: $type:ty) ) => { let $name = unsafe { ( From a0db71875f2c2c103578ff14a7362814e5d52e72 Mon Sep 17 00:00:00 2001 From: mathiasmagnusson Date: Thu, 19 May 2022 18:54:25 +0200 Subject: [PATCH 3/5] Fix a memory leak --- ecs/src/commands/command.rs | 21 ++++++++++++++++++--- ecs/src/commands/command_buffer.rs | 3 +++ ecs/src/commands/mod.rs | 19 ++++++++++++------- ecs/src/lib.rs | 2 +- 4 files changed, 34 insertions(+), 11 deletions(-) diff --git a/ecs/src/commands/command.rs b/ecs/src/commands/command.rs index 7747d23..5a55204 100644 --- a/ecs/src/commands/command.rs +++ b/ecs/src/commands/command.rs @@ -1,4 +1,9 @@ -use std::{alloc::Layout, any::TypeId, borrow::Cow, mem, ptr}; +use std::{ + alloc::{self, Layout}, + any::TypeId, + borrow::Cow, + mem, ptr, +}; use crate::{Entity, World}; @@ -41,7 +46,13 @@ impl Command { .register_raw(*type_id, name, *layout, *drop) }, }; - unsafe { world.add_raw(*entity, *component, comp_id) }; + unsafe { + world.add_raw(*entity, *component, comp_id); + // NOTE: the world takes ownership of the value of component, so we don't run + // its destructor here, but we still own the allocation so we need to free it + // here + alloc::dealloc(*component, *layout); + }; *component = ptr::null_mut(); } } @@ -52,9 +63,13 @@ impl Drop for Command { fn drop(&mut self) { match self { &mut Command::AddComponent { - component, drop, .. + component, + drop, + layout, + .. } if !component.is_null() => unsafe { drop(component); + alloc::dealloc(component, layout); }, _ => {} } diff --git a/ecs/src/commands/command_buffer.rs b/ecs/src/commands/command_buffer.rs index 4f92210..15129c6 100644 --- a/ecs/src/commands/command_buffer.rs +++ b/ecs/src/commands/command_buffer.rs @@ -2,6 +2,9 @@ use crate::World; use super::Command; +// TODO: optimize this by not making `Command` an enum and so that these can be packed with less +// padding. This would also allow us to keep components with a size only known at runtime directly +// in here instead of having a pointer to an extra allocation. #[derive(Debug, Default)] pub struct CommandBuffer { commands: Vec, diff --git a/ecs/src/commands/mod.rs b/ecs/src/commands/mod.rs index 3105ee5..8232443 100644 --- a/ecs/src/commands/mod.rs +++ b/ecs/src/commands/mod.rs @@ -1,7 +1,8 @@ use std::{ - alloc::Layout, + alloc::{self, Layout}, any::{self, TypeId}, borrow::Cow, + ptr, }; mod command; @@ -29,7 +30,8 @@ use crate::{Entities, Entity}; /// commands.despawn(e1); /// /// assert!(world.entities().exists(e2)); // NOTE: some commands, like spawning entities happen immediately -/// assert!(world.entities().exists(e1)); // but others happen when the command buffer is applied +/// assert!(world.entities().exists(e1)); // but others, like despawning happen when the command +/// // buffer is applied /// assert!(world.get::(e2).is_none()); /// /// command_buffer.apply(&mut world); @@ -50,7 +52,7 @@ impl<'b, 'e> Commands<'b, 'e> { } /// Creates a new `entity`. See `Entities::spawn` for more information. - pub fn spawn(&mut self) -> Entity { + pub fn spawn(&self) -> Entity { self.entities.spawn() } @@ -67,15 +69,18 @@ impl<'b, 'e> Commands<'b, 'e> { unsafe fn drop(ptr: *mut u8) { ptr.cast::().drop_in_place(); } - let component = Box::new(component); - let component = Box::into_raw(component); - let component = component as *mut u8; + let layout = Layout::new::(); + let component = unsafe { + let p = alloc::alloc(layout); + ptr::write(p as *mut T, component); + p + }; self.buffer.add(Command::AddComponent { entity, type_id: TypeId::of::(), name: Cow::Borrowed(any::type_name::()), component, - layout: Layout::new::(), + layout, drop: drop::, }); } diff --git a/ecs/src/lib.rs b/ecs/src/lib.rs index 9790aec..8e13990 100644 --- a/ecs/src/lib.rs +++ b/ecs/src/lib.rs @@ -896,7 +896,7 @@ mod tests { let mut commands = Commands::new(&mut command_buffer, world.entities()); let e1 = commands.spawn(); - commands.add(e1, Counter::named(counter.clone(), "a")); + commands.add(e1, Counter::new(counter.clone())); assert_eq!(counter.get(), 1); } From de911ad09a3d60caef97bab67c969acedaf98a50 Mon Sep 17 00:00:00 2001 From: mathiasmagnusson Date: Thu, 19 May 2022 23:04:28 +0200 Subject: [PATCH 4/5] Refactor rendering; integrate with ecs partially --- common/src/lib.rs | 11 +- ecs/src/query/mod.rs | 12 +- examples/runtime/src/editor.rs | 69 +-- examples/runtime/src/physics_context.rs | 163 +++---- game-engine/src/engine.rs | 12 +- game-engine/src/lib.rs | 1 + game-engine/src/rendering_systems.rs | 26 + rendering/src/camera.rs | 35 +- rendering/src/lib.rs | 2 +- rendering/src/model.rs | 47 -- rendering/src/renderer.rs | 384 ++++++++------- rendering/src/renderer/world.rs | 618 ++++++++++++------------ rendering/src/ui.rs | 2 + 13 files changed, 707 insertions(+), 675 deletions(-) create mode 100644 game-engine/src/rendering_systems.rs diff --git a/common/src/lib.rs b/common/src/lib.rs index d7112f4..d7e735a 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -10,9 +10,18 @@ pub type Mat4 = vek::mat::repr_c::Mat4; pub type Ray = vek::Ray; -#[derive(Copy, Clone, Debug)] +#[derive(Debug, Copy, Clone, Default)] pub struct Transform { pub position: Vec3, pub rotation: Quaternion, pub scale: Vec3, } + +impl Transform { + pub fn at(position: Vec3) -> Self { + Transform { + position, + ..Default::default() + } + } +} diff --git a/ecs/src/query/mod.rs b/ecs/src/query/mod.rs index aef8e44..6458bd6 100644 --- a/ecs/src/query/mod.rs +++ b/ecs/src/query/mod.rs @@ -135,11 +135,13 @@ impl<'a, 'r, 'q> Iterator for Iter<'a, 'r, 'q> { type Item = (Entity, Vec<*mut u8>); fn next(&mut self) -> Option { - self.entity_iter.next().and_then(|e| unsafe { - self.res - .try_get_by_index(self.entity_iter.entities().id(e).unwrap()) - .map(|comps| (e, comps)) - }) + loop { + let entity = self.entity_iter.next()?; + let id = self.entity_iter.entities().id(entity).unwrap(); + if let Some(comps) = unsafe { self.res.try_get_by_index(id) } { + return Some((entity, comps)); + } + } } } diff --git a/examples/runtime/src/editor.rs b/examples/runtime/src/editor.rs index 0283449..ce29867 100644 --- a/examples/runtime/src/editor.rs +++ b/examples/runtime/src/editor.rs @@ -8,16 +8,17 @@ use winit::{ event_loop::EventLoop, }; -use common::{Vec2, Vec3}; +use common::{Transform, Vec2, Vec3}; use game_engine::{ + ecs::query_iter, physics, - rendering::{Line, Renderer}, + rendering::{Camera, Light, Line, Renderer, WorldId}, Engine, }; use crate::{ camera_controller::CameraController, - physics_context::PhysicsScene, + physics_context::setup_scene, window::{Window, WindowMode}, }; @@ -27,7 +28,7 @@ pub struct Editor { state: EguiWinitState, egui_context: EguiContext, camera_controller: CameraController, - scene: PhysicsScene, + camera: Camera, last_frame: Instant, } @@ -64,7 +65,16 @@ impl Editor { Vec2::new(-0.3, 135f32.to_radians()), ); - let scene = PhysicsScene::new(&mut engine).with_context(|| "failed to create the scene")?; + let camera = Camera { + eye: (0.0, 5.0, -10.0).into(), + target: (0.0, 0.0, 0.0).into(), + up: Vec3::unit_y(), + fovy: 45f32.to_radians(), + znear: 0.1, + zfar: 2000.0, + }; + + setup_scene(&mut engine).with_context(|| "failed to set up scene")?; let state = EguiWinitState::new(4096, window.winit_window()); let egui_context = EguiContext::default(); { @@ -80,7 +90,7 @@ impl Editor { state, egui_context, camera_controller, - scene, + camera, last_frame: Instant::now(), }, )) @@ -163,11 +173,11 @@ impl Editor { self.last_frame = now; self.engine.update(); - self.scene.update(&mut self.engine); - self.camera_controller - .update_camera(dt, &mut self.engine.renderer.camera); - self.engine.renderer.update_camera(); + let world_id = *self.engine.world.resource::().unwrap(); + + self.camera_controller.update_camera(dt, &mut self.camera); + self.engine.renderer.set_camera(world_id, self.camera); let pos_r = || -100.0..=100.0; let k_r = || 0.0..=1.0; @@ -177,23 +187,25 @@ impl Editor { egui::Window::new("The Stuff®") .auto_sized() .show(ctx, |ui| { - ui.label("Light position"); - ui.spacing_mut().slider_width *= 2.0; - ui.add(Slider::new(&mut self.scene.light.pos.x, pos_r()).text("x")); - ui.add(Slider::new(&mut self.scene.light.pos.y, pos_r()).text("y")); - ui.add(Slider::new(&mut self.scene.light.pos.z, pos_r()).text("z")); - - ui.label("scene.Light attenuation factors"); - ui.add(Slider::new(&mut self.scene.light.k_constant, k_r()).text("k_c")); - ui.add(Slider::new(&mut self.scene.light.k_linear, k_r()).text("k_l")); - ui.add(Slider::new(&mut self.scene.light.k_quadratic, k_r()).text("k_q")); - - ui.label("Light color"); - egui::widgets::color_picker::color_edit_button_rgb( - ui, - &mut self.scene.light.color, - ); - + let mut deferred = self.engine.renderer.get_deferred(world_id); + ui.checkbox(&mut deferred, "Use deferred rendering"); + self.engine.renderer.set_deferred(world_id, deferred); + query_iter!(self.engine.world, (transform: mut Transform, light: mut Light) => { + ui.label("Light position"); + ui.spacing_mut().slider_width *= 2.0; + ui.add(Slider::new(&mut transform.position.x, pos_r()).text("x")); + ui.add(Slider::new(&mut transform.position.y, pos_r()).text("y")); + ui.add(Slider::new(&mut transform.position.z, pos_r()).text("z")); + + ui.label("scene.Light attenuation factors"); + ui.add(Slider::new(&mut light.k_constant, k_r()).text("k_c")); + ui.add(Slider::new(&mut light.k_linear, k_r()).text("k_l")); + ui.add(Slider::new(&mut light.k_quadratic, k_r()).text("k_q")); + + ui.label("Light color"); + egui::widgets::color_picker::color_edit_button_rgb(ui, &mut light.color); + + }); if let Some(gravity) = self.engine.world.resource_mut::() { ui.label("Gravity"); ui.add(Slider::new(&mut gravity.0.y, -20.0..=20.0).text("k_q")); @@ -210,12 +222,11 @@ impl Editor { if self.window.inner_size() != (0, 0) { match self.engine.renderer.render( + world_id, lines, - &[self.scene.light], &self.egui_context, full_output, self.egui_context.pixels_per_point(), - false, ) { Ok(_) => (), Err(e) => log::error!("Failed to render: {}", e), diff --git a/examples/runtime/src/physics_context.rs b/examples/runtime/src/physics_context.rs index 5486633..db66e03 100644 --- a/examples/runtime/src/physics_context.rs +++ b/examples/runtime/src/physics_context.rs @@ -3,113 +3,92 @@ use rand::Rng as _; use common::{Quaternion, Transform, Vec3}; use game_engine::{ - ecs::query_iter, physics::{self, Collider, CubeCollider, PhysicsMaterial, Rigidbody, SphereCollider}, - rendering::{model::ModelIndex, Light, Line}, + rendering::{Light, Line, WorldId}, Engine, }; -// TODO: remove -pub struct PhysicsScene { - // TODO: move into world - pub cube_model: ModelIndex, - // TODO: move into world - pub ball_model: ModelIndex, - // TODO: move into world - pub light: Light, - // TODO: move into world - pub extra_dt: f32, -} +pub fn setup_scene(engine: &mut Engine) -> Result<(), anyhow::Error> { + let mut rng = rand::thread_rng(); + + let world = &mut engine.world; + + let world_id = *world.resource::().unwrap(); -impl PhysicsScene { - pub fn new(engine: &mut Engine) -> Result { - let mut rng = rand::thread_rng(); + let cube_model = engine + .renderer + .load_model(world_id, "res/cube.obj") + .with_context(|| "failed to open cube.obj")?; + let ball_model = engine + .renderer + .load_model(world_id, "res/ball.obj") + .with_context(|| "failed to open ball.obj")?; - let world = &mut engine.world; + let physics_material = PhysicsMaterial { + friction: 1.0, + restfullness: 0.0, + }; - let physics_material = PhysicsMaterial { - friction: 1.0, - restfullness: 0.0, - }; + world.add_resource(physics::Gravity::default()); + world.add_resource::>(vec![]); - world.add_resource(physics::Gravity::default()); - world.add_resource::>(vec![]); + let platform = world.spawn(); + world.add( + platform, + Transform { + position: Vec3::new(0.0, 0.0, 0.0), + rotation: Quaternion::rotation_x(10.0f32.to_radians()), + scale: Vec3::new(10.0, 1.0, 10.0), + }, + ); + world.add(platform, Rigidbody::new_static()); + world.add( + platform, + Collider::Cube(CubeCollider::new(Vec3::one(), physics_material)), + ); + world.add(platform, cube_model); - let platform = world.spawn(); + for i in 0..40 { + let entity = world.spawn(); + let scale = rng.gen_range(1.0..1.5); world.add( - platform, + entity, Transform { - position: Vec3::new(0.0, 0.0, 0.0), - rotation: Quaternion::rotation_x(10.0f32.to_radians()), - scale: Vec3::new(10.0, 1.0, 10.0), + position: Vec3::new( + rng.gen_range(-10.0..10.0), + rng.gen_range(14.0..30.0), + rng.gen_range(-10.0..10.0), + ), + rotation: Quaternion::identity() + .rotated_x(rng.gen_range(0.0f32..360.0f32).to_radians()) + .rotated_y(rng.gen_range(0.0f32..360.0f32).to_radians()) + .rotated_z(rng.gen_range(0.0f32..360.0f32).to_radians()), + scale: Vec3::broadcast(scale), }, ); - world.add(platform, Rigidbody::new_static()); + world.add(entity, Rigidbody::new(1.)); world.add( - platform, - Collider::Cube(CubeCollider::new(Vec3::one(), physics_material)), - ); - - for i in 0..40 { - let entity = world.spawn(); - let scale = rng.gen_range(1.0..1.5); - world.add( - entity, - Transform { - position: Vec3::new( - rng.gen_range(-10.0..10.0), - rng.gen_range(14.0..30.0), - rng.gen_range(-10.0..10.0), - ), - rotation: Quaternion::identity() - .rotated_x(rng.gen_range(0.0f32..360.0f32).to_radians()) - .rotated_y(rng.gen_range(0.0f32..360.0f32).to_radians()) - .rotated_z(rng.gen_range(0.0f32..360.0f32).to_radians()), - scale: Vec3::broadcast(scale), - }, - ); - world.add(entity, Rigidbody::new(1.)); - world.add( - entity, - if i < 20 { - Collider::Cube(CubeCollider::new(Vec3::one(), physics_material)) - } else { - Collider::Sphere(SphereCollider::new(1., physics_material)) - }, - ); - } - - Ok(Self { - cube_model: engine - .renderer - .load_model("res/cube.obj") - .with_context(|| "failed to open cube.obj")?, - ball_model: engine - .renderer - .load_model("res/ball.obj") - .with_context(|| "failed to open ball.obj")?, - light: Light { - pos: Vec3::unit_y() * 30.0, - color: [1.0; 3], - k_constant: 1.0, - k_linear: 0.0014, - k_quadratic: 0.000007, + entity, + if i < 20 { + Collider::Cube(CubeCollider::new(Vec3::one(), physics_material)) + } else { + Collider::Sphere(SphereCollider::new(1., physics_material)) }, - extra_dt: 0.0, - }) + ); + world.add(entity, if i < 20 { cube_model } else { ball_model }); } - pub fn update(&mut self, engine: &mut Engine) { - let mut mgr = engine.renderer.get_models_mut(); - let mut cube_transforms = vec![]; - let mut ball_transforms = vec![]; - query_iter!(engine.world, (transform: Transform, collider: Collider) => { - match collider { - Collider::Cube(_) => &mut cube_transforms, - Collider::Sphere(_) => &mut ball_transforms, - }.push(*transform); - }); - mgr.set_transforms(self.cube_model, cube_transforms); - mgr.set_transforms(self.ball_model, ball_transforms); - } + let light = world.spawn(); + world.add(light, Transform::at(Vec3::unit_y() * 30.)); + world.add( + light, + Light { + color: [1.0; 3], + k_constant: 1.0, + k_linear: 0.0014, + k_quadratic: 0.000007, + }, + ); + + Ok(()) } diff --git a/game-engine/src/engine.rs b/game-engine/src/engine.rs index f31663a..e8d824c 100644 --- a/game-engine/src/engine.rs +++ b/game-engine/src/engine.rs @@ -3,7 +3,7 @@ use std::time::Instant; use ecs::World; use rendering::Renderer; -use crate::{physics_systems, time::TIME_STEP, Time}; +use crate::{physics_systems, rendering_systems, time::TIME_STEP, Time}; pub struct Engine { pub renderer: Renderer, @@ -13,10 +13,14 @@ pub struct Engine { } impl Engine { - pub fn new(renderer: Renderer) -> Self { + pub fn new(mut renderer: Renderer) -> Self { + let world_id = renderer.create_world(); + let mut world = World::default(); + world.add_resource(world_id); + Self { renderer, - world: World::default(), + world, last_update: None, } } @@ -41,5 +45,7 @@ impl Engine { i += 1; } self.last_update = Some(last_update); + + rendering_systems::render(&mut self.renderer, &mut self.world); } } diff --git a/game-engine/src/lib.rs b/game-engine/src/lib.rs index a8d3ed3..f535ccc 100644 --- a/game-engine/src/lib.rs +++ b/game-engine/src/lib.rs @@ -1,5 +1,6 @@ mod engine; mod physics_systems; +mod rendering_systems; mod time; pub use ecs; diff --git a/game-engine/src/rendering_systems.rs b/game-engine/src/rendering_systems.rs new file mode 100644 index 0000000..b33b757 --- /dev/null +++ b/game-engine/src/rendering_systems.rs @@ -0,0 +1,26 @@ +use std::collections::HashMap; + +use common::Transform; +use ecs::{query_iter, World}; +use rendering::{model::ModelIndex, Light, Renderer, WorldId}; + +pub fn render(renderer: &mut Renderer, world: &mut World) { + let world_id = if let Some(id) = world.resource::() { + *id + } else { + return; + }; + + let mut transforms = HashMap::>::new(); + query_iter!(world, (transform: Transform, model: ModelIndex) => { + transforms.entry(*model).or_insert_with(Vec::new).push(*transform); + }); + + let mut lights = vec![]; + query_iter!(world, (light: Light, transform: Transform) => { + lights.push((*light, transform.position)); + }); + renderer.set_lights(world_id, lights); + + renderer.update_instances(world_id, transforms.iter().map(|(&i, ts)| (i, ts.as_ref()))); +} diff --git a/rendering/src/camera.rs b/rendering/src/camera.rs index 5517de3..98e176c 100644 --- a/rendering/src/camera.rs +++ b/rendering/src/camera.rs @@ -7,18 +7,17 @@ pub struct Camera { pub eye: Vec3, pub target: Vec3, pub up: Vec3, - pub aspect: f32, pub fovy: f32, pub znear: f32, pub zfar: f32, } impl Camera { - fn build_view_projection_matrix(&self) -> Mat4 { + fn build_view_projection_matrix(&self, aspect: f32) -> Mat4 { let view = Mat4::look_at_rh(self.eye, self.target, self.up); // This function just uses `width / height` to calculate the aspect ratio, so `aspect, 1.` // should effectively do what we want. - let proj = Mat4::perspective_fov_rh_zo(self.fovy, self.aspect, 1., self.znear, self.zfar); + let proj = Mat4::perspective_fov_rh_zo(self.fovy, aspect, 1., self.znear, self.zfar); proj * view } } @@ -31,22 +30,40 @@ pub struct CameraUniform { _padding: u32, } +impl Default for CameraUniform { + fn default() -> Self { + Self { + view_proj: unsafe { + mem::transmute( + opengl_to_wgpu_matrix() + * Mat4::perspective_fov_rh_zo(30f32.to_radians(), 2., 1., 0.1, 1000.) + * Mat4::look_at_rh(Vec3::zero(), -Vec3::unit_z(), Vec3::unit_y()), + ) + }, + world_pos: [0.; 3], + _padding: 0, + } + } +} + impl CameraUniform { - pub fn new(camera: &Camera) -> Self { + pub fn new(camera: &Camera, aspect: f32) -> Self { Self { - view_proj: Self::get_view_proj(camera), + view_proj: Self::get_view_proj(camera, aspect), world_pos: camera.eye.into_array(), _padding: 0, } } - pub fn update_view_proj(&mut self, camera: &Camera) { - self.view_proj = Self::get_view_proj(camera); + pub fn update_view_proj(&mut self, camera: &Camera, aspect: f32) { + self.view_proj = Self::get_view_proj(camera, aspect); self.world_pos = camera.eye.into_array(); } - fn get_view_proj(camera: &Camera) -> [[f32; 4]; 4] { - unsafe { mem::transmute(opengl_to_wgpu_matrix() * camera.build_view_projection_matrix()) } + fn get_view_proj(camera: &Camera, aspect: f32) -> [[f32; 4]; 4] { + unsafe { + mem::transmute(opengl_to_wgpu_matrix() * camera.build_view_projection_matrix(aspect)) + } } } diff --git a/rendering/src/lib.rs b/rendering/src/lib.rs index d702cd0..65790fd 100644 --- a/rendering/src/lib.rs +++ b/rendering/src/lib.rs @@ -13,4 +13,4 @@ mod renderer; pub use camera::Camera; pub use error::RenderingError; pub use renderer::world::Light; -pub use renderer::{Line, Renderer}; +pub use renderer::{Line, Renderer, WorldId}; diff --git a/rendering/src/model.rs b/rendering/src/model.rs index c2e7b97..2fe3fd7 100644 --- a/rendering/src/model.rs +++ b/rendering/src/model.rs @@ -1,4 +1,3 @@ -use std::collections::HashMap; use std::mem; use std::ops::{Range, RangeBounds}; use std::path::Path; @@ -534,39 +533,6 @@ pub struct ModelStorage { instance_buffers: Vec, } -#[derive(Debug)] -pub struct ModelManager<'a> { - device: &'a wgpu::Device, - queue: &'a wgpu::Queue, - storage: &'a mut ModelStorage, - pending_writes: HashMap>, -} - -impl<'a> ModelManager<'a> { - pub fn get_transforms_mut>( - &mut self, - model: ModelIndex, - range: R, - ) -> &mut [Transform] { - self.pending_writes - .entry(model) - .or_insert_with(|| self.storage.get_transforms(model, range).to_vec()) - } - - pub fn set_transforms(&mut self, model: ModelIndex, transforms: Vec) { - self.pending_writes.insert(model, transforms); - } -} - -impl<'a> Drop for ModelManager<'a> { - fn drop(&mut self) { - for (model, data) in &mut self.pending_writes.drain() { - self.storage - .set_transforms(self.device, self.queue, model, data); - } - } -} - impl ModelStorage { pub fn new() -> Self { Self { @@ -576,19 +542,6 @@ impl ModelStorage { } } - pub fn get_manager<'a>( - &'a mut self, - device: &'a wgpu::Device, - queue: &'a wgpu::Queue, - ) -> ModelManager<'a> { - ModelManager { - device, - queue, - storage: self, - pending_writes: HashMap::new(), - } - } - pub fn add_model( &mut self, device: &wgpu::Device, diff --git a/rendering/src/renderer.rs b/rendering/src/renderer.rs index 445e228..6fadde3 100644 --- a/rendering/src/renderer.rs +++ b/rendering/src/renderer.rs @@ -5,7 +5,8 @@ use pollster::FutureExt; use raw_window_handle::HasRawWindowHandle; use crate::model::ModelIndex; -use crate::model::ModelManager; +use crate::ui; +use crate::Light; use crate::{texture, Camera, RenderingError}; use common::{Mat3, Mat4, Transform, Vec3, Vec4}; @@ -13,84 +14,14 @@ pub mod gbuffer; pub mod world; use world::World; -#[repr(C)] -#[derive(Debug, Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)] -pub struct RawTranslationMatrix { - model: [[f32; 4]; 4], - rotation: [[f32; 3]; 3], -} - -impl RawTranslationMatrix { - pub fn new(transform: Transform) -> Self { - let Vec3 { x, y, z } = transform.scale; - - Self { - model: unsafe { - mem::transmute::( - Mat4::translation_3d(transform.position) - * Mat4::from(transform.rotation) - * Mat4::with_diagonal(Vec4::new(x, y, z, 1.0)), - ) - }, - rotation: unsafe { mem::transmute::(Mat3::from(transform.rotation)) }, - } - } -} - -impl RawTranslationMatrix { - fn desc<'a>() -> wgpu::VertexBufferLayout<'a> { - wgpu::VertexBufferLayout { - array_stride: mem::size_of::() as wgpu::BufferAddress, - step_mode: wgpu::VertexStepMode::Instance, - attributes: &[ - wgpu::VertexAttribute { - offset: 0, - shader_location: 5, - format: wgpu::VertexFormat::Float32x4, - }, - wgpu::VertexAttribute { - offset: 4 * 4, - shader_location: 6, - format: wgpu::VertexFormat::Float32x4, - }, - wgpu::VertexAttribute { - offset: 2 * 4 * 4, - shader_location: 7, - format: wgpu::VertexFormat::Float32x4, - }, - wgpu::VertexAttribute { - offset: 3 * 4 * 4, - shader_location: 8, - format: wgpu::VertexFormat::Float32x4, - }, - wgpu::VertexAttribute { - offset: mem::size_of::<[f32; 16]>() as wgpu::BufferAddress, - shader_location: 9, - format: wgpu::VertexFormat::Float32x3, - }, - wgpu::VertexAttribute { - offset: mem::size_of::<[f32; 19]>() as wgpu::BufferAddress, - shader_location: 10, - format: wgpu::VertexFormat::Float32x3, - }, - wgpu::VertexAttribute { - offset: mem::size_of::<[f32; 22]>() as wgpu::BufferAddress, - shader_location: 11, - format: wgpu::VertexFormat::Float32x3, - }, - ], - } - } -} - pub struct Renderer { - pub camera: Camera, - painter: crate::ui::Painter, + painter: ui::Painter, surface: wgpu::Surface, device: wgpu::Device, queue: wgpu::Queue, config: wgpu::SurfaceConfiguration, size: (u32, u32), + line_render_pipeline_layout: wgpu::PipelineLayout, line_shader: wgpu::ShaderModule, shader: wgpu::ShaderModule, @@ -98,82 +29,9 @@ pub struct Renderer { camera_bind_group_layout: wgpu::BindGroupLayout, light_bind_group_layout: wgpu::BindGroupLayout, depth_texture: texture::Texture, - worlds: Vec, - clear_color: [f64; 3], -} - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Line { - pub start: Vec3, - pub end: Vec3, - pub color: Vec3, -} - -impl Line { - fn into_raw(self) -> RawLine { - let Line { - start: - Vec3 { - x: s_x, - y: s_y, - z: s_z, - }, - end: - Vec3 { - x: e_x, - y: e_y, - z: e_z, - }, - color: Vec3 { x: r, y: g, z: b }, - } = self; - let color = [r, g, b]; - RawLine { - start: RawLineVertex { - pos: [s_x, s_y, s_z], - color, - }, - end: RawLineVertex { - pos: [e_x, e_y, e_z], - color, - }, - } - } -} - -#[repr(C)] -#[derive(Debug, Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)] -struct RawLine { - start: RawLineVertex, - end: RawLineVertex, -} - -#[repr(C)] -#[derive(Debug, Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)] -struct RawLineVertex { - pub pos: [f32; 3], - pub color: [f32; 3], -} -impl RawLineVertex { - fn desc<'a>() -> wgpu::VertexBufferLayout<'a> { - wgpu::VertexBufferLayout { - array_stride: mem::size_of::() as wgpu::BufferAddress, - step_mode: wgpu::VertexStepMode::Vertex, - attributes: &[ - wgpu::VertexAttribute { - offset: 0, - shader_location: 0, - format: wgpu::VertexFormat::Float32x3, - }, - wgpu::VertexAttribute { - offset: mem::size_of::<[f32; 3]>() as wgpu::BufferAddress, - shader_location: 1, - format: wgpu::VertexFormat::Float32x3, - }, - ], - } - } + clear_color: [f64; 3], + worlds: Vec, } impl Renderer { @@ -254,16 +112,6 @@ impl Renderer { label: Some("texture bind group layout"), }); - let camera = Camera { - eye: (0.0, 5.0, -10.0).into(), - target: (0.0, 0.0, 0.0).into(), - up: Vec3::unit_y(), - aspect: config.width as f32 / config.height as f32, - fovy: 45f32.to_radians(), - znear: 0.1, - zfar: 2000.0, - }; - let camera_bind_group_layout = device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor { entries: &[wgpu::BindGroupLayoutEntry { @@ -323,9 +171,9 @@ impl Renderer { push_constant_ranges: &[], }); - let painter = crate::ui::Painter::new(&device, &queue, &config); + let painter = ui::Painter::new(&device, &queue, &config); - let mut this = Self { + Ok(Self { surface, device, queue, @@ -335,25 +183,31 @@ impl Renderer { render_pipeline_layout, line_shader, line_render_pipeline_layout, - camera, camera_bind_group_layout, light_bind_group_layout, depth_texture, clear_color, worlds: vec![], painter, - }; + }) + } - this.worlds = vec![World::new(&this, camera)]; + pub fn create_world(&mut self) -> WorldId { + let id = self.worlds.len(); - Ok(this) + self.worlds.push(World::new(&self)); + + WorldId( + id.try_into() + .expect("Can't create more than u32::MAX worlds"), + ) } pub fn resize(&mut self, (width, height): (u32, u32)) { if width > 0 && height > 0 { self.config.width = width; self.config.height = height; - self.camera.aspect = width as f32 / height as f32; + // TODO: self.camera.aspect = width as f32 / height as f32; self.size = (width, height); self.surface.configure(&self.device, &self.config); self.depth_texture = @@ -366,26 +220,41 @@ impl Renderer { } } + // TODO: maybe just hand out a &mut World given the id? + /// Load an obj file and all its associate files. pub fn load_model>( &mut self, + world: WorldId, path: P, ) -> Result { - self.worlds[0].load_model(&self.device, &self.queue, path) + self.worlds[world.i()].load_model(&self.device, &self.queue, path) } - pub fn get_models_mut(&mut self) -> ModelManager { - self.worlds[0].get_models_mut(&self.device, &self.queue) + /// Sets the world to render from `camera`. + pub fn set_camera(&mut self, world: WorldId, camera: Camera) { + let aspect = self.size.0 as f32 / self.size.1 as f32; + self.worlds[world.i()].update_camera(&self.queue, &camera, aspect); } - pub fn update_camera(&mut self) { - self.worlds[0].camera = self.camera; - self.worlds[0].update_camera(&self.queue, self.painter.last_aspect); + pub fn update_instances<'a>( + &mut self, + world: WorldId, + instances: impl Iterator, + ) { + self.worlds[world.i()].update_instances(&self.device, &self.queue, instances) } - #[deprecated = "use the model manager for this functionality instead"] - pub fn update_instances(&mut self, instances: &[(ModelIndex, &[Transform])]) { - self.worlds[0].update_instances(&self.device, &self.queue, instances) + pub fn set_lights(&mut self, world: WorldId, lights: Vec<(Light, Vec3)>) { + self.worlds[world.i()].set_lights(lights); + } + + pub fn get_deferred(&self, world: WorldId) -> bool { + self.worlds[world.i()].deferred + } + + pub fn set_deferred(&mut self, world: WorldId, deferred: bool) { + self.worlds[world.i()].deferred = deferred; } pub fn make_egui_render_target(&mut self, ctx: &egui::Context) -> egui::TextureHandle { @@ -422,12 +291,11 @@ impl Renderer { // entirely distinct ways to interact with what is being rendered. pub fn render( &mut self, + world: WorldId, lines: &[Line], - lights: &[world::Light], ui: &egui::Context, egui_output: egui::FullOutput, pixels_per_point: f32, - deferred: bool, ) -> Result<(), RenderingError> { let output = self.surface.get_current_texture()?; let view = output @@ -445,11 +313,7 @@ impl Renderer { } else { &view }; - if deferred { - self.worlds[0].render_deferred(&self.device, lines, lights, render_tex, &self.queue)?; - } else { - self.worlds[0].render(&self.device, lines, render_tex, None, &self.queue)?; - } + self.worlds[world.i()].render(&self.device, lines, render_tex, None, &self.queue)?; { let mut ui_render_pass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { @@ -492,4 +356,162 @@ impl Renderer { Ok(()) } + + /// Get the renderer's size. + pub fn size(&self) -> (u32, u32) { + self.size + } +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub struct WorldId(u32); + +impl WorldId { + fn i(&self) -> usize { + self.0 as usize + } +} + +#[repr(C)] +#[derive(Debug, Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)] +pub struct RawTranslationMatrix { + model: [[f32; 4]; 4], + rotation: [[f32; 3]; 3], +} + +impl RawTranslationMatrix { + pub fn new(transform: Transform) -> Self { + let Vec3 { x, y, z } = transform.scale; + + Self { + model: unsafe { + mem::transmute::( + Mat4::translation_3d(transform.position) + * Mat4::from(transform.rotation) + * Mat4::with_diagonal(Vec4::new(x, y, z, 1.0)), + ) + }, + rotation: unsafe { mem::transmute::(Mat3::from(transform.rotation)) }, + } + } +} + +impl RawTranslationMatrix { + fn desc<'a>() -> wgpu::VertexBufferLayout<'a> { + wgpu::VertexBufferLayout { + array_stride: mem::size_of::() as wgpu::BufferAddress, + step_mode: wgpu::VertexStepMode::Instance, + attributes: &[ + wgpu::VertexAttribute { + offset: 0, + shader_location: 5, + format: wgpu::VertexFormat::Float32x4, + }, + wgpu::VertexAttribute { + offset: 4 * 4, + shader_location: 6, + format: wgpu::VertexFormat::Float32x4, + }, + wgpu::VertexAttribute { + offset: 2 * 4 * 4, + shader_location: 7, + format: wgpu::VertexFormat::Float32x4, + }, + wgpu::VertexAttribute { + offset: 3 * 4 * 4, + shader_location: 8, + format: wgpu::VertexFormat::Float32x4, + }, + wgpu::VertexAttribute { + offset: mem::size_of::<[f32; 16]>() as wgpu::BufferAddress, + shader_location: 9, + format: wgpu::VertexFormat::Float32x3, + }, + wgpu::VertexAttribute { + offset: mem::size_of::<[f32; 19]>() as wgpu::BufferAddress, + shader_location: 10, + format: wgpu::VertexFormat::Float32x3, + }, + wgpu::VertexAttribute { + offset: mem::size_of::<[f32; 22]>() as wgpu::BufferAddress, + shader_location: 11, + format: wgpu::VertexFormat::Float32x3, + }, + ], + } + } +} + +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct Line { + pub start: Vec3, + pub end: Vec3, + pub color: Vec3, +} + +impl Line { + fn into_raw(self) -> RawLine { + let Line { + start: + Vec3 { + x: s_x, + y: s_y, + z: s_z, + }, + end: + Vec3 { + x: e_x, + y: e_y, + z: e_z, + }, + color: Vec3 { x: r, y: g, z: b }, + } = self; + let color = [r, g, b]; + RawLine { + start: RawLineVertex { + pos: [s_x, s_y, s_z], + color, + }, + end: RawLineVertex { + pos: [e_x, e_y, e_z], + color, + }, + } + } +} + +#[repr(C)] +#[derive(Debug, Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)] +struct RawLine { + start: RawLineVertex, + end: RawLineVertex, +} + +#[repr(C)] +#[derive(Debug, Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)] +struct RawLineVertex { + pub pos: [f32; 3], + pub color: [f32; 3], +} + +impl RawLineVertex { + fn desc<'a>() -> wgpu::VertexBufferLayout<'a> { + wgpu::VertexBufferLayout { + array_stride: mem::size_of::() as wgpu::BufferAddress, + step_mode: wgpu::VertexStepMode::Vertex, + attributes: &[ + wgpu::VertexAttribute { + offset: 0, + shader_location: 0, + format: wgpu::VertexFormat::Float32x3, + }, + wgpu::VertexAttribute { + offset: mem::size_of::<[f32; 3]>() as wgpu::BufferAddress, + shader_location: 1, + format: wgpu::VertexFormat::Float32x3, + }, + ], + } + } } diff --git a/rendering/src/renderer/world.rs b/rendering/src/renderer/world.rs index 105397e..f2509c7 100644 --- a/rendering/src/renderer/world.rs +++ b/rendering/src/renderer/world.rs @@ -3,287 +3,27 @@ use wgpu::util::DeviceExt; use super::{gbuffer::GBuffer, Line, RawLine}; use crate::camera::{Camera, CameraUniform}; use crate::error::RenderingError; -use crate::model::{DrawModel, Model, ModelIndex, ModelManager, ModelStorage, ModelVertex, Vertex}; +use crate::model::{DrawModel, Model, ModelIndex, ModelStorage, ModelVertex, Vertex}; use crate::renderer::Renderer; use crate::texture; -use common::Vec3; +use common::{Transform, Vec3}; use std::mem; -pub struct ScreenQuad { - vtx: wgpu::Buffer, - idx: wgpu::Buffer, -} - -pub struct LightSpheres { - vtx: wgpu::Buffer, - idx: wgpu::Buffer, - transforms: wgpu::Buffer, // just a float as we only need a scale value - n_elems: u32, - n_lights: u64, - lights: Vec, -} - -#[repr(C)] -#[derive(bytemuck::Zeroable, bytemuck::Pod, Debug, Copy, Clone)] -pub struct RawLight { - world_pos: [f32; 3], - color: [f32; 3], - radius: f32, - k_c: f32, - k_l: f32, - k_q: f32, -} - -#[repr(C)] -#[derive(bytemuck::Zeroable, bytemuck::Pod, Debug, Copy, Clone)] -struct LightUniform { - world_pos: [f32; 3], - radius: f32, - color: [f32; 4], // alpha isn't used, just padding - ks: [f32; 4], // k_{c,l,q} and an extra for padding -} - -impl From<&RawLight> for LightUniform { - fn from(l: &RawLight) -> Self { - let RawLight { - world_pos, - color, - radius, - k_c, - k_l, - k_q, - } = *l; - Self { - world_pos, - radius, - color: [color[0], color[1], color[2], 1.0], - ks: [k_c, k_l, k_q, 0.0], - } - } -} - -impl From<&Light> for RawLight { - fn from(l: &Light) -> Self { - RawLight { - world_pos: l.pos.into_array(), - color: l.color, - radius: l.calc_radius(), - k_c: l.k_constant, - k_l: l.k_linear, - k_q: l.k_quadratic, - } - } -} - -fn update_buffer( - device: &wgpu::Device, - queue: &wgpu::Queue, - buffer: &mut wgpu::Buffer, - new_data: &[T], - buf_size: &mut u64, -) { - if new_data.len() > *buf_size as usize { - *buf_size = new_data.len() as u64; - *buffer = device.create_buffer(&wgpu::BufferDescriptor { - label: Some("Line Buffer"), - usage: wgpu::BufferUsages::VERTEX | wgpu::BufferUsages::COPY_DST, - mapped_at_creation: false, - size: *buf_size * mem::size_of::() as wgpu::BufferAddress, - }); - } - queue.write_buffer(&*buffer, 0, bytemuck::cast_slice(new_data)); -} - -impl LightSpheres { - fn desc<'a>() -> wgpu::VertexBufferLayout<'a> { - wgpu::VertexBufferLayout { - array_stride: mem::size_of::<[f32; 3]>() as wgpu::BufferAddress, - step_mode: wgpu::VertexStepMode::Vertex, - attributes: &[wgpu::VertexAttribute { - format: wgpu::VertexFormat::Float32x3, - offset: 0, - shader_location: 0, - }], - } - } - - fn new(device: &wgpu::Device) -> Self { - use std::io::BufReader; - static LIGHT_SPHERE_OBJ: &[u8] = include_bytes!("lightsphere.obj"); - let mut buf = BufReader::new(LIGHT_SPHERE_OBJ); - let sphere_obj = tobj::load_obj_buf(&mut buf, &tobj::GPU_LOAD_OPTIONS, |_| { - Err(tobj::LoadError::GenericFailure) - }).expect("failed importing the light sphere, this is a statically linked value and should never fail"); - let mut verts: Vec<[f32; 3]> = Vec::new(); - let mesh = (sphere_obj.0)[0].mesh.clone(); - for i in 0..mesh.positions.len() / 3 { - verts.push([ - mesh.positions[i * 3], - mesh.positions[i * 3 + 1], - mesh.positions[i * 3 + 2], - ]) - } - - let vtx = device.create_buffer_init(&wgpu::util::BufferInitDescriptor { - label: Some("Light sphere vertex buffer"), - usage: wgpu::BufferUsages::VERTEX, - contents: bytemuck::cast_slice(&verts), - }); - let idx = device.create_buffer_init(&wgpu::util::BufferInitDescriptor { - label: Some("Light sphere index buffer"), - usage: wgpu::BufferUsages::INDEX, - contents: bytemuck::cast_slice(&mesh.indices), - }); - - let n_lights = 16; - let transforms = device.create_buffer(&wgpu::BufferDescriptor { - label: Some("Light sphere instance buffer"), - usage: wgpu::BufferUsages::VERTEX | wgpu::BufferUsages::COPY_DST, - size: n_lights * mem::size_of::() as wgpu::BufferAddress, - mapped_at_creation: false, - }); - - Self { - vtx, - idx, - n_elems: mesh.indices.len() as u32, - n_lights, - transforms, - lights: vec![], - } - } -} - -#[derive(Debug, Copy, Clone)] -pub struct Light { - pub pos: Vec3, - pub color: [f32; 3], - pub k_quadratic: f32, - pub k_linear: f32, - pub k_constant: f32, -} - -impl Light { - pub fn calc_radius(&self) -> f32 { - let light_max = Vec3::from(self.color).reduce_partial_max(); - let &Self { - k_quadratic: quadratic, - k_linear: linear, - k_constant: constant, - .. - } = self; - let almost_black = 1.0 / (5.0 / 256.0 / 12.92); // convert sRGB to linear - - (-linear - + f32::sqrt(linear.powi(2) - 4.0 * quadratic * (constant - almost_black * light_max))) - / (2.0 * quadratic) - } -} - -impl ScreenQuad { - pub fn new(device: &wgpu::Device) -> Self { - const LOWER_LEFT: [f32; 2] = [-1.0, -1.0]; - const UPPER_RIGHT: [f32; 2] = [1.0, 1.0]; - const QUAD_VERTS: [[f32; 2]; 4] = [ - LOWER_LEFT, - // upper left - [LOWER_LEFT[0], UPPER_RIGHT[1]], - UPPER_RIGHT, - // lower right - [UPPER_RIGHT[0], LOWER_LEFT[1]], - ]; - // lower left-upper left-upper right - const QUAD_INDICES: [u16; 6] = [0, 1, 2, 2, 3, 0]; - - Self { - vtx: device.create_buffer_init(&wgpu::util::BufferInitDescriptor { - label: Some("screen quad vertex buffer"), - usage: wgpu::BufferUsages::VERTEX, - contents: bytemuck::cast_slice(&QUAD_VERTS), - }), - idx: device.create_buffer_init(&wgpu::util::BufferInitDescriptor { - label: Some("screen quad index buffer"), - usage: wgpu::BufferUsages::INDEX, - contents: bytemuck::cast_slice(&QUAD_INDICES), - }), - } - } - - pub fn desc<'a>() -> wgpu::VertexBufferLayout<'a> { - wgpu::VertexBufferLayout { - array_stride: mem::size_of::<[f32; 2]>() as wgpu::BufferAddress, - step_mode: wgpu::VertexStepMode::Vertex, - attributes: &[wgpu::VertexAttribute { - format: wgpu::VertexFormat::Float32x2, - offset: 0, - shader_location: 0, - }], - } - } -} - -impl Vertex for RawLight { - fn desc<'a>() -> wgpu::VertexBufferLayout<'a> { - wgpu::VertexBufferLayout { - array_stride: mem::size_of::() as wgpu::BufferAddress, - step_mode: wgpu::VertexStepMode::Instance, - attributes: &[ - wgpu::VertexAttribute { - format: wgpu::VertexFormat::Float32x3, - offset: 0, - shader_location: 1, - }, - wgpu::VertexAttribute { - format: wgpu::VertexFormat::Float32x3, - offset: mem::size_of::<[f32; 3]>() as wgpu::BufferAddress, - shader_location: 2, - }, - wgpu::VertexAttribute { - format: wgpu::VertexFormat::Float32, - offset: 2 * mem::size_of::<[f32; 3]>() as wgpu::BufferAddress, - shader_location: 3, - }, - wgpu::VertexAttribute { - format: wgpu::VertexFormat::Float32, - offset: (2 * mem::size_of::<[f32; 3]>() + mem::size_of::()) - as wgpu::BufferAddress, - shader_location: 4, - }, - wgpu::VertexAttribute { - format: wgpu::VertexFormat::Float32, - offset: (2 * mem::size_of::<[f32; 3]>() + 2 * mem::size_of::()) - as wgpu::BufferAddress, - shader_location: 5, - }, - wgpu::VertexAttribute { - format: wgpu::VertexFormat::Float32, - offset: (2 * mem::size_of::<[f32; 3]>() + 3 * mem::size_of::()) - as wgpu::BufferAddress, - shader_location: 6, - }, - ], - } - } -} - // A world of "things" that can be rendered to an area of the screen pub struct World { line_render_pipeline: wgpu::RenderPipeline, // Pipeline to render lines line_vertex_buffer: wgpu::Buffer, // Line vertex buffer n_lines: u32, // How many lines the line buffer can fit - render_pipeline: wgpu::RenderPipeline, // the main (forward) render pipeline - - model_storage: ModelStorage, // where all models are kept and managed - - texture_bind_group_layout: wgpu::BindGroupLayout, // the bindgroup for all model textures - - pub camera: Camera, // the camera data camera_bind_group: wgpu::BindGroup, // the camera's bindgroup camera_uniform: CameraUniform, // the matching uniform camera_buffer: wgpu::Buffer, // the camera's buffer + render_pipeline: wgpu::RenderPipeline, // the main (forward) render pipeline + + texture_bind_group_layout: wgpu::BindGroupLayout, // the bindgroup for all model textures + forward_light_bind_group: wgpu::BindGroup, // the forward-renderer's light bindgroup forward_light_buffer: wgpu::Buffer, // the matching buffer @@ -300,12 +40,16 @@ pub struct World { light_spheres: LightSpheres, // the manager for all lights and their corresponding light volumes gbuffer: GBuffer, // the G-Buffer itself + model_storage: ModelStorage, // where all models are kept and managed + + pub deferred: bool, + clear_color: [f64; 3], } impl World { - pub fn new(rd: &Renderer, camera: Camera) -> Self { - let camera_uniform = CameraUniform::new(&camera); + pub fn new(rd: &Renderer) -> Self { + let camera_uniform = CameraUniform::default(); let camera_buffer = rd .device @@ -722,7 +466,6 @@ impl World { }); World { - camera, line_render_pipeline, line_vertex_buffer, n_lines, @@ -743,6 +486,7 @@ impl World { light_pipeline, light_spheres: LightSpheres::new(&rd.device), screen_quad: ScreenQuad::new(&rd.device), + deferred: true, clear_color: rd.clear_color, } } @@ -826,25 +570,27 @@ impl World { ); } - fn upload_lights(&mut self, device: &wgpu::Device, queue: &wgpu::Queue, lights: &[Light]) { - self.light_spheres.lights = lights.to_vec(); + pub fn set_lights(&mut self, lights: Vec<(Light, Vec3)>) { + self.light_spheres.lights = lights; + } + + fn upload_lights(&mut self, device: &wgpu::Device, queue: &wgpu::Queue) { + let lights = &self.light_spheres.lights; + let raw_lights: Vec<_> = lights.iter().map(RawLight::from).collect(); update_buffer( device, queue, &mut self.light_spheres.transforms, - &self - .light_spheres - .lights - .iter() - .map(RawLight::from) - .collect::>(), + &raw_lights, &mut self.light_spheres.n_lights, ); - queue.write_buffer( - &self.forward_light_buffer, - 0, - bytemuck::cast_slice(&[LightUniform::from(&RawLight::from(&lights[0]))]), - ); + if let Some(light) = raw_lights.get(0) { + queue.write_buffer( + &self.forward_light_buffer, + 0, + bytemuck::cast_slice(&[LightUniform::from(light)]), + ); + } } pub fn render_rpass<'a>( @@ -874,19 +620,8 @@ impl World { Ok(idx) } - pub(crate) fn get_models_mut<'a>( - &'a mut self, - device: &'a wgpu::Device, - queue: &'a wgpu::Queue, - ) -> ModelManager<'a> { - self.model_storage.get_manager(device, queue) - } - - pub fn update_camera(&mut self, queue: &wgpu::Queue, last_aspect: Option) { - if let Some(aspect) = last_aspect { - self.camera.aspect = aspect; - } - self.camera_uniform.update_view_proj(&self.camera); + pub fn update_camera(&mut self, queue: &wgpu::Queue, camera: &Camera, aspect: f32) { + self.camera_uniform.update_view_proj(camera, aspect); queue.write_buffer( &self.camera_buffer, @@ -895,20 +630,34 @@ impl World { ); } - //#[deprecated = "use the model manager for this functionality instead"] - pub fn update_instances( + pub fn update_instances<'a>( + &mut self, + device: &wgpu::Device, + queue: &wgpu::Queue, + instances: impl Iterator, + ) { + for (idx, transforms) in instances { + self.model_storage + .set_transforms(device, queue, idx, transforms.to_vec()); + } + } + + pub fn render( &mut self, device: &wgpu::Device, + lines: &[super::Line], + render_target: &wgpu::TextureView, + depth_attachment: Option<&texture::Texture>, queue: &wgpu::Queue, - instances: &[(ModelIndex, &[super::Transform])], - ) { - for (idx, data) in instances { - self.model_storage - .set_transforms(device, queue, *idx, data.to_vec()); + ) -> Result<(), RenderingError> { + if self.deferred { + self.render_deferred(device, lines, render_target, queue) + } else { + self.render_forward(device, lines, render_target, depth_attachment, queue) } } - pub fn render( + fn render_forward( &mut self, device: &wgpu::Device, lines: &[super::Line], @@ -950,16 +699,15 @@ impl World { Ok(()) } - pub fn render_deferred( + fn render_deferred( &mut self, device: &wgpu::Device, lines: &[super::Line], - lights: &[Light], render_target: &wgpu::TextureView, queue: &wgpu::Queue, ) -> Result<(), RenderingError> { self.upload_lines(device, queue, lines); - self.upload_lights(device, queue, lights); + self.upload_lights(device, queue); let mut encoder = device.create_command_encoder(&wgpu::CommandEncoderDescriptor { label: Some("Render Encoder"), @@ -1028,7 +776,7 @@ impl World { light_render_pass.draw_indexed( 0..self.light_spheres.n_elems, 0, - 0..lights.len() as u32, + 0..self.light_spheres.lights.len() as u32, ); } { @@ -1062,3 +810,259 @@ impl World { Ok(()) } } + +pub struct ScreenQuad { + vtx: wgpu::Buffer, + idx: wgpu::Buffer, +} + +pub struct LightSpheres { + vtx: wgpu::Buffer, + idx: wgpu::Buffer, + transforms: wgpu::Buffer, // just a float as we only need a scale value + n_elems: u32, + n_lights: u64, + lights: Vec<(Light, Vec3)>, +} + +#[repr(C)] +#[derive(bytemuck::Zeroable, bytemuck::Pod, Debug, Copy, Clone)] +pub struct RawLight { + world_pos: [f32; 3], + color: [f32; 3], + radius: f32, + k_c: f32, + k_l: f32, + k_q: f32, +} + +#[repr(C)] +#[derive(bytemuck::Zeroable, bytemuck::Pod, Debug, Copy, Clone)] +struct LightUniform { + world_pos: [f32; 3], + radius: f32, + color: [f32; 4], // alpha isn't used, just padding + ks: [f32; 4], // k_{c,l,q} and an extra for padding +} + +impl From<&RawLight> for LightUniform { + fn from(l: &RawLight) -> Self { + let RawLight { + world_pos, + color, + radius, + k_c, + k_l, + k_q, + } = *l; + Self { + world_pos, + radius, + color: [color[0], color[1], color[2], 1.0], + ks: [k_c, k_l, k_q, 0.0], + } + } +} + +impl From<&(Light, Vec3)> for RawLight { + fn from((light, pos): &(Light, Vec3)) -> Self { + RawLight { + world_pos: pos.into_array(), + color: light.color, + radius: light.calc_radius(), + k_c: light.k_constant, + k_l: light.k_linear, + k_q: light.k_quadratic, + } + } +} + +fn update_buffer( + device: &wgpu::Device, + queue: &wgpu::Queue, + buffer: &mut wgpu::Buffer, + new_data: &[T], + buf_size: &mut u64, +) { + if new_data.len() > *buf_size as usize { + *buf_size = new_data.len() as u64; + *buffer = device.create_buffer(&wgpu::BufferDescriptor { + label: Some("Line Buffer"), + usage: wgpu::BufferUsages::VERTEX | wgpu::BufferUsages::COPY_DST, + mapped_at_creation: false, + size: *buf_size * mem::size_of::() as wgpu::BufferAddress, + }); + } + queue.write_buffer(&*buffer, 0, bytemuck::cast_slice(new_data)); +} + +impl LightSpheres { + fn desc<'a>() -> wgpu::VertexBufferLayout<'a> { + wgpu::VertexBufferLayout { + array_stride: mem::size_of::<[f32; 3]>() as wgpu::BufferAddress, + step_mode: wgpu::VertexStepMode::Vertex, + attributes: &[wgpu::VertexAttribute { + format: wgpu::VertexFormat::Float32x3, + offset: 0, + shader_location: 0, + }], + } + } + + fn new(device: &wgpu::Device) -> Self { + use std::io::BufReader; + static LIGHT_SPHERE_OBJ: &[u8] = include_bytes!("lightsphere.obj"); + let mut buf = BufReader::new(LIGHT_SPHERE_OBJ); + let sphere_obj = tobj::load_obj_buf(&mut buf, &tobj::GPU_LOAD_OPTIONS, |_| { + Err(tobj::LoadError::GenericFailure) + }).expect("failed importing the light sphere, this is a statically linked value and should never fail"); + let mut verts: Vec<[f32; 3]> = Vec::new(); + let mesh = (sphere_obj.0)[0].mesh.clone(); + for i in 0..mesh.positions.len() / 3 { + verts.push([ + mesh.positions[i * 3], + mesh.positions[i * 3 + 1], + mesh.positions[i * 3 + 2], + ]) + } + + let vtx = device.create_buffer_init(&wgpu::util::BufferInitDescriptor { + label: Some("Light sphere vertex buffer"), + usage: wgpu::BufferUsages::VERTEX, + contents: bytemuck::cast_slice(&verts), + }); + let idx = device.create_buffer_init(&wgpu::util::BufferInitDescriptor { + label: Some("Light sphere index buffer"), + usage: wgpu::BufferUsages::INDEX, + contents: bytemuck::cast_slice(&mesh.indices), + }); + + let n_lights = 16; + let transforms = device.create_buffer(&wgpu::BufferDescriptor { + label: Some("Light sphere instance buffer"), + usage: wgpu::BufferUsages::VERTEX | wgpu::BufferUsages::COPY_DST, + size: n_lights * mem::size_of::() as wgpu::BufferAddress, + mapped_at_creation: false, + }); + + Self { + vtx, + idx, + n_elems: mesh.indices.len() as u32, + n_lights, + transforms, + lights: vec![], + } + } +} + +#[derive(Debug, Copy, Clone)] +pub struct Light { + pub color: [f32; 3], + pub k_quadratic: f32, + pub k_linear: f32, + pub k_constant: f32, +} + +impl Light { + pub fn calc_radius(&self) -> f32 { + let light_max = Vec3::from(self.color).reduce_partial_max(); + let &Self { + k_quadratic: quadratic, + k_linear: linear, + k_constant: constant, + .. + } = self; + let almost_black = 1.0 / (5.0 / 256.0 / 12.92); // convert sRGB to linear + + (-linear + + f32::sqrt(linear.powi(2) - 4.0 * quadratic * (constant - almost_black * light_max))) + / (2.0 * quadratic) + } +} + +impl ScreenQuad { + pub fn new(device: &wgpu::Device) -> Self { + const LOWER_LEFT: [f32; 2] = [-1.0, -1.0]; + const UPPER_RIGHT: [f32; 2] = [1.0, 1.0]; + const QUAD_VERTS: [[f32; 2]; 4] = [ + LOWER_LEFT, + // upper left + [LOWER_LEFT[0], UPPER_RIGHT[1]], + UPPER_RIGHT, + // lower right + [UPPER_RIGHT[0], LOWER_LEFT[1]], + ]; + // lower left-upper left-upper right + const QUAD_INDICES: [u16; 6] = [0, 1, 2, 2, 3, 0]; + + Self { + vtx: device.create_buffer_init(&wgpu::util::BufferInitDescriptor { + label: Some("screen quad vertex buffer"), + usage: wgpu::BufferUsages::VERTEX, + contents: bytemuck::cast_slice(&QUAD_VERTS), + }), + idx: device.create_buffer_init(&wgpu::util::BufferInitDescriptor { + label: Some("screen quad index buffer"), + usage: wgpu::BufferUsages::INDEX, + contents: bytemuck::cast_slice(&QUAD_INDICES), + }), + } + } + + pub fn desc<'a>() -> wgpu::VertexBufferLayout<'a> { + wgpu::VertexBufferLayout { + array_stride: mem::size_of::<[f32; 2]>() as wgpu::BufferAddress, + step_mode: wgpu::VertexStepMode::Vertex, + attributes: &[wgpu::VertexAttribute { + format: wgpu::VertexFormat::Float32x2, + offset: 0, + shader_location: 0, + }], + } + } +} + +impl Vertex for RawLight { + fn desc<'a>() -> wgpu::VertexBufferLayout<'a> { + wgpu::VertexBufferLayout { + array_stride: mem::size_of::() as wgpu::BufferAddress, + step_mode: wgpu::VertexStepMode::Instance, + attributes: &[ + wgpu::VertexAttribute { + format: wgpu::VertexFormat::Float32x3, + offset: 0, + shader_location: 1, + }, + wgpu::VertexAttribute { + format: wgpu::VertexFormat::Float32x3, + offset: mem::size_of::<[f32; 3]>() as wgpu::BufferAddress, + shader_location: 2, + }, + wgpu::VertexAttribute { + format: wgpu::VertexFormat::Float32, + offset: 2 * mem::size_of::<[f32; 3]>() as wgpu::BufferAddress, + shader_location: 3, + }, + wgpu::VertexAttribute { + format: wgpu::VertexFormat::Float32, + offset: (2 * mem::size_of::<[f32; 3]>() + mem::size_of::()) + as wgpu::BufferAddress, + shader_location: 4, + }, + wgpu::VertexAttribute { + format: wgpu::VertexFormat::Float32, + offset: (2 * mem::size_of::<[f32; 3]>() + 2 * mem::size_of::()) + as wgpu::BufferAddress, + shader_location: 5, + }, + wgpu::VertexAttribute { + format: wgpu::VertexFormat::Float32, + offset: (2 * mem::size_of::<[f32; 3]>() + 3 * mem::size_of::()) + as wgpu::BufferAddress, + shader_location: 6, + }, + ], + } + } +} diff --git a/rendering/src/ui.rs b/rendering/src/ui.rs index d8f900e..2b86c6b 100644 --- a/rendering/src/ui.rs +++ b/rendering/src/ui.rs @@ -398,6 +398,8 @@ impl Painter { texture::Texture::new_render_target("egui ui texture", device, (width, height), format), ); + self.last_aspect = Some(config.width as f32 / config.height as f32); + queue.write_buffer( &self.local_buffer, 0, From 44e4faf645d9762fd23e4f0c9402cded5e6100e5 Mon Sep 17 00:00:00 2001 From: mathiasmagnusson Date: Thu, 19 May 2022 23:06:11 +0200 Subject: [PATCH 5/5] Add Cargo.lock --- Cargo.lock | 2985 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 2985 insertions(+) create mode 100644 Cargo.lock diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..d2e979f --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,2985 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ab_glyph" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24606928a235e73cdef55a0c909719cadd72fce573e5713d58cb2952d8f5794c" +dependencies = [ + "ab_glyph_rasterizer", + "owned_ttf_parser", +] + +[[package]] +name = "ab_glyph_rasterizer" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a13739d7177fbd22bb0ed28badfff9f372f8bef46c863db4e1c6248f6b223b6e" + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "adler32" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" + +[[package]] +name = "ahash" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +dependencies = [ + "memchr", +] + +[[package]] +name = "anyhow" +version = "1.0.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f9b8508dccb7687a1d6c4ce66b2b0ecef467c94667de27d8d7fe1f8d2a9cdc" + +[[package]] +name = "approx" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +dependencies = [ + "num-traits", +] + +[[package]] +name = "arrayvec" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" + +[[package]] +name = "ash" +version = "0.34.0+1.2.203" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0f780da53d0063880d45554306489f09dd8d1bda47688b4a57bc579119356df" +dependencies = [ + "libloading", +] + +[[package]] +name = "async-broadcast" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bbd92a9bd0e9c1298118ecf8a2f825e86b12c3ec9e411573e34aaf3a0c03cdd" +dependencies = [ + "easy-parallel", + "event-listener", + "futures-core", + "parking_lot", +] + +[[package]] +name = "async-channel" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + +[[package]] +name = "async-executor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "once_cell", + "slab", +] + +[[package]] +name = "async-io" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a811e6a479f2439f0c04038796b5cfb3d2ad56c230e0f2d3f7b04d68cfee607b" +dependencies = [ + "concurrent-queue", + "futures-lite", + "libc", + "log", + "once_cell", + "parking", + "polling", + "slab", + "socket2", + "waker-fn", + "winapi", +] + +[[package]] +name = "async-lock" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97a171d191782fba31bb902b14ad94e24a68145032b7eedf871ab0bc0d077b6" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-recursion" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7d78656ba01f1b93024b7c3a0467f1608e4be67d725749fdcd7d2c7678fd7a2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "async-task" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30696a84d817107fc028e049980e09d5e140e8da8f1caeb17e8e950658a3cea9" + +[[package]] +name = "async-trait" +version = "0.1.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed6aa3524a2dfcf9fe180c51eae2b58738348d819517ceadf95789c51fff7600" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "atomic_refcell" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73b5e5f48b927f04e952dedc932f31995a65a0bf65ec971c74436e51bf6e970d" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bit-set" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e11e16035ea35e4e5997b393eacbf6f63983188f7a2ad25bfb13465f5ad59de" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + +[[package]] +name = "bit_field" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcb6dd1c2376d2e096796e234a70e17e94cc2d5d54ff8ce42b28cef1d0d359a4" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + +[[package]] +name = "bumpalo" +version = "3.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" + +[[package]] +name = "bytemuck" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdead85bdec19c194affaeeb670c0e41fe23de31459efd1c174d049269cf02cc" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "562e382481975bc61d11275ac5e62a19abd00b0547d99516a415336f183dcd0e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" + +[[package]] +name = "cache-padded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" + +[[package]] +name = "calloop" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf2eec61efe56aa1e813f5126959296933cf0700030e4314786c48779a66ab82" +dependencies = [ + "log", + "nix 0.22.3", +] + +[[package]] +name = "cc" +version = "1.0.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + +[[package]] +name = "clipboard-win" +version = "3.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fdf5e01086b6be750428ba4a40619f847eb2e95756eee84b18e06e5f0b50342" +dependencies = [ + "lazy-bytes-cast", + "winapi", +] + +[[package]] +name = "cocoa" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f63902e9223530efb4e26ccd0cf55ec30d592d3b42e21a28defc42a9586e832" +dependencies = [ + "bitflags", + "block", + "cocoa-foundation", + "core-foundation 0.9.3", + "core-graphics 0.22.3", + "foreign-types", + "libc", + "objc", +] + +[[package]] +name = "cocoa-foundation" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" +dependencies = [ + "bitflags", + "block", + "core-foundation 0.9.3", + "core-graphics-types", + "foreign-types", + "libc", + "objc", +] + +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + +[[package]] +name = "combine" +version = "4.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a604e93b79d1808327a6fca85a6f2d69de66461e7620f5a4cbf5fb4d1d7c948" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "common" +version = "0.1.0" +dependencies = [ + "vek", +] + +[[package]] +name = "concurrent-queue" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" +dependencies = [ + "cache-padded", +] + +[[package]] +name = "copyless" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2df960f5d869b2dd8532793fde43eb5427cceb126c929747a26823ab0eeb536" + +[[package]] +name = "copypasta" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4423d79fed83ebd9ab81ec21fa97144300a961782158287dc9bf7eddac37ff0b" +dependencies = [ + "clipboard-win", + "objc", + "objc-foundation", + "objc_id", + "smithay-clipboard", + "x11-clipboard", +] + +[[package]] +name = "core-foundation" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" +dependencies = [ + "core-foundation-sys 0.7.0", + "libc", +] + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys 0.8.3", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + +[[package]] +name = "core-graphics" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923" +dependencies = [ + "bitflags", + "core-foundation 0.7.0", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" +dependencies = [ + "bitflags", + "core-foundation 0.9.3", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" +dependencies = [ + "bitflags", + "core-foundation 0.9.3", + "foreign-types", + "libc", +] + +[[package]] +name = "core-video-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34ecad23610ad9757664d644e369246edde1803fcb43ed72876565098a5d3828" +dependencies = [ + "cfg-if 0.1.10", + "core-foundation-sys 0.7.0", + "core-graphics 0.19.2", + "libc", + "objc", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aaa7bd5fb665c6864b5f963dd9097905c54125909c7aa94c9e18507cdbe6c53" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1145cf131a2c6ba0615079ab6a638f7e1973ac9c2634fcbeaaad6114246efe8c" +dependencies = [ + "autocfg", + "cfg-if 1.0.0", + "crossbeam-utils", + "lazy_static", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" +dependencies = [ + "cfg-if 1.0.0", + "lazy_static", +] + +[[package]] +name = "cty" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" + +[[package]] +name = "d3d12" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2daefd788d1e96e0a9d66dee4b828b883509bc3ea9ce30665f04c3246372690c" +dependencies = [ + "bitflags", + "libloading", + "winapi", +] + +[[package]] +name = "dark-light" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b83576e2eee2d9cdaa8d08812ae59cbfe1b5ac7ac5ac4b8400303c6148a88c1" +dependencies = [ + "dconf_rs", + "detect-desktop-environment", + "dirs", + "objc", + "rust-ini", + "web-sys", + "winreg", + "zbus", + "zvariant", +] + +[[package]] +name = "darling" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "dconf_rs" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7046468a81e6a002061c01e6a7c83139daf91b11c30e66795b13217c2d885c8b" + +[[package]] +name = "deflate" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c86f7e25f518f4b81808a2cf1c50996a61f5c2eb394b2393bd87f2a4780a432f" +dependencies = [ + "adler32", +] + +[[package]] +name = "dense_bitset" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d15f1502ab53843a74b1ab2f4bd66761b6f717fe40d12ba0e3f87a733006498" + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "detect-desktop-environment" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21d8ad60dd5b13a4ee6bd8fa2d5d88965c597c67bce32b5fc49c94f55cb50810" + +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dispatch" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" + +[[package]] +name = "dlib" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac1b7517328c04c2aa68422fc60a41b92208182142ed04a25879c26c8f878794" +dependencies = [ + "libloading", +] + +[[package]] +name = "dlv-list" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68df3f2b690c1b86e65ef7830956aededf3cb0a16f898f79b9a6f421a7b6211b" +dependencies = [ + "rand 0.8.5", +] + +[[package]] +name = "downcast-rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" + +[[package]] +name = "easy-parallel" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6907e25393cdcc1f4f3f513d9aac1e840eb1cc341a0fccb01171f7d14d10b946" + +[[package]] +name = "ecs" +version = "0.1.0" +dependencies = [ + "dense_bitset", +] + +[[package]] +name = "egui" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a3cd1d47e12f7a17912595241622e373aa652a4e0fa90b3f9278f90a64aedf7" +dependencies = [ + "ahash 0.7.6", + "epaint", + "nohash-hasher", + "tracing", +] + +[[package]] +name = "egui-winit" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43eac3180ea178ef1a5f3048cc12c58bcbcb17fc3401813f7229c99ef2ffc1d9" +dependencies = [ + "copypasta", + "dark-light", + "egui", + "instant", + "tracing", + "webbrowser", + "winit", +] + +[[package]] +name = "either" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" + +[[package]] +name = "emath" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a977a80456be58a2c2d48e69c1d0baadef46cecef5a0c98df141c468da006f12" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "enumflags2" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e75d4cd21b95383444831539909fbb14b9dc3fdceb2a6f5d36577329a1f55ccb" +dependencies = [ + "enumflags2_derive", + "serde", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f58dc3c5e468259f19f2d46304a6b28f1c3d034442e14b322d2b850e36f6d5ae" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "env_logger" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "epaint" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "033292846059f08e03a71e1b5db2ee6ab7c9622c3b48da21f4bd13258ebee2db" +dependencies = [ + "ab_glyph", + "ahash 0.7.6", + "atomic_refcell", + "bytemuck", + "emath", + "nohash-hasher", +] + +[[package]] +name = "event-listener" +version = "2.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71" + +[[package]] +name = "exr" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14cc0e06fb5f67e5d6beadf3a382fec9baca1aa751c6d5368fdeee7e5932c215" +dependencies = [ + "bit_field", + "deflate", + "flume", + "half", + "inflate", + "lebe", + "smallvec", + "threadpool", +] + +[[package]] +name = "fastrand" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" +dependencies = [ + "instant", +] + +[[package]] +name = "flate2" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39522e96686d38f4bc984b9198e3a0613264abaebaff2c5c918bfa6b6da09af" +dependencies = [ + "cfg-if 1.0.0", + "crc32fast", + "libc", + "miniz_oxide", +] + +[[package]] +name = "flume" +version = "0.10.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843c03199d0c0ca54bc1ea90ac0d507274c28abcc4f691ae8b4eaa375087c76a" +dependencies = [ + "futures-core", + "futures-sink", + "nanorand", + "pin-project", + "spin", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +dependencies = [ + "matches", + "percent-encoding", +] + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" + +[[package]] +name = "futures-core" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" + +[[package]] +name = "futures-io" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" + +[[package]] +name = "futures-lite" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + +[[package]] +name = "futures-sink" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" + +[[package]] +name = "futures-task" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" + +[[package]] +name = "futures-util" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" +dependencies = [ + "futures-core", + "futures-sink", + "futures-task", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "game-engine" +version = "0.1.0" +dependencies = [ + "common", + "ecs", + "log", + "physics", + "rendering", + "thiserror", +] + +[[package]] +name = "getrandom" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "libc", + "wasi 0.10.2+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "gif" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3a7187e78088aead22ceedeee99779455b23fc231fe13ec443f99bb71694e5b" +dependencies = [ + "color_quant", + "weezl", +] + +[[package]] +name = "glow" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8bd5877156a19b8ac83a29b2306fe20537429d318f3ff0a1a2119f8d9c61919" +dependencies = [ + "js-sys", + "slotmap", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gpu-alloc" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fc59e5f710e310e76e6707f86c561dd646f69a8876da9131703b2f717de818d" +dependencies = [ + "bitflags", + "gpu-alloc-types", +] + +[[package]] +name = "gpu-alloc-types" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54804d0d6bc9d7f26db4eaec1ad10def69b599315f487d32c334a80d1efe67a5" +dependencies = [ + "bitflags", +] + +[[package]] +name = "gpu-descriptor" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a538f217be4d405ff4719a283ca68323cc2384003eca5baaa87501e821c81dda" +dependencies = [ + "bitflags", + "gpu-descriptor-types", + "hashbrown 0.11.2", +] + +[[package]] +name = "gpu-descriptor-types" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "363e3677e55ad168fef68cf9de3a4a310b53124c5e784c53a1d70e92d23f2126" +dependencies = [ + "bitflags", +] + +[[package]] +name = "half" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" + +[[package]] +name = "hashbrown" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" +dependencies = [ + "ahash 0.4.7", +] + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +dependencies = [ + "ahash 0.7.6", +] + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hexf-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "image" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28edd9d7bc256be2502e325ac0628bde30b7001b9b52e0abe31a1a9dc2701212" +dependencies = [ + "bytemuck", + "byteorder", + "color_quant", + "exr", + "gif", + "jpeg-decoder", + "num-iter", + "num-rational", + "num-traits", + "png", + "scoped_threadpool", + "tiff", +] + +[[package]] +name = "indexmap" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" +dependencies = [ + "autocfg", + "hashbrown 0.11.2", +] + +[[package]] +name = "inflate" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cdb29978cc5797bd8dcc8e5bf7de604891df2a8dc576973d71a281e916db2ff" +dependencies = [ + "adler32", +] + +[[package]] +name = "inplace_it" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90953f308a79fe6d62a4643e51f848fbfddcd05975a38e69fdf4ab86a7baf7ca" + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "jni" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" +dependencies = [ + "cesu8", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + +[[package]] +name = "jpeg-decoder" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9478aa10f73e7528198d75109c8be5cd7d15fb530238040148d5f9a22d4c5b3b" +dependencies = [ + "rayon", +] + +[[package]] +name = "js-sys" +version = "0.3.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "671a26f820db17c2a2750743f1dd03bafd15b98c9f30c7c2628c024c05d73397" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "khronos-egl" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c2352bd1d0bceb871cb9d40f24360c8133c11d7486b68b5381c1dd1a32015e3" +dependencies = [ + "libc", + "libloading", +] + +[[package]] +name = "lazy-bytes-cast" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10257499f089cd156ad82d0a9cd57d9501fa2c989068992a97eb3c27836f206b" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "lebe" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7efd1d698db0759e6ef11a7cd44407407399a910c774dd804c64c032da7826ff" + +[[package]] +name = "libc" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" + +[[package]] +name = "libloading" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" +dependencies = [ + "cfg-if 1.0.0", + "winapi", +] + +[[package]] +name = "lock_api" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + +[[package]] +name = "matches" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memmap2" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b6c2ebff6180198788f5db08d7ce3bc1d0b617176678831a7510825973e357" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "metal" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0514f491f4cc03632ab399ee01e2c1c1b12d3e1cf2d667c1ff5f87d6dcd2084" +dependencies = [ + "bitflags", + "block", + "core-graphics-types", + "foreign-types", + "log", + "objc", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2b29bd4bc3f33391105ebee3589c19197c4271e3e5a9ec9bfe8127eeff8f082" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "713d550d9b44d89174e066b7a6217ae06234c10cb47819a88290d2b353c31799" +dependencies = [ + "libc", + "log", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys", +] + +[[package]] +name = "naga" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3012f2dbcc79e8e0b5825a4836a7106a75dd9b2fe42c528163be0f572538c705" +dependencies = [ + "bit-set", + "bitflags", + "codespan-reporting", + "hexf-parse", + "indexmap", + "log", + "num-traits", + "rustc-hash", + "spirv", + "thiserror", +] + +[[package]] +name = "nanorand" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" +dependencies = [ + "getrandom", +] + +[[package]] +name = "ndk" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d868f654c72e75f8687572699cdabe755f03effbb62542768e995d5b8d699d" +dependencies = [ + "bitflags", + "jni-sys", + "ndk-sys 0.2.2", + "num_enum", + "thiserror", +] + +[[package]] +name = "ndk" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2032c77e030ddee34a6787a64166008da93f6a352b629261d0fee232b8742dd4" +dependencies = [ + "bitflags", + "jni-sys", + "ndk-sys 0.3.0", + "num_enum", + "thiserror", +] + +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "ndk-glue" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71bee8ea72d685477e28bd004cfe1bf99c754d688cd78cad139eae4089484d4" +dependencies = [ + "lazy_static", + "libc", + "log", + "ndk 0.5.0", + "ndk-context", + "ndk-macro", + "ndk-sys 0.2.2", +] + +[[package]] +name = "ndk-glue" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d0c4a7b83860226e6b4183edac21851f05d5a51756e97a1144b7f5a6b63e65f" +dependencies = [ + "lazy_static", + "libc", + "log", + "ndk 0.6.0", + "ndk-context", + "ndk-macro", + "ndk-sys 0.3.0", +] + +[[package]] +name = "ndk-macro" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0df7ac00c4672f9d5aece54ee3347520b7e20f158656c7db2e6de01902eb7a6c" +dependencies = [ + "darling", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ndk-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1bcdd74c20ad5d95aacd60ef9ba40fdf77f767051040541df557b7a9b2a2121" + +[[package]] +name = "ndk-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e5a6ae77c8ee183dcbbba6150e2e6b9f3f4196a7666c02a715a95692ec1fa97" +dependencies = [ + "jni-sys", +] + +[[package]] +name = "nix" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4916f159ed8e5de0082076562152a76b7a1f64a01fd9d1e0fea002c37624faf" +dependencies = [ + "bitflags", + "cc", + "cfg-if 1.0.0", + "libc", + "memoffset", +] + +[[package]] +name = "nix" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f866317acbd3a240710c63f065ffb1e4fd466259045ccb504130b7f668f35c6" +dependencies = [ + "bitflags", + "cc", + "cfg-if 1.0.0", + "libc", + "memoffset", +] + +[[package]] +name = "nohash-hasher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" + +[[package]] +name = "nom" +version = "7.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d41702bd167c2df5520b384281bc111a4b5efcf7fbc4c9c222c815b07e0a6a6a" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "num_enum" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf5395665662ef45796a4ff5486c5d41d29e0c09640af4c5f17fd94ee2c119c9" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", + "objc_exception", +] + +[[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_exception" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" +dependencies = [ + "cc", +] + +[[package]] +name = "objc_id" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" +dependencies = [ + "objc", +] + +[[package]] +name = "once_cell" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b10983b38c53aebdf33f542c6275b0f58a238129d00c4ae0e6fb59738d783ca" + +[[package]] +name = "ordered-multimap" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c672c7ad9ec066e428c00eb917124a06f08db19e2584de982cc34b1f4c12485" +dependencies = [ + "dlv-list", + "hashbrown 0.9.1", +] + +[[package]] +name = "ordered-stream" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44630c059eacfd6e08bdaa51b1db2ce33119caa4ddc1235e923109aa5f25ccb1" +dependencies = [ + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "owned_ttf_parser" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb1e509cfe7a12db2a90bfa057dfcdbc55a347f5da677c506b53dd099cfec9d" +dependencies = [ + "ttf-parser", +] + +[[package]] +name = "parking" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" + +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +dependencies = [ + "cfg-if 1.0.0", + "instant", + "libc", + "redox_syscall", + "smallvec", + "winapi", +] + +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" + +[[package]] +name = "physics" +version = "0.1.0" +dependencies = [ + "common", + "rendering", +] + +[[package]] +name = "pin-project" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" + +[[package]] +name = "png" +version = "0.17.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc38c0ad57efb786dd57b9864e5b18bae478c00c824dc55a38bbc9da95dde3ba" +dependencies = [ + "bitflags", + "crc32fast", + "deflate", + "miniz_oxide", +] + +[[package]] +name = "polling" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685404d509889fade3e86fe3a5803bca2ec09b0c0778d5ada6ec8bf7a8de5259" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "log", + "wepoll-ffi", + "winapi", +] + +[[package]] +name = "pollster" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5da3b0203fd7ee5720aa0b5e790b591aa5d3f41c3ed2c34a3a393382198af2f7" + +[[package]] +name = "ppv-lite86" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" + +[[package]] +name = "proc-macro-crate" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" +dependencies = [ + "thiserror", + "toml", +] + +[[package]] +name = "proc-macro2" +version = "1.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c54b25569025b7fc9651de43004ae593a75ad88543b17178aa5e1b9c4f15f56f" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "profiling" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9145ac0af1d93c638c98c40cf7d25665f427b2a44ad0a99b1dccf3e2f25bb987" + +[[package]] +name = "quick-xml" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8533f14c8382aaad0d592c812ac3b826162128b65662331e1127b45c3d18536b" +dependencies = [ + "memchr", +] + +[[package]] +name = "quote" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" +dependencies = [ + "fuchsia-cprng", + "libc", + "rand_core 0.3.1", + "rdrand", + "winapi", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core 0.6.3", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.3", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +dependencies = [ + "rand_core 0.4.2", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" + +[[package]] +name = "rand_core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "range-alloc" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e935c45e09cc6dcf00d2f0b2d630a58f4095320223d47fc68918722f0538b6" + +[[package]] +name = "raw-window-handle" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b800beb9b6e7d2df1fe337c9e3d04e3af22a124460fb4c30fcc22c9117cefb41" +dependencies = [ + "cty", +] + +[[package]] +name = "rayon" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" +dependencies = [ + "autocfg", + "crossbeam-deque", + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "redox_syscall" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom", + "redox_syscall", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" + +[[package]] +name = "remove_dir_all" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi", +] + +[[package]] +name = "renderdoc-sys" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1382d1f0a252c4bf97dc20d979a2fdd05b024acd7c2ed0f7595d7817666a157" + +[[package]] +name = "rendering" +version = "0.1.0" +dependencies = [ + "ahash 0.7.6", + "bytemuck", + "common", + "egui", + "image", + "pollster", + "raw-window-handle", + "thiserror", + "tobj", + "wgpu", +] + +[[package]] +name = "runtime" +version = "0.1.0" +dependencies = [ + "anyhow", + "common", + "egui", + "egui-winit", + "env_logger", + "game-engine", + "image", + "log", + "rand 0.8.5", + "raw-window-handle", + "thiserror", + "winit", +] + +[[package]] +name = "rust-ini" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63471c4aa97a1cf8332a5f97709a79a4234698de6a1f5087faf66f2dae810e22" +dependencies = [ + "cfg-if 1.0.0", + "ordered-multimap", +] + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scoped-tls" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" + +[[package]] +name = "scoped_threadpool" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8" + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "semver" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cb243bdfdb5936c8dc3c45762a19d12ab4550cdc753bc247637d4ec35a040fd" + +[[package]] +name = "serde" +version = "1.0.137" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.137" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_repr" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2ad84e47328a31223de7fed7a4f5087f2d6ddfe586cf3ca25b7a165bc0a5aed" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sha1" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" +dependencies = [ + "sha1_smol", +] + +[[package]] +name = "sha1_smol" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" + +[[package]] +name = "slab" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" + +[[package]] +name = "slotmap" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342" +dependencies = [ + "version_check", +] + +[[package]] +name = "smallvec" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" + +[[package]] +name = "smithay-client-toolkit" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a28f16a97fa0e8ce563b2774d1e732dd5d4025d2772c5dba0a41a0f90a29da3" +dependencies = [ + "bitflags", + "calloop", + "dlib", + "lazy_static", + "log", + "memmap2", + "nix 0.22.3", + "pkg-config", + "wayland-client", + "wayland-cursor", + "wayland-protocols", +] + +[[package]] +name = "smithay-clipboard" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "610b551bd25378bfd2b8e7a0fcbd83d427e8f2f6a40c47ae0f70688e9949dd55" +dependencies = [ + "smithay-client-toolkit", + "wayland-client", +] + +[[package]] +name = "socket2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "spin" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c530c2b0d0bf8b69304b39fe2001993e267461948b890cd037d8ad4293fa1a0d" +dependencies = [ + "lock_api", +] + +[[package]] +name = "spirv" +version = "0.2.0+1.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830" +dependencies = [ + "bitflags", + "num-traits", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "syn" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbaf6116ab8924f39d52792136fb74fd60a80194cf1b1c6ffa6453eef1c3f942" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempdir" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" +dependencies = [ + "rand 0.4.6", + "remove_dir_all", +] + +[[package]] +name = "termcolor" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thiserror" +version = "1.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + +[[package]] +name = "tiff" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cfada0986f446a770eca461e8c6566cb879682f7d687c8348aa0c857bd52286" +dependencies = [ + "flate2", + "jpeg-decoder", + "weezl", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tobj" +version = "3.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33477e8d090573560f104bb924ce29e92442a064404b21be6ea59a05c95e0e66" +dependencies = [ + "ahash 0.7.6", +] + +[[package]] +name = "toml" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +dependencies = [ + "serde", +] + +[[package]] +name = "tracing" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0ecdcb44a79f0fe9844f0c4f33a342cbcbb5117de8001e6ba0dc2351327d09" +dependencies = [ + "cfg-if 1.0.0", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc6b8ad3567499f98a1db7a752b07a7c8c7c7c34c332ec00effb2b0027974b7c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f54c8ca710e81886d498c2fd3331b56c93aa248d49de2222ad2742247c60072f" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "ttf-parser" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c74c96594835e10fa545e2a51e8709f30b173a092bfd6036ef2cec53376244f3" + +[[package]] +name = "uds_windows" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "486992108df0fe0160680af1941fe856c521be931d5a5ecccefe0de86dc47e4a" +dependencies = [ + "tempdir", + "winapi", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" + +[[package]] +name = "unicode-ident" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d22af068fba1eb5edcb4aea19d382b2a3deb4c8f9d475c589b6ada9e0fd493ee" + +[[package]] +name = "unicode-normalization" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-width" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" + +[[package]] +name = "url" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +dependencies = [ + "form_urlencoded", + "idna", + "matches", + "percent-encoding", +] + +[[package]] +name = "vek" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b153a45fabd5ecfabf636ba729719c0747d50a4a2f63bf68590a5e187c3918f6" +dependencies = [ + "approx", + "num-integer", + "num-traits", + "rustc_version", + "serde", + "static_assertions", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "waker-fn" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" + +[[package]] +name = "walkdir" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +dependencies = [ + "same-file", + "winapi", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27370197c907c55e3f1a9fbe26f44e937fe6451368324e009cba39e139dc08ad" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53e04185bfa3a779273da532f5025e33398409573f348985af9a1cbf3774d3f4" +dependencies = [ + "bumpalo", + "lazy_static", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f741de44b75e14c35df886aff5f1eb73aa114fa5d4d00dcd37b5e01259bf3b2" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17cae7ff784d7e83a2fe7611cfe766ecf034111b49deb850a3dc7699c08251f5" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d554b7f530dee5964d9a9468d95c1f8b8acae4f282807e7d27d4b03099a46744" + +[[package]] +name = "wayland-client" +version = "0.29.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91223460e73257f697d9e23d401279123d36039a3f7a449e983f123292d4458f" +dependencies = [ + "bitflags", + "downcast-rs", + "libc", + "nix 0.22.3", + "scoped-tls", + "wayland-commons", + "wayland-scanner", + "wayland-sys", +] + +[[package]] +name = "wayland-commons" +version = "0.29.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94f6e5e340d7c13490eca867898c4cec5af56c27a5ffe5c80c6fc4708e22d33e" +dependencies = [ + "nix 0.22.3", + "once_cell", + "smallvec", + "wayland-sys", +] + +[[package]] +name = "wayland-cursor" +version = "0.29.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c52758f13d5e7861fc83d942d3d99bf270c83269575e52ac29e5b73cb956a6bd" +dependencies = [ + "nix 0.22.3", + "wayland-client", + "xcursor", +] + +[[package]] +name = "wayland-protocols" +version = "0.29.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60147ae23303402e41fe034f74fb2c35ad0780ee88a1c40ac09a3be1e7465741" +dependencies = [ + "bitflags", + "wayland-client", + "wayland-commons", + "wayland-scanner", +] + +[[package]] +name = "wayland-scanner" +version = "0.29.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39a1ed3143f7a143187156a2ab52742e89dac33245ba505c17224df48939f9e0" +dependencies = [ + "proc-macro2", + "quote", + "xml-rs", +] + +[[package]] +name = "wayland-sys" +version = "0.29.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9341df79a8975679188e37dab3889bfa57c44ac2cb6da166f519a81cbe452d4" +dependencies = [ + "dlib", + "lazy_static", + "pkg-config", +] + +[[package]] +name = "web-sys" +version = "0.3.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b17e741662c70c8bd24ac5c5b18de314a2c26c32bf8346ee1e6f53de919c283" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webbrowser" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9c28b6b6a78440b02647358625e3febc90724126480b9da6a967b5f674b3554" +dependencies = [ + "jni", + "ndk-glue 0.6.2", + "url", + "web-sys", + "widestring", + "winapi", +] + +[[package]] +name = "weezl" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c97e489d8f836838d497091de568cf16b117486d529ec5579233521065bd5e4" + +[[package]] +name = "wepoll-ffi" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" +dependencies = [ + "cc", +] + +[[package]] +name = "wgpu" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97cd781ff044d6d697b632a2e212032c2e957d1afaa21dbf58069cbb8f78567" +dependencies = [ + "arrayvec", + "js-sys", + "log", + "naga", + "parking_lot", + "raw-window-handle", + "smallvec", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "wgpu-core", + "wgpu-hal", + "wgpu-types", +] + +[[package]] +name = "wgpu-core" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4688c000eb841ca55f7b35db659b78d6e1cd77d7caf8fb929f4e181f754047d" +dependencies = [ + "arrayvec", + "bitflags", + "cfg_aliases", + "codespan-reporting", + "copyless", + "fxhash", + "log", + "naga", + "parking_lot", + "profiling", + "raw-window-handle", + "smallvec", + "thiserror", + "wgpu-hal", + "wgpu-types", +] + +[[package]] +name = "wgpu-hal" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d684ea6a34974a2fc19f1dfd183d11a62e22d75c4f187a574bb1224df8e056c2" +dependencies = [ + "arrayvec", + "ash", + "bit-set", + "bitflags", + "block", + "core-graphics-types", + "d3d12", + "foreign-types", + "fxhash", + "glow", + "gpu-alloc", + "gpu-descriptor", + "inplace_it", + "js-sys", + "khronos-egl", + "libloading", + "log", + "metal", + "naga", + "objc", + "parking_lot", + "profiling", + "range-alloc", + "raw-window-handle", + "renderdoc-sys", + "thiserror", + "wasm-bindgen", + "web-sys", + "wgpu-types", + "winapi", +] + +[[package]] +name = "wgpu-types" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "549533d9e1cdd4b4cda7718d33ff500fc4c34b5467b71d76b547ae0324f3b2a2" +dependencies = [ + "bitflags", +] + +[[package]] +name = "widestring" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + +[[package]] +name = "winit" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b43cc931d58b99461188607efd7acb2a093e65fc621f54cad78517a6063e73a" +dependencies = [ + "bitflags", + "cocoa", + "core-foundation 0.9.3", + "core-graphics 0.22.3", + "core-video-sys", + "dispatch", + "instant", + "lazy_static", + "libc", + "log", + "mio", + "ndk 0.5.0", + "ndk-glue 0.5.2", + "ndk-sys 0.2.2", + "objc", + "parking_lot", + "percent-encoding", + "raw-window-handle", + "smithay-client-toolkit", + "wasm-bindgen", + "wayland-client", + "wayland-protocols", + "web-sys", + "winapi", + "x11-dl", +] + +[[package]] +name = "winreg" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d107f8c6e916235c4c01cabb3e8acf7bea8ef6a63ca2e7fa0527c049badfc48c" +dependencies = [ + "winapi", +] + +[[package]] +name = "x11-clipboard" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "473068b7b80ac86a18328824f1054e5e007898c47b5bbc281bd7abe32bc3653c" +dependencies = [ + "xcb", +] + +[[package]] +name = "x11-dl" +version = "2.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea26926b4ce81a6f5d9d0f3a0bc401e5a37c6ae14a1bfaa8ff6099ca80038c59" +dependencies = [ + "lazy_static", + "libc", + "pkg-config", +] + +[[package]] +name = "xcb" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771e2b996df720cd1c6dd9ff90f62d91698fd3610cc078388d0564bdd6622a9c" +dependencies = [ + "libc", + "log", + "quick-xml", +] + +[[package]] +name = "xcursor" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "463705a63313cd4301184381c5e8042f0a7e9b4bb63653f216311d4ae74690b7" +dependencies = [ + "nom", +] + +[[package]] +name = "xml-rs" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" + +[[package]] +name = "zbus" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53819092b9db813b2c6168b097b4b13ad284d81c9f2b0165a0a1b190e505a1f3" +dependencies = [ + "async-broadcast", + "async-channel", + "async-executor", + "async-io", + "async-lock", + "async-recursion", + "async-task", + "async-trait", + "byteorder", + "derivative", + "enumflags2", + "event-listener", + "futures-core", + "futures-sink", + "futures-util", + "hex", + "lazy_static", + "nix 0.23.1", + "once_cell", + "ordered-stream", + "rand 0.8.5", + "serde", + "serde_repr", + "sha1", + "static_assertions", + "uds_windows", + "winapi", + "zbus_macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7174ebe6722c280d6d132d694bb5664ce50a788cb70eeb518e7fc1ca095a114" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "regex", + "syn", +] + +[[package]] +name = "zbus_names" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45dfcdcf87b71dad505d30cc27b1b7b88a64b6d1c435648f48f9dbc1fdc4b7e1" +dependencies = [ + "serde", + "static_assertions", + "zvariant", +] + +[[package]] +name = "zvariant" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbd1abd8bc2c855412b9c8af9fc11c0d695c73c732ad5a1a1be10f3fd4bf19b2" +dependencies = [ + "byteorder", + "enumflags2", + "libc", + "serde", + "static_assertions", + "zvariant_derive", +] + +[[package]] +name = "zvariant_derive" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abebd57382dfacf3e7bbdd7b7c3d162d6ed0687a78f046263ddef4ddabc275ae" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +]