├── .gitignore ├── src ├── lib.rs ├── main.rs ├── shader.wgsl └── window.rs ├── README.md ├── index.html ├── index.css ├── Cargo.toml └── Cargo.lock /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | #[cfg(target_arch = "wasm32")] 2 | mod window; 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![image](https://user-images.githubusercontent.com/25297359/235316847-803b8a10-2880-48bb-bd1d-efb0e61b689a.png) 2 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | #[tokio::main] 2 | async fn main() { 3 | // build our application with a single route 4 | let app = axum::Router::new().nest("/app", axum_static::static_router(".")); 5 | 6 | println!("Running on http://0.0.0.0:3000/app/index.html"); 7 | axum::Server::bind(&"0.0.0.0:3000".parse().unwrap()) 8 | .serve(app.into_make_service()) 9 | .await 10 | .unwrap(); 11 | } 12 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Bloomen 6 | 7 | 8 | 9 | 10 | 11 |

bloomen

12 | 13 |
14 | 15 |
16 | 17 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /index.css: -------------------------------------------------------------------------------- 1 | * { 2 | padding: 0; 3 | margin: 0; 4 | font-family: sans-serif; 5 | } 6 | h1 { 7 | background-color: #222; 8 | color: #eee; 9 | text-align: center; 10 | width: 100%; 11 | padding: 0.5em 0; 12 | } 13 | .images { 14 | display: flex; 15 | padding: 1%; 16 | justify-content: center; 17 | } 18 | 19 | canvas { 20 | margin: 1%; 21 | background-color: #ddd; 22 | object-fit: contain; 23 | max-height: 100%; 24 | max-width: 100%; 25 | image-rendering: crisp-edges; 26 | image-rendering: pixelated; 27 | } 28 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "bloomen" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | log = "0.4.17" 10 | wgpu = { version = "0.16", features = ["webgl"]} 11 | console_error_panic_hook = "0.1.7" 12 | console_log = "1.0.0" 13 | raw-window-handle = "0.5.2" 14 | 15 | [target.'cfg(not(target_arch = "wasm32"))'.dependencies] 16 | tokio = { version = "1.27.0", features = ["macros", "rt-multi-thread"] } 17 | axum = "0.6.16" 18 | axum_static = "1.2.1" 19 | 20 | [dependencies.image] 21 | version = "0.24.6" 22 | default-features = false 23 | features = ["png", "jpeg"] 24 | 25 | [target.'cfg(target_arch = "wasm32")'.dependencies] 26 | tokio = { version = "1.27.0", features = ["macros", "sync"] } 27 | wasm-bindgen = "0.2" 28 | wasm-bindgen-futures = "0.4.34" 29 | web-sys = { version = "0.3", features = [ 30 | "Document", 31 | "Window", 32 | "Element", 33 | "MouseEvent", 34 | "DomRect", 35 | ]} 36 | js-sys = "0.3.61" 37 | bytemuck = { version = "1.13.1", features = ["derive"] } 38 | instant = { version = "0.1.12", features = [ "wasm-bindgen" ] } 39 | 40 | [lib] 41 | crate-type = ["cdylib", "rlib"] 42 | -------------------------------------------------------------------------------- /src/shader.wgsl: -------------------------------------------------------------------------------- 1 | @group(0) @binding(0) var texture0: texture_2d; 2 | @group(0) @binding(1) var texture1: texture_2d; 3 | @group(0) @binding(2) var texture2: texture_2d; 4 | @group(0) @binding(3) var sampler1: sampler; 5 | @group(1) @binding(0) var uniforms: Uniforms; 6 | 7 | //https://stackoverflow.com/questions/5149544/can-i-generate-a-random-number-inside-a-pixel-shader 8 | fn random(p: vec2) -> f32 { 9 | let K1 = vec2( 10 | 23.14069263277926, // e^pi (Gelfond's constant) 11 | 2.665144142690225 // 2^sqrt(2) (Gelfond–Schneider constant) 12 | ); 13 | return fract( cos( dot(p,K1) ) * 12345.6789 ); 14 | } 15 | 16 | struct Uniforms { 17 | mouse_pos: vec2, 18 | level: u32, 19 | time: f32, 20 | }; 21 | 22 | struct VertexOutput { 23 | @builtin(position) clip_position: vec4, 24 | }; 25 | 26 | @vertex 27 | fn vs( 28 | @builtin(vertex_index) in_vertex_index: u32, 29 | ) -> VertexOutput { 30 | var out: VertexOutput; 31 | let x = f32(1 - i32(in_vertex_index)) * 5.0; 32 | let y = f32(i32(in_vertex_index & 1u) * 2 - 1) * 2.0; 33 | out.clip_position = vec4(x, y, 0.0, 1.0); 34 | return out; 35 | } 36 | 37 | @fragment 38 | fn fs_bloom_select(in: VertexOutput) -> @location(0) vec4 { 39 | let x = i32(in.clip_position.x); 40 | let y = i32(in.clip_position.y); 41 | 42 | if x+i32(100.0*sin(0.5 * uniforms.time)*sin(f32(y)/100.0+0.25 * uniforms.time)) >= 512 - 25 && x+i32(100.0*sin(0.5 * uniforms.time)*sin(f32(y)/100.0+0.25 * uniforms.time)) <= 512+25 || y == 50 || y == 1024 - 50 { 43 | return vec4(10.0, 1.0, 1.0, 1.0); 44 | } 45 | 46 | return vec4(0.0, 0.0, 0.0, 1.0); 47 | } 48 | 49 | fn blur(tex: texture_2d, pos: vec2f, direction: vec2f, mip: i32) -> vec4f { 50 | let hstep = direction.x; 51 | let vstep = direction.y; 52 | 53 | var sum: vec4f; 54 | sum = textureSampleLevel(tex, sampler1, pos+vec2(-4.0*hstep, -4.0*vstep), f32(mip)) * 0.0162162162; 55 | sum += textureSampleLevel(tex, sampler1, pos+vec2(-3.0*hstep, -3.0*vstep), f32(mip)) * 0.0540540541; 56 | sum += textureSampleLevel(tex, sampler1, pos+vec2(-2.0*hstep, -2.0*vstep), f32(mip)) * 0.1216216216; 57 | sum += textureSampleLevel(tex, sampler1, pos+vec2(-1.0*hstep, -1.0*vstep), f32(mip)) * 0.1945945946; 58 | sum += textureSampleLevel(tex, sampler1, pos+vec2(0.0*hstep, 0.0*vstep), f32(mip)) * 0.2270270270; 59 | sum += textureSampleLevel(tex, sampler1, pos+vec2(1.0*hstep, 1.0*vstep), f32(mip)) * 0.1945945946; 60 | sum += textureSampleLevel(tex, sampler1, pos+vec2(2.0*hstep, 2.0*vstep), f32(mip)) * 0.1216216216; 61 | sum += textureSampleLevel(tex, sampler1, pos+vec2(3.0*hstep, 3.0*vstep), f32(mip)) * 0.0540540541; 62 | sum += textureSampleLevel(tex, sampler1, pos+vec2(4.0*hstep, 4.0*vstep), f32(mip)) * 0.0162162162; 63 | 64 | return vec4(sum.rgb, 1.0); 65 | } 66 | 67 | @fragment 68 | fn fs_bloom_blur1(in: VertexOutput) -> @location(0) vec4 { 69 | let size = 1024.0 / pow(2.0, f32(uniforms.level)) * vec2(1.0, 1.0); 70 | let pos = in.clip_position.xy / size; 71 | 72 | return blur(texture2, pos, vec2(1.0, 0.0)/size, i32(uniforms.level - 1u)); 73 | } 74 | 75 | @fragment 76 | fn fs_bloom_blur2(in: VertexOutput) -> @location(0) vec4 { 77 | let size = 1024.0 / pow(2.0, f32(uniforms.level)) * vec2(1.0, 1.0); 78 | let pos = in.clip_position.xy / size; 79 | 80 | return blur(texture2, pos, vec2(0.0, 1.0)/size, i32(uniforms.level)); 81 | //return textureLoad(texture2, vec2(x, y), i32(uniforms.level)); 82 | } 83 | 84 | fn powi(base: i32, exp: u32) -> i32 { 85 | return i32(pow(f32(base), f32(exp))); 86 | } 87 | 88 | @fragment 89 | fn fs_bloom_add(in: VertexOutput) -> @location(0) vec4 { 90 | let size = 1024.0 / pow(2.0, f32(uniforms.level - 1u)) * vec2(1.0, 1.0); 91 | //let size = vec2f(textureDimensions(texture2).xy); 92 | let pos = in.clip_position.xy / size; 93 | 94 | var color: vec4f; 95 | color = textureSampleLevel(texture2, sampler1, pos, f32(uniforms.level - 1u)); 96 | color += textureSampleLevel(texture2, sampler1, pos, f32(uniforms.level)); 97 | //color += blur(texture2, x/2, y/2, vec2(1, 0), i32(uniforms.level)); 98 | //color = vec4(0.0, 0.0, 0.0, 0.0); 99 | //color += 0.05 * textureLoad(texture2, vec2(x, y), 0); 100 | //color += textureLoad(texture2, vec2(x, y), i32(uniforms.padding)); 101 | //color += textureSampleLevel(texture2, sampler1, vec2(f32(x), f32(y))/1024.0, f32(uniforms.padding)); 102 | //color += textureLoad(texture2, vec2(x/powi(2, uniforms.level), y/powi(2, uniforms.level)), i32(uniforms.level)); 103 | 104 | return vec4(color.rgb, 1.0); 105 | } 106 | 107 | @fragment 108 | fn fs_main(in: VertexOutput) -> @location(0) vec4 { 109 | let size = 1024.0 * vec2(1.0, 1.0); 110 | let pos = in.clip_position.xy / size; 111 | 112 | return vec4(textureSampleLevel(texture2, sampler1, pos, 1.0).rgb, 1.0); 113 | } 114 | -------------------------------------------------------------------------------- /src/window.rs: -------------------------------------------------------------------------------- 1 | use instant::Instant; 2 | use log::warn; 3 | use raw_window_handle::{ 4 | HasRawDisplayHandle, HasRawWindowHandle, RawDisplayHandle, RawWindowHandle, WebDisplayHandle, 5 | WebWindowHandle, 6 | }; 7 | use std::cell::RefCell; 8 | use std::rc::Rc; 9 | use std::sync::Arc; 10 | use std::sync::RwLock; 11 | use wasm_bindgen::prelude::*; 12 | use wgpu::util::DeviceExt; 13 | 14 | struct WebWindow; 15 | unsafe impl HasRawDisplayHandle for WebWindow { 16 | fn raw_display_handle(&self) -> RawDisplayHandle { 17 | RawDisplayHandle::Web(WebDisplayHandle::empty()) 18 | } 19 | } 20 | unsafe impl HasRawWindowHandle for WebWindow { 21 | fn raw_window_handle(&self) -> RawWindowHandle { 22 | RawWindowHandle::Web(WebWindowHandle::empty()) 23 | } 24 | } 25 | 26 | #[repr(C)] 27 | #[derive(Debug, Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)] 28 | struct Uniforms { 29 | mouse_pos: [f32; 2], 30 | level: u32, 31 | time: f32, 32 | } 33 | 34 | impl Uniforms { 35 | fn new() -> Self { 36 | Self { 37 | mouse_pos: [-1000.0, 0.0], 38 | level: 0, 39 | time: 0.0, 40 | } 41 | } 42 | } 43 | 44 | struct State { 45 | surface: wgpu::Surface, 46 | device: wgpu::Device, 47 | queue: wgpu::Queue, 48 | config: wgpu::SurfaceConfiguration, 49 | bloom_select_pipeline: wgpu::RenderPipeline, 50 | bloom_blur1_pipeline: wgpu::RenderPipeline, 51 | bloom_blur2_pipeline: wgpu::RenderPipeline, 52 | bloom_add_pipeline: wgpu::RenderPipeline, 53 | render_pipeline: wgpu::RenderPipeline, 54 | mousedown: RwLock, 55 | last_mousepos: RwLock>, 56 | start_mousepos: RwLock>, 57 | texture_input: wgpu::Texture, 58 | texture_bloom_staging: wgpu::Texture, 59 | texture_bloom_blur1: wgpu::Texture, 60 | texture_bloom_blur2: wgpu::Texture, 61 | texture_input_view: wgpu::TextureView, 62 | texture_bloom_staging_view: wgpu::TextureView, 63 | texture_bloom_blur1_views: Vec, 64 | texture_bloom_blur1_view: wgpu::TextureView, 65 | texture_bloom_blur2_views: Vec, 66 | texture_bloom_blur2_view: wgpu::TextureView, 67 | texture_select_bind_group: wgpu::BindGroup, 68 | texture_blur1_bind_groups: Vec, 69 | texture_blur2_bind_groups: Vec, 70 | texture_add_bind_group: wgpu::BindGroup, 71 | uniforms: RwLock, 72 | uniforms_buffer: wgpu::Buffer, 73 | uniforms_bind_group: wgpu::BindGroup, 74 | frame: RwLock, 75 | start_time: Instant, 76 | } 77 | 78 | #[derive(Debug)] 79 | enum CanvasEvent { 80 | MouseMove(u32, u32), 81 | MouseDown, 82 | MouseUp, 83 | } 84 | 85 | impl State { 86 | async fn new(canvas: &web_sys::HtmlCanvasElement) -> Self { 87 | let instance = wgpu::Instance::new(wgpu::InstanceDescriptor { 88 | backends: wgpu::Backends::all(), 89 | dx12_shader_compiler: Default::default(), 90 | }); 91 | 92 | let surface = unsafe { instance.create_surface_from_canvas(canvas.clone()) }.unwrap(); 93 | 94 | let adapter = instance 95 | .request_adapter(&wgpu::RequestAdapterOptions { 96 | power_preference: wgpu::PowerPreference::default(), 97 | compatible_surface: Some(&surface), 98 | force_fallback_adapter: false, 99 | }) 100 | .await 101 | .unwrap(); 102 | 103 | let (device, queue) = adapter 104 | .request_device( 105 | &wgpu::DeviceDescriptor { 106 | features: wgpu::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES, 107 | limits: wgpu::Limits::downlevel_webgl2_defaults() 108 | .using_resolution(adapter.limits()), 109 | label: Some("device"), 110 | }, 111 | None, 112 | ) 113 | .await 114 | .unwrap(); 115 | 116 | let swapchain_caps = surface.get_capabilities(&adapter); 117 | let swapchain_format = swapchain_caps.formats[0]; 118 | 119 | let config = wgpu::SurfaceConfiguration { 120 | usage: wgpu::TextureUsages::RENDER_ATTACHMENT, 121 | format: swapchain_format, 122 | present_mode: wgpu::PresentMode::Fifo, 123 | alpha_mode: swapchain_caps.alpha_modes[0], 124 | view_formats: vec![], 125 | width: 1024, 126 | height: 1024, 127 | }; 128 | 129 | surface.configure(&device, &config); 130 | 131 | let texture_input = device.create_texture(&wgpu::TextureDescriptor { 132 | label: Some("texture_input"), 133 | size: wgpu::Extent3d { 134 | width: 1024, 135 | height: 1024, 136 | depth_or_array_layers: 1, 137 | }, 138 | mip_level_count: 1, 139 | sample_count: 1, 140 | dimension: wgpu::TextureDimension::D2, 141 | format: wgpu::TextureFormat::Rgba16Float, 142 | view_formats: &[wgpu::TextureFormat::Rgba16Float], 143 | usage: wgpu::TextureUsages::TEXTURE_BINDING 144 | | wgpu::TextureUsages::RENDER_ATTACHMENT 145 | | wgpu::TextureUsages::COPY_DST, 146 | }); 147 | 148 | let texture_bloom_staging = device.create_texture(&wgpu::TextureDescriptor { 149 | label: Some("texture_bloom_staging"), 150 | size: wgpu::Extent3d { 151 | width: 1024, 152 | height: 1024, 153 | depth_or_array_layers: 1, 154 | }, 155 | mip_level_count: 1, 156 | sample_count: 1, 157 | dimension: wgpu::TextureDimension::D2, 158 | format: wgpu::TextureFormat::Rgba16Float, 159 | view_formats: &[wgpu::TextureFormat::Rgba16Float], 160 | usage: wgpu::TextureUsages::TEXTURE_BINDING 161 | | wgpu::TextureUsages::RENDER_ATTACHMENT 162 | | wgpu::TextureUsages::COPY_SRC 163 | | wgpu::TextureUsages::COPY_DST, 164 | }); 165 | 166 | let texture_bloom_blur1 = device.create_texture(&wgpu::TextureDescriptor { 167 | label: Some("texture_bloom_blur1"), 168 | size: wgpu::Extent3d { 169 | width: 1024, 170 | height: 1024, 171 | depth_or_array_layers: 1, 172 | }, 173 | mip_level_count: 10, 174 | sample_count: 1, 175 | dimension: wgpu::TextureDimension::D2, 176 | format: wgpu::TextureFormat::Rgba16Float, 177 | view_formats: &[wgpu::TextureFormat::Rgba16Float], 178 | usage: wgpu::TextureUsages::TEXTURE_BINDING 179 | | wgpu::TextureUsages::RENDER_ATTACHMENT 180 | | wgpu::TextureUsages::COPY_SRC 181 | | wgpu::TextureUsages::COPY_DST, 182 | }); 183 | 184 | let texture_bloom_blur2 = device.create_texture(&wgpu::TextureDescriptor { 185 | label: Some("texture_bloom_blur2"), 186 | size: wgpu::Extent3d { 187 | width: 1024, 188 | height: 1024, 189 | depth_or_array_layers: 1, 190 | }, 191 | mip_level_count: 10, 192 | sample_count: 1, 193 | dimension: wgpu::TextureDimension::D2, 194 | format: wgpu::TextureFormat::Rgba16Float, 195 | view_formats: &[wgpu::TextureFormat::Rgba16Float], 196 | usage: wgpu::TextureUsages::TEXTURE_BINDING 197 | | wgpu::TextureUsages::RENDER_ATTACHMENT 198 | | wgpu::TextureUsages::COPY_SRC 199 | | wgpu::TextureUsages::COPY_DST, 200 | }); 201 | 202 | let texture_bind_group_layout = 203 | device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor { 204 | label: Some("texture_bind_group_layout"), 205 | entries: &[ 206 | wgpu::BindGroupLayoutEntry { 207 | binding: 0, 208 | visibility: wgpu::ShaderStages::FRAGMENT, 209 | ty: wgpu::BindingType::Texture { 210 | view_dimension: wgpu::TextureViewDimension::D2, 211 | sample_type: wgpu::TextureSampleType::Float { filterable: true }, 212 | multisampled: false, 213 | }, 214 | count: None, 215 | }, 216 | wgpu::BindGroupLayoutEntry { 217 | binding: 1, 218 | visibility: wgpu::ShaderStages::FRAGMENT, 219 | ty: wgpu::BindingType::Texture { 220 | view_dimension: wgpu::TextureViewDimension::D2, 221 | sample_type: wgpu::TextureSampleType::Float { filterable: true }, 222 | multisampled: false, 223 | }, 224 | count: None, 225 | }, 226 | wgpu::BindGroupLayoutEntry { 227 | binding: 2, 228 | visibility: wgpu::ShaderStages::FRAGMENT, 229 | ty: wgpu::BindingType::Texture { 230 | view_dimension: wgpu::TextureViewDimension::D2, 231 | sample_type: wgpu::TextureSampleType::Float { filterable: true }, 232 | multisampled: false, 233 | }, 234 | count: None, 235 | }, 236 | wgpu::BindGroupLayoutEntry { 237 | binding: 3, 238 | visibility: wgpu::ShaderStages::FRAGMENT, 239 | ty: wgpu::BindingType::Sampler(wgpu::SamplerBindingType::Filtering), 240 | count: None, 241 | }, 242 | ], 243 | }); 244 | 245 | let texture_input_view = texture_input.create_view(&wgpu::TextureViewDescriptor::default()); 246 | let texture_bloom_staging_view = 247 | texture_bloom_staging.create_view(&wgpu::TextureViewDescriptor::default()); 248 | let texture_bloom_blur1_views = (0..10) 249 | .map(|mip| { 250 | texture_bloom_blur1.create_view(&wgpu::TextureViewDescriptor { 251 | label: Some("texture_bloom_blur1_views"), 252 | format: None, 253 | dimension: None, 254 | aspect: wgpu::TextureAspect::All, 255 | base_mip_level: mip, 256 | mip_level_count: Some(1), 257 | base_array_layer: 0, 258 | array_layer_count: None, 259 | }) 260 | }) 261 | .collect::>(); 262 | 263 | let texture_bloom_blur2_views = (0..10) 264 | .map(|mip| { 265 | texture_bloom_blur2.create_view(&wgpu::TextureViewDescriptor { 266 | label: Some("texture_bloom_blur2_views"), 267 | format: None, 268 | dimension: None, 269 | aspect: wgpu::TextureAspect::All, 270 | base_mip_level: mip, 271 | mip_level_count: Some(1), 272 | base_array_layer: 0, 273 | array_layer_count: None, 274 | }) 275 | }) 276 | .collect::>(); 277 | 278 | let texture_bloom_blur1_view = 279 | texture_bloom_blur1.create_view(&wgpu::TextureViewDescriptor::default()); 280 | 281 | let texture_bloom_blur2_view = 282 | texture_bloom_blur2.create_view(&wgpu::TextureViewDescriptor::default()); 283 | 284 | let sampler = device.create_sampler(&wgpu::SamplerDescriptor { 285 | label: Some("sampler"), 286 | address_mode_u: wgpu::AddressMode::ClampToEdge, 287 | address_mode_v: wgpu::AddressMode::ClampToEdge, 288 | address_mode_w: wgpu::AddressMode::ClampToEdge, 289 | mag_filter: wgpu::FilterMode::Linear, 290 | min_filter: wgpu::FilterMode::Linear, 291 | mipmap_filter: wgpu::FilterMode::Linear, 292 | lod_min_clamp: 0.0, 293 | lod_max_clamp: 999.0, 294 | compare: None, 295 | anisotropy_clamp: 1, 296 | border_color: None, 297 | }); 298 | 299 | let texture_select_bind_group = device.create_bind_group(&wgpu::BindGroupDescriptor { 300 | label: Some("texture_select_bind_group"), 301 | layout: &texture_bind_group_layout, 302 | entries: &[ 303 | wgpu::BindGroupEntry { 304 | binding: 0, 305 | resource: wgpu::BindingResource::TextureView(&texture_input_view), 306 | }, 307 | wgpu::BindGroupEntry { 308 | binding: 1, 309 | resource: wgpu::BindingResource::TextureView(&texture_bloom_blur1_view), 310 | }, 311 | wgpu::BindGroupEntry { 312 | binding: 2, 313 | resource: wgpu::BindingResource::TextureView(&texture_bloom_blur2_view), 314 | }, 315 | wgpu::BindGroupEntry { 316 | binding: 3, 317 | resource: wgpu::BindingResource::Sampler(&sampler), 318 | }, 319 | ], 320 | }); 321 | 322 | let texture_blur1_bind_groups = (0..10) 323 | .map(|mip| { 324 | device.create_bind_group(&wgpu::BindGroupDescriptor { 325 | label: Some("texture_blur1_bind_group"), 326 | layout: &texture_bind_group_layout, 327 | entries: &[ 328 | wgpu::BindGroupEntry { 329 | binding: 0, 330 | resource: wgpu::BindingResource::TextureView(&texture_input_view), 331 | }, 332 | wgpu::BindGroupEntry { 333 | binding: 1, 334 | resource: wgpu::BindingResource::TextureView( 335 | &texture_bloom_staging_view, 336 | ), 337 | }, 338 | wgpu::BindGroupEntry { 339 | binding: 2, 340 | resource: wgpu::BindingResource::TextureView(&texture_bloom_blur2_view), 341 | }, 342 | wgpu::BindGroupEntry { 343 | binding: 3, 344 | resource: wgpu::BindingResource::Sampler(&sampler), 345 | }, 346 | ], 347 | }) 348 | }) 349 | .collect::>(); 350 | 351 | let texture_blur2_bind_groups = (0..10) 352 | .map(|mip| { 353 | device.create_bind_group(&wgpu::BindGroupDescriptor { 354 | label: Some("texture_blur2_bind_group"), 355 | layout: &texture_bind_group_layout, 356 | entries: &[ 357 | wgpu::BindGroupEntry { 358 | binding: 0, 359 | resource: wgpu::BindingResource::TextureView(&texture_input_view), 360 | }, 361 | wgpu::BindGroupEntry { 362 | binding: 1, 363 | resource: wgpu::BindingResource::TextureView( 364 | &texture_bloom_staging_view, 365 | ), 366 | }, 367 | wgpu::BindGroupEntry { 368 | binding: 2, 369 | resource: wgpu::BindingResource::TextureView(&texture_bloom_blur1_view), 370 | }, 371 | wgpu::BindGroupEntry { 372 | binding: 3, 373 | resource: wgpu::BindingResource::Sampler(&sampler), 374 | }, 375 | ], 376 | }) 377 | }) 378 | .collect::>(); 379 | 380 | let texture_add_bind_group = device.create_bind_group(&wgpu::BindGroupDescriptor { 381 | label: Some("texture_add_bind_group"), 382 | layout: &texture_bind_group_layout, 383 | entries: &[ 384 | wgpu::BindGroupEntry { 385 | binding: 0, 386 | resource: wgpu::BindingResource::TextureView(&texture_input_view), 387 | }, 388 | wgpu::BindGroupEntry { 389 | binding: 1, 390 | resource: wgpu::BindingResource::TextureView(&texture_bloom_staging_view), 391 | }, 392 | wgpu::BindGroupEntry { 393 | binding: 2, 394 | resource: wgpu::BindingResource::TextureView(&texture_bloom_blur2_view), 395 | }, 396 | wgpu::BindGroupEntry { 397 | binding: 3, 398 | resource: wgpu::BindingResource::Sampler(&sampler), 399 | }, 400 | ], 401 | }); 402 | 403 | let uniforms = Uniforms::new(); 404 | let uniforms_buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor { 405 | label: Some("uniforms_buffer"), 406 | contents: bytemuck::cast_slice(&[uniforms]), 407 | usage: wgpu::BufferUsages::UNIFORM | wgpu::BufferUsages::COPY_DST, 408 | }); 409 | 410 | let uniforms_bind_group_layout = 411 | device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor { 412 | label: Some("uniforms_bind_group_layout"), 413 | entries: &[wgpu::BindGroupLayoutEntry { 414 | binding: 0, 415 | visibility: wgpu::ShaderStages::FRAGMENT, 416 | ty: wgpu::BindingType::Buffer { 417 | ty: wgpu::BufferBindingType::Uniform, 418 | has_dynamic_offset: false, 419 | min_binding_size: None, 420 | }, 421 | count: None, 422 | }], 423 | }); 424 | let uniforms_bind_group = device.create_bind_group(&wgpu::BindGroupDescriptor { 425 | label: Some("uniforms_bind_group"), 426 | layout: &uniforms_bind_group_layout, 427 | entries: &[wgpu::BindGroupEntry { 428 | binding: 0, 429 | resource: uniforms_buffer.as_entire_binding(), 430 | }], 431 | }); 432 | 433 | // Create pipeline 434 | let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor { 435 | label: Some("shader"), 436 | source: wgpu::ShaderSource::Wgsl(include_str!("shader.wgsl").into()), 437 | }); 438 | let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor { 439 | label: Some("pipeline_layout"), 440 | bind_group_layouts: &[&texture_bind_group_layout, &uniforms_bind_group_layout], 441 | push_constant_ranges: &[], 442 | }); 443 | 444 | let bloom_select_pipeline = 445 | device.create_render_pipeline(&wgpu::RenderPipelineDescriptor { 446 | label: Some("bloom_select_pipeline"), 447 | layout: Some(&pipeline_layout), 448 | vertex: wgpu::VertexState { 449 | module: &shader, 450 | entry_point: "vs", 451 | buffers: &[], 452 | }, 453 | fragment: Some(wgpu::FragmentState { 454 | module: &shader, 455 | entry_point: "fs_bloom_select", 456 | targets: &[Some(wgpu::TextureFormat::Rgba16Float.into())], 457 | }), 458 | primitive: wgpu::PrimitiveState { 459 | topology: wgpu::PrimitiveTopology::TriangleList, 460 | strip_index_format: None, 461 | front_face: wgpu::FrontFace::Ccw, 462 | cull_mode: Some(wgpu::Face::Back), 463 | polygon_mode: wgpu::PolygonMode::Fill, 464 | unclipped_depth: false, 465 | conservative: false, 466 | }, 467 | depth_stencil: None, 468 | multisample: wgpu::MultisampleState { 469 | count: 1, 470 | mask: !0, 471 | alpha_to_coverage_enabled: false, 472 | }, 473 | multiview: None, 474 | }); 475 | 476 | let bloom_blur1_pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor { 477 | label: Some("bloom_blur1_pipeline"), 478 | layout: Some(&pipeline_layout), 479 | vertex: wgpu::VertexState { 480 | module: &shader, 481 | entry_point: "vs", 482 | buffers: &[], 483 | }, 484 | fragment: Some(wgpu::FragmentState { 485 | module: &shader, 486 | entry_point: "fs_bloom_blur1", 487 | targets: &[Some(wgpu::TextureFormat::Rgba16Float.into())], 488 | }), 489 | primitive: wgpu::PrimitiveState { 490 | topology: wgpu::PrimitiveTopology::TriangleList, 491 | strip_index_format: None, 492 | front_face: wgpu::FrontFace::Ccw, 493 | cull_mode: Some(wgpu::Face::Back), 494 | polygon_mode: wgpu::PolygonMode::Fill, 495 | unclipped_depth: false, 496 | conservative: false, 497 | }, 498 | depth_stencil: None, 499 | multisample: wgpu::MultisampleState { 500 | count: 1, 501 | mask: !0, 502 | alpha_to_coverage_enabled: false, 503 | }, 504 | multiview: None, 505 | }); 506 | 507 | let bloom_blur2_pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor { 508 | label: Some("bloom_blur2_pipeline"), 509 | layout: Some(&pipeline_layout), 510 | vertex: wgpu::VertexState { 511 | module: &shader, 512 | entry_point: "vs", 513 | buffers: &[], 514 | }, 515 | fragment: Some(wgpu::FragmentState { 516 | module: &shader, 517 | entry_point: "fs_bloom_blur2", 518 | targets: &[Some(wgpu::TextureFormat::Rgba16Float.into())], 519 | }), 520 | primitive: wgpu::PrimitiveState { 521 | topology: wgpu::PrimitiveTopology::TriangleList, 522 | strip_index_format: None, 523 | front_face: wgpu::FrontFace::Ccw, 524 | cull_mode: Some(wgpu::Face::Back), 525 | polygon_mode: wgpu::PolygonMode::Fill, 526 | unclipped_depth: false, 527 | conservative: false, 528 | }, 529 | depth_stencil: None, 530 | multisample: wgpu::MultisampleState { 531 | count: 1, 532 | mask: !0, 533 | alpha_to_coverage_enabled: false, 534 | }, 535 | multiview: None, 536 | }); 537 | 538 | let bloom_add_pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor { 539 | label: Some("bloom_add_pipeline"), 540 | layout: Some(&pipeline_layout), 541 | vertex: wgpu::VertexState { 542 | module: &shader, 543 | entry_point: "vs", 544 | buffers: &[], 545 | }, 546 | fragment: Some(wgpu::FragmentState { 547 | module: &shader, 548 | entry_point: "fs_bloom_add", 549 | targets: &[Some(wgpu::TextureFormat::Rgba16Float.into())], 550 | }), 551 | primitive: wgpu::PrimitiveState { 552 | topology: wgpu::PrimitiveTopology::TriangleList, 553 | strip_index_format: None, 554 | front_face: wgpu::FrontFace::Ccw, 555 | cull_mode: Some(wgpu::Face::Back), 556 | polygon_mode: wgpu::PolygonMode::Fill, 557 | unclipped_depth: false, 558 | conservative: false, 559 | }, 560 | depth_stencil: None, 561 | multisample: wgpu::MultisampleState { 562 | count: 1, 563 | mask: !0, 564 | alpha_to_coverage_enabled: false, 565 | }, 566 | multiview: None, 567 | }); 568 | 569 | let render_pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor { 570 | label: Some("render_pipeline"), 571 | layout: Some(&pipeline_layout), 572 | vertex: wgpu::VertexState { 573 | module: &shader, 574 | entry_point: "vs", 575 | buffers: &[], 576 | }, 577 | fragment: Some(wgpu::FragmentState { 578 | module: &shader, 579 | entry_point: "fs_main", 580 | targets: &[Some(wgpu::ColorTargetState { 581 | format: config.format, 582 | blend: Some(wgpu::BlendState::REPLACE), 583 | write_mask: wgpu::ColorWrites::ALL, 584 | })], 585 | }), 586 | primitive: wgpu::PrimitiveState { 587 | topology: wgpu::PrimitiveTopology::TriangleList, 588 | strip_index_format: None, 589 | front_face: wgpu::FrontFace::Ccw, 590 | cull_mode: Some(wgpu::Face::Back), 591 | polygon_mode: wgpu::PolygonMode::Fill, 592 | unclipped_depth: false, 593 | conservative: false, 594 | }, 595 | depth_stencil: None, 596 | multisample: wgpu::MultisampleState { 597 | count: 1, 598 | mask: !0, 599 | alpha_to_coverage_enabled: false, 600 | }, 601 | multiview: None, 602 | }); 603 | 604 | Self { 605 | surface, 606 | device, 607 | queue, 608 | config, 609 | bloom_select_pipeline, 610 | bloom_blur1_pipeline, 611 | bloom_blur2_pipeline, 612 | bloom_add_pipeline, 613 | render_pipeline, 614 | mousedown: RwLock::new(false), 615 | last_mousepos: RwLock::new(None), 616 | start_mousepos: RwLock::new(None), 617 | texture_input, 618 | texture_bloom_staging, 619 | texture_bloom_blur1, 620 | texture_bloom_blur2, 621 | texture_input_view, 622 | texture_bloom_staging_view, 623 | texture_bloom_blur1_views, 624 | texture_bloom_blur1_view, 625 | texture_bloom_blur2_views, 626 | texture_bloom_blur2_view, 627 | texture_select_bind_group, 628 | texture_blur1_bind_groups, 629 | texture_blur2_bind_groups, 630 | texture_add_bind_group, 631 | uniforms: RwLock::new(uniforms), 632 | uniforms_buffer, 633 | uniforms_bind_group, 634 | frame: RwLock::new(0), 635 | start_time: Instant::now(), 636 | } 637 | } 638 | 639 | fn input(&self, event: &CanvasEvent) -> bool { 640 | warn!("{:?}", &event); 641 | match event { 642 | CanvasEvent::MouseDown => { 643 | *self.mousedown.write().unwrap() = true; 644 | *self.start_mousepos.write().unwrap() = *self.last_mousepos.read().unwrap(); 645 | } 646 | CanvasEvent::MouseUp => { 647 | *self.mousedown.write().unwrap() = false; 648 | } 649 | CanvasEvent::MouseMove(x, y) => { 650 | let old_mousepos = *self.last_mousepos.read().unwrap(); 651 | *self.last_mousepos.write().unwrap() = Some((*x, *y)); 652 | if !*self.mousedown.read().unwrap() || old_mousepos.is_none() { 653 | return false; 654 | } 655 | } 656 | _ => {} 657 | } 658 | false 659 | } 660 | 661 | fn update(&self) { 662 | let MOUSE_INACTIVE = [-1000.0, 0.0]; 663 | let mut mousepos = self 664 | .last_mousepos 665 | .read() 666 | .unwrap() 667 | .map_or(MOUSE_INACTIVE, |(x, y)| [x as f32, y as f32]); 668 | 669 | if !*self.mousedown.read().unwrap() { 670 | mousepos = MOUSE_INACTIVE; 671 | } 672 | 673 | warn!("{:?}", &mousepos); 674 | self.uniforms.write().unwrap().mouse_pos = mousepos; 675 | self.queue.write_buffer( 676 | &self.uniforms_buffer, 677 | 0, 678 | bytemuck::cast_slice(&[*self.uniforms.read().unwrap()]), 679 | ); 680 | } 681 | 682 | fn render(&self) -> Result<(), wgpu::SurfaceError> { 683 | let output = self.surface.get_current_texture()?; 684 | let view = output 685 | .texture 686 | .create_view(&wgpu::TextureViewDescriptor::default()); 687 | 688 | let frame: u32 = *self.frame.read().unwrap(); 689 | self.uniforms.write().unwrap().time = self.start_time.elapsed().as_secs_f32(); 690 | self.queue.write_buffer( 691 | &self.uniforms_buffer, 692 | 0, 693 | bytemuck::cast_slice(&[*self.uniforms.read().unwrap()]), 694 | ); 695 | 696 | let mut encoder = self 697 | .device 698 | .create_command_encoder(&wgpu::CommandEncoderDescriptor { 699 | label: Some("select_encoder"), 700 | }); 701 | { 702 | let mut bloom_select_pass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { 703 | label: Some("bloom_select_pass"), 704 | color_attachments: &[Some(wgpu::RenderPassColorAttachment { 705 | view: &self.texture_bloom_staging_view, 706 | resolve_target: None, 707 | ops: wgpu::Operations { 708 | load: wgpu::LoadOp::Clear(wgpu::Color { 709 | r: 0.1, 710 | g: 0.2, 711 | b: 0.3, 712 | a: 1.0, 713 | }), 714 | store: true, 715 | }, 716 | })], 717 | depth_stencil_attachment: None, 718 | }); 719 | 720 | bloom_select_pass.set_pipeline(&self.bloom_select_pipeline); 721 | bloom_select_pass.set_bind_group(0, &self.texture_select_bind_group, &[]); 722 | bloom_select_pass.set_bind_group(1, &self.uniforms_bind_group, &[]); 723 | bloom_select_pass.draw(0..3, 0..1); 724 | } 725 | 726 | encoder.copy_texture_to_texture( 727 | wgpu::ImageCopyTextureBase { 728 | texture: &self.texture_bloom_staging, 729 | mip_level: 0, 730 | origin: wgpu::Origin3d::default(), 731 | aspect: wgpu::TextureAspect::All, 732 | }, 733 | wgpu::ImageCopyTextureBase { 734 | texture: &self.texture_bloom_blur2, 735 | mip_level: 0, 736 | origin: wgpu::Origin3d::default(), 737 | aspect: wgpu::TextureAspect::All, 738 | }, 739 | wgpu::Extent3d { 740 | width: 1024, 741 | height: 1024, 742 | depth_or_array_layers: 1, 743 | }, 744 | ); 745 | 746 | self.queue.submit(std::iter::once(encoder.finish())); 747 | 748 | for level in 1..7 { 749 | let mut encoder = self 750 | .device 751 | .create_command_encoder(&wgpu::CommandEncoderDescriptor { 752 | label: Some("bloom_level_encoder"), 753 | }); 754 | { 755 | self.uniforms.write().unwrap().level = level; 756 | //self.uniforms.write().unwrap().padding = (frame / 60) % 10; 757 | self.queue.write_buffer( 758 | &self.uniforms_buffer, 759 | 0, 760 | bytemuck::cast_slice(&[*self.uniforms.read().unwrap()]), 761 | ); 762 | 763 | { 764 | let mut bloom_blur1_pass = 765 | encoder.begin_render_pass(&wgpu::RenderPassDescriptor { 766 | label: Some("bloom_blur1_pass"), 767 | color_attachments: &[Some(wgpu::RenderPassColorAttachment { 768 | view: &self.texture_bloom_blur1_views[level as usize], 769 | resolve_target: None, 770 | ops: wgpu::Operations { 771 | load: wgpu::LoadOp::Clear(wgpu::Color { 772 | r: 0.1, 773 | g: 0.2, 774 | b: 0.3, 775 | a: 1.0, 776 | }), 777 | store: true, 778 | }, 779 | })], 780 | depth_stencil_attachment: None, 781 | }); 782 | 783 | bloom_blur1_pass.set_pipeline(&self.bloom_blur1_pipeline); 784 | bloom_blur1_pass.set_bind_group( 785 | 0, 786 | &self.texture_blur1_bind_groups[level as usize - 1], 787 | &[], 788 | ); 789 | bloom_blur1_pass.set_bind_group(1, &self.uniforms_bind_group, &[]); 790 | bloom_blur1_pass.draw(0..3, 0..1); 791 | } 792 | { 793 | let mut bloom_blur2_pass = 794 | encoder.begin_render_pass(&wgpu::RenderPassDescriptor { 795 | label: Some("bloom_blur2_pass"), 796 | color_attachments: &[Some(wgpu::RenderPassColorAttachment { 797 | view: &self.texture_bloom_blur2_views[level as usize], 798 | resolve_target: None, 799 | ops: wgpu::Operations { 800 | load: wgpu::LoadOp::Clear(wgpu::Color { 801 | r: 0.1, 802 | g: 0.2, 803 | b: 0.3, 804 | a: 1.0, 805 | }), 806 | store: true, 807 | }, 808 | })], 809 | depth_stencil_attachment: None, 810 | }); 811 | 812 | bloom_blur2_pass.set_pipeline(&self.bloom_blur2_pipeline); 813 | bloom_blur2_pass.set_bind_group( 814 | 0, 815 | &self.texture_blur2_bind_groups[level as usize], 816 | &[], 817 | ); 818 | bloom_blur2_pass.set_bind_group(1, &self.uniforms_bind_group, &[]); 819 | bloom_blur2_pass.draw(0..3, 0..1); 820 | } 821 | } 822 | self.queue.submit(std::iter::once(encoder.finish())); 823 | } 824 | 825 | for level in (1..7).rev() { 826 | let mut encoder = self 827 | .device 828 | .create_command_encoder(&wgpu::CommandEncoderDescriptor { 829 | label: Some("bloom_level_encoder"), 830 | }); 831 | { 832 | self.uniforms.write().unwrap().level = level; 833 | self.queue.write_buffer( 834 | &self.uniforms_buffer, 835 | 0, 836 | bytemuck::cast_slice(&[*self.uniforms.read().unwrap()]), 837 | ); 838 | 839 | { 840 | let mut bloom_add_pass = 841 | encoder.begin_render_pass(&wgpu::RenderPassDescriptor { 842 | label: Some("bloom_add_pass"), 843 | color_attachments: &[Some(wgpu::RenderPassColorAttachment { 844 | view: &self.texture_bloom_blur1_views[level as usize - 1], 845 | resolve_target: None, 846 | ops: wgpu::Operations { 847 | load: wgpu::LoadOp::Clear(wgpu::Color { 848 | r: 0.1, 849 | g: 0.2, 850 | b: 0.3, 851 | a: 1.0, 852 | }), 853 | store: true, 854 | }, 855 | })], 856 | depth_stencil_attachment: None, 857 | }); 858 | 859 | bloom_add_pass.set_pipeline(&self.bloom_add_pipeline); 860 | bloom_add_pass.set_bind_group(0, &self.texture_add_bind_group, &[]); 861 | bloom_add_pass.set_bind_group(1, &self.uniforms_bind_group, &[]); 862 | bloom_add_pass.draw(0..3, 0..1); 863 | } 864 | encoder.copy_texture_to_texture( 865 | wgpu::ImageCopyTextureBase { 866 | texture: &self.texture_bloom_blur1, 867 | mip_level: level - 1, 868 | origin: wgpu::Origin3d::default(), 869 | aspect: wgpu::TextureAspect::All, 870 | }, 871 | wgpu::ImageCopyTextureBase { 872 | texture: &self.texture_bloom_blur2, 873 | mip_level: level - 1, 874 | origin: wgpu::Origin3d::default(), 875 | aspect: wgpu::TextureAspect::All, 876 | }, 877 | wgpu::Extent3d { 878 | width: 1024 / 2_u32.pow(level - 1), 879 | height: 1024 / 2_u32.pow(level - 1), 880 | depth_or_array_layers: 1, 881 | }, 882 | ); 883 | } 884 | self.queue.submit(std::iter::once(encoder.finish())); 885 | } 886 | 887 | let mut encoder = self 888 | .device 889 | .create_command_encoder(&wgpu::CommandEncoderDescriptor { 890 | label: Some("render_encoder"), 891 | }); 892 | { 893 | let mut render_pass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { 894 | label: Some("render_pass"), 895 | color_attachments: &[Some(wgpu::RenderPassColorAttachment { 896 | view: &view, 897 | resolve_target: None, 898 | ops: wgpu::Operations { 899 | load: wgpu::LoadOp::Clear(wgpu::Color { 900 | r: 0.1, 901 | g: 0.2, 902 | b: 0.3, 903 | a: 1.0, 904 | }), 905 | store: true, 906 | }, 907 | })], 908 | depth_stencil_attachment: None, 909 | }); 910 | 911 | render_pass.set_pipeline(&self.render_pipeline); 912 | render_pass.set_bind_group(0, &self.texture_add_bind_group, &[]); 913 | render_pass.set_bind_group(1, &self.uniforms_bind_group, &[]); 914 | render_pass.draw(0..3, 0..1); 915 | } 916 | 917 | self.queue.submit(std::iter::once(encoder.finish())); 918 | 919 | output.present(); 920 | 921 | *self.frame.write().unwrap() += 1; 922 | 923 | Ok(()) 924 | } 925 | } 926 | 927 | #[cfg_attr(target_arch = "wasm32", wasm_bindgen(start))] 928 | pub async fn run() { 929 | std::panic::set_hook(Box::new(console_error_panic_hook::hook)); 930 | console_log::init_with_level(log::Level::Warn).expect("Couldn't initialize logger"); 931 | 932 | let window = web_sys::window().unwrap(); 933 | let doc = window.document().unwrap(); 934 | let canvas = doc.get_element_by_id("canvas").unwrap(); 935 | 936 | let canvas: &'static _ = Box::leak(Box::new( 937 | canvas.dyn_into::().unwrap(), 938 | )); 939 | 940 | canvas.set_width(1024); 941 | canvas.set_height(1024); 942 | 943 | let state = Arc::new(State::new(&canvas).await); 944 | 945 | let mut receiver = setup_listeners(&canvas); 946 | 947 | { 948 | let state2 = Arc::clone(&state); 949 | let window2 = window.clone(); 950 | 951 | let f = Rc::new(RefCell::>>::new(None)); 952 | let g = f.clone(); 953 | *g.borrow_mut() = Some(Closure::new(move || { 954 | state2.render().unwrap(); 955 | window2.request_animation_frame(f.borrow().as_ref().unwrap().as_ref().unchecked_ref()); 956 | })); 957 | 958 | window.request_animation_frame(g.borrow().as_ref().unwrap().as_ref().unchecked_ref()); 959 | } 960 | 961 | loop { 962 | tokio::select! { 963 | Some(event) = receiver.recv() => { 964 | state.input(&event); 965 | state.update(); 966 | } 967 | } 968 | } 969 | } 970 | 971 | fn setup_listeners( 972 | canvas: &'static web_sys::HtmlCanvasElement, 973 | ) -> tokio::sync::mpsc::UnboundedReceiver { 974 | let (sender, receiver) = tokio::sync::mpsc::unbounded_channel(); 975 | 976 | let sender2 = sender.clone(); 977 | { 978 | let closure = Closure::wrap(Box::new(move |event: web_sys::MouseEvent| { 979 | let rect = canvas.get_bounding_client_rect(); 980 | let width = canvas.width() as f32; 981 | let height = canvas.height() as f32; 982 | let x = event.offset_x() as f32 * (width / rect.width() as f32); 983 | let y = event.offset_y() as f32 * (height / rect.height() as f32); 984 | sender2.send(CanvasEvent::MouseMove(x as u32, y as u32)); 985 | }) as Box); 986 | 987 | canvas 988 | .add_event_listener_with_callback("mousemove", closure.as_ref().unchecked_ref()) 989 | .unwrap(); 990 | closure.forget(); 991 | } 992 | 993 | let sender2 = sender.clone(); 994 | { 995 | let closure = Closure::wrap(Box::new(move |event: web_sys::MouseEvent| { 996 | sender2.send(CanvasEvent::MouseDown); 997 | }) as Box); 998 | 999 | canvas 1000 | .add_event_listener_with_callback("mousedown", closure.as_ref().unchecked_ref()) 1001 | .unwrap(); 1002 | closure.forget(); 1003 | } 1004 | 1005 | let sender2 = sender.clone(); 1006 | { 1007 | let closure = Closure::wrap(Box::new(move |event: web_sys::MouseEvent| { 1008 | sender2.send(CanvasEvent::MouseUp); 1009 | }) as Box); 1010 | 1011 | canvas 1012 | .add_event_listener_with_callback("mouseup", closure.as_ref().unchecked_ref()) 1013 | .unwrap(); 1014 | closure.forget(); 1015 | } 1016 | 1017 | receiver 1018 | } 1019 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "addr2line" 7 | version = "0.19.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" 10 | dependencies = [ 11 | "gimli", 12 | ] 13 | 14 | [[package]] 15 | name = "adler" 16 | version = "1.0.2" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" 19 | 20 | [[package]] 21 | name = "ahash" 22 | version = "0.7.6" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" 25 | dependencies = [ 26 | "getrandom", 27 | "once_cell", 28 | "version_check", 29 | ] 30 | 31 | [[package]] 32 | name = "android_system_properties" 33 | version = "0.1.5" 34 | source = "registry+https://github.com/rust-lang/crates.io-index" 35 | checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" 36 | dependencies = [ 37 | "libc", 38 | ] 39 | 40 | [[package]] 41 | name = "arrayvec" 42 | version = "0.7.2" 43 | source = "registry+https://github.com/rust-lang/crates.io-index" 44 | checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" 45 | 46 | [[package]] 47 | name = "ash" 48 | version = "0.37.2+1.3.238" 49 | source = "registry+https://github.com/rust-lang/crates.io-index" 50 | checksum = "28bf19c1f0a470be5fbf7522a308a05df06610252c5bcf5143e1b23f629a9a03" 51 | dependencies = [ 52 | "libloading 0.7.4", 53 | ] 54 | 55 | [[package]] 56 | name = "async-trait" 57 | version = "0.1.68" 58 | source = "registry+https://github.com/rust-lang/crates.io-index" 59 | checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" 60 | dependencies = [ 61 | "proc-macro2", 62 | "quote", 63 | "syn 2.0.15", 64 | ] 65 | 66 | [[package]] 67 | name = "autocfg" 68 | version = "1.1.0" 69 | source = "registry+https://github.com/rust-lang/crates.io-index" 70 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 71 | 72 | [[package]] 73 | name = "axum" 74 | version = "0.6.16" 75 | source = "registry+https://github.com/rust-lang/crates.io-index" 76 | checksum = "113713495a32dd0ab52baf5c10044725aa3aec00b31beda84218e469029b72a3" 77 | dependencies = [ 78 | "async-trait", 79 | "axum-core", 80 | "bitflags 1.3.2", 81 | "bytes", 82 | "futures-util", 83 | "http", 84 | "http-body", 85 | "hyper", 86 | "itoa", 87 | "matchit", 88 | "memchr", 89 | "mime", 90 | "percent-encoding", 91 | "pin-project-lite", 92 | "rustversion", 93 | "serde", 94 | "serde_json", 95 | "serde_path_to_error", 96 | "serde_urlencoded", 97 | "sync_wrapper", 98 | "tokio", 99 | "tower", 100 | "tower-layer", 101 | "tower-service", 102 | ] 103 | 104 | [[package]] 105 | name = "axum-core" 106 | version = "0.3.4" 107 | source = "registry+https://github.com/rust-lang/crates.io-index" 108 | checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" 109 | dependencies = [ 110 | "async-trait", 111 | "bytes", 112 | "futures-util", 113 | "http", 114 | "http-body", 115 | "mime", 116 | "rustversion", 117 | "tower-layer", 118 | "tower-service", 119 | ] 120 | 121 | [[package]] 122 | name = "axum_static" 123 | version = "1.2.1" 124 | source = "registry+https://github.com/rust-lang/crates.io-index" 125 | checksum = "dd4dcef55efd444bb6527681cce697a1db94269a81080a9f30fb1eda11c5a750" 126 | dependencies = [ 127 | "axum", 128 | "tower-http", 129 | ] 130 | 131 | [[package]] 132 | name = "backtrace" 133 | version = "0.3.67" 134 | source = "registry+https://github.com/rust-lang/crates.io-index" 135 | checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" 136 | dependencies = [ 137 | "addr2line", 138 | "cc", 139 | "cfg-if", 140 | "libc", 141 | "miniz_oxide 0.6.2", 142 | "object", 143 | "rustc-demangle", 144 | ] 145 | 146 | [[package]] 147 | name = "bit-set" 148 | version = "0.5.3" 149 | source = "registry+https://github.com/rust-lang/crates.io-index" 150 | checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" 151 | dependencies = [ 152 | "bit-vec", 153 | ] 154 | 155 | [[package]] 156 | name = "bit-vec" 157 | version = "0.6.3" 158 | source = "registry+https://github.com/rust-lang/crates.io-index" 159 | checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" 160 | 161 | [[package]] 162 | name = "bitflags" 163 | version = "1.3.2" 164 | source = "registry+https://github.com/rust-lang/crates.io-index" 165 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 166 | 167 | [[package]] 168 | name = "bitflags" 169 | version = "2.1.0" 170 | source = "registry+https://github.com/rust-lang/crates.io-index" 171 | checksum = "c70beb79cbb5ce9c4f8e20849978f34225931f665bb49efa6982875a4d5facb3" 172 | 173 | [[package]] 174 | name = "block" 175 | version = "0.1.6" 176 | source = "registry+https://github.com/rust-lang/crates.io-index" 177 | checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" 178 | 179 | [[package]] 180 | name = "bloomen" 181 | version = "0.1.0" 182 | dependencies = [ 183 | "axum", 184 | "axum_static", 185 | "bytemuck", 186 | "console_error_panic_hook", 187 | "console_log", 188 | "image", 189 | "instant", 190 | "js-sys", 191 | "log", 192 | "raw-window-handle", 193 | "tokio", 194 | "wasm-bindgen", 195 | "wasm-bindgen-futures", 196 | "web-sys", 197 | "wgpu", 198 | ] 199 | 200 | [[package]] 201 | name = "bumpalo" 202 | version = "3.12.1" 203 | source = "registry+https://github.com/rust-lang/crates.io-index" 204 | checksum = "9b1ce199063694f33ffb7dd4e0ee620741495c32833cde5aa08f02a0bf96f0c8" 205 | 206 | [[package]] 207 | name = "bytemuck" 208 | version = "1.13.1" 209 | source = "registry+https://github.com/rust-lang/crates.io-index" 210 | checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" 211 | dependencies = [ 212 | "bytemuck_derive", 213 | ] 214 | 215 | [[package]] 216 | name = "bytemuck_derive" 217 | version = "1.4.1" 218 | source = "registry+https://github.com/rust-lang/crates.io-index" 219 | checksum = "fdde5c9cd29ebd706ce1b35600920a33550e402fc998a2e53ad3b42c3c47a192" 220 | dependencies = [ 221 | "proc-macro2", 222 | "quote", 223 | "syn 2.0.15", 224 | ] 225 | 226 | [[package]] 227 | name = "byteorder" 228 | version = "1.4.3" 229 | source = "registry+https://github.com/rust-lang/crates.io-index" 230 | checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" 231 | 232 | [[package]] 233 | name = "bytes" 234 | version = "1.4.0" 235 | source = "registry+https://github.com/rust-lang/crates.io-index" 236 | checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" 237 | 238 | [[package]] 239 | name = "cc" 240 | version = "1.0.79" 241 | source = "registry+https://github.com/rust-lang/crates.io-index" 242 | checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" 243 | 244 | [[package]] 245 | name = "cfg-if" 246 | version = "1.0.0" 247 | source = "registry+https://github.com/rust-lang/crates.io-index" 248 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 249 | 250 | [[package]] 251 | name = "codespan-reporting" 252 | version = "0.11.1" 253 | source = "registry+https://github.com/rust-lang/crates.io-index" 254 | checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" 255 | dependencies = [ 256 | "termcolor", 257 | "unicode-width", 258 | ] 259 | 260 | [[package]] 261 | name = "color_quant" 262 | version = "1.1.0" 263 | source = "registry+https://github.com/rust-lang/crates.io-index" 264 | checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" 265 | 266 | [[package]] 267 | name = "com-rs" 268 | version = "0.2.1" 269 | source = "registry+https://github.com/rust-lang/crates.io-index" 270 | checksum = "bf43edc576402991846b093a7ca18a3477e0ef9c588cde84964b5d3e43016642" 271 | 272 | [[package]] 273 | name = "console_error_panic_hook" 274 | version = "0.1.7" 275 | source = "registry+https://github.com/rust-lang/crates.io-index" 276 | checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" 277 | dependencies = [ 278 | "cfg-if", 279 | "wasm-bindgen", 280 | ] 281 | 282 | [[package]] 283 | name = "console_log" 284 | version = "1.0.0" 285 | source = "registry+https://github.com/rust-lang/crates.io-index" 286 | checksum = "be8aed40e4edbf4d3b4431ab260b63fdc40f5780a4766824329ea0f1eefe3c0f" 287 | dependencies = [ 288 | "log", 289 | "web-sys", 290 | ] 291 | 292 | [[package]] 293 | name = "core-foundation" 294 | version = "0.9.3" 295 | source = "registry+https://github.com/rust-lang/crates.io-index" 296 | checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" 297 | dependencies = [ 298 | "core-foundation-sys", 299 | "libc", 300 | ] 301 | 302 | [[package]] 303 | name = "core-foundation-sys" 304 | version = "0.8.4" 305 | source = "registry+https://github.com/rust-lang/crates.io-index" 306 | checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" 307 | 308 | [[package]] 309 | name = "core-graphics-types" 310 | version = "0.1.1" 311 | source = "registry+https://github.com/rust-lang/crates.io-index" 312 | checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" 313 | dependencies = [ 314 | "bitflags 1.3.2", 315 | "core-foundation", 316 | "foreign-types", 317 | "libc", 318 | ] 319 | 320 | [[package]] 321 | name = "crc32fast" 322 | version = "1.3.2" 323 | source = "registry+https://github.com/rust-lang/crates.io-index" 324 | checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" 325 | dependencies = [ 326 | "cfg-if", 327 | ] 328 | 329 | [[package]] 330 | name = "d3d12" 331 | version = "0.6.0" 332 | source = "registry+https://github.com/rust-lang/crates.io-index" 333 | checksum = "d8f0de2f5a8e7bd4a9eec0e3c781992a4ce1724f68aec7d7a3715344de8b39da" 334 | dependencies = [ 335 | "bitflags 1.3.2", 336 | "libloading 0.7.4", 337 | "winapi", 338 | ] 339 | 340 | [[package]] 341 | name = "fdeflate" 342 | version = "0.3.0" 343 | source = "registry+https://github.com/rust-lang/crates.io-index" 344 | checksum = "d329bdeac514ee06249dabc27877490f17f5d371ec693360768b838e19f3ae10" 345 | dependencies = [ 346 | "simd-adler32", 347 | ] 348 | 349 | [[package]] 350 | name = "flate2" 351 | version = "1.0.25" 352 | source = "registry+https://github.com/rust-lang/crates.io-index" 353 | checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" 354 | dependencies = [ 355 | "crc32fast", 356 | "miniz_oxide 0.6.2", 357 | ] 358 | 359 | [[package]] 360 | name = "fnv" 361 | version = "1.0.7" 362 | source = "registry+https://github.com/rust-lang/crates.io-index" 363 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 364 | 365 | [[package]] 366 | name = "foreign-types" 367 | version = "0.3.2" 368 | source = "registry+https://github.com/rust-lang/crates.io-index" 369 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 370 | dependencies = [ 371 | "foreign-types-shared", 372 | ] 373 | 374 | [[package]] 375 | name = "foreign-types-shared" 376 | version = "0.1.1" 377 | source = "registry+https://github.com/rust-lang/crates.io-index" 378 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 379 | 380 | [[package]] 381 | name = "form_urlencoded" 382 | version = "1.1.0" 383 | source = "registry+https://github.com/rust-lang/crates.io-index" 384 | checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" 385 | dependencies = [ 386 | "percent-encoding", 387 | ] 388 | 389 | [[package]] 390 | name = "futures-channel" 391 | version = "0.3.28" 392 | source = "registry+https://github.com/rust-lang/crates.io-index" 393 | checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" 394 | dependencies = [ 395 | "futures-core", 396 | ] 397 | 398 | [[package]] 399 | name = "futures-core" 400 | version = "0.3.28" 401 | source = "registry+https://github.com/rust-lang/crates.io-index" 402 | checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" 403 | 404 | [[package]] 405 | name = "futures-sink" 406 | version = "0.3.28" 407 | source = "registry+https://github.com/rust-lang/crates.io-index" 408 | checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" 409 | 410 | [[package]] 411 | name = "futures-task" 412 | version = "0.3.28" 413 | source = "registry+https://github.com/rust-lang/crates.io-index" 414 | checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" 415 | 416 | [[package]] 417 | name = "futures-util" 418 | version = "0.3.28" 419 | source = "registry+https://github.com/rust-lang/crates.io-index" 420 | checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" 421 | dependencies = [ 422 | "futures-core", 423 | "futures-task", 424 | "pin-project-lite", 425 | "pin-utils", 426 | ] 427 | 428 | [[package]] 429 | name = "getrandom" 430 | version = "0.2.9" 431 | source = "registry+https://github.com/rust-lang/crates.io-index" 432 | checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" 433 | dependencies = [ 434 | "cfg-if", 435 | "libc", 436 | "wasi", 437 | ] 438 | 439 | [[package]] 440 | name = "gimli" 441 | version = "0.27.2" 442 | source = "registry+https://github.com/rust-lang/crates.io-index" 443 | checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" 444 | 445 | [[package]] 446 | name = "glow" 447 | version = "0.12.1" 448 | source = "registry+https://github.com/rust-lang/crates.io-index" 449 | checksum = "4e007a07a24de5ecae94160f141029e9a347282cfe25d1d58d85d845cf3130f1" 450 | dependencies = [ 451 | "js-sys", 452 | "slotmap", 453 | "wasm-bindgen", 454 | "web-sys", 455 | ] 456 | 457 | [[package]] 458 | name = "gpu-alloc" 459 | version = "0.5.3" 460 | source = "registry+https://github.com/rust-lang/crates.io-index" 461 | checksum = "7fc59e5f710e310e76e6707f86c561dd646f69a8876da9131703b2f717de818d" 462 | dependencies = [ 463 | "bitflags 1.3.2", 464 | "gpu-alloc-types", 465 | ] 466 | 467 | [[package]] 468 | name = "gpu-alloc-types" 469 | version = "0.2.0" 470 | source = "registry+https://github.com/rust-lang/crates.io-index" 471 | checksum = "54804d0d6bc9d7f26db4eaec1ad10def69b599315f487d32c334a80d1efe67a5" 472 | dependencies = [ 473 | "bitflags 1.3.2", 474 | ] 475 | 476 | [[package]] 477 | name = "gpu-allocator" 478 | version = "0.22.0" 479 | source = "registry+https://github.com/rust-lang/crates.io-index" 480 | checksum = "ce95f9e2e11c2c6fadfce42b5af60005db06576f231f5c92550fdded43c423e8" 481 | dependencies = [ 482 | "backtrace", 483 | "log", 484 | "thiserror", 485 | "winapi", 486 | "windows", 487 | ] 488 | 489 | [[package]] 490 | name = "gpu-descriptor" 491 | version = "0.2.3" 492 | source = "registry+https://github.com/rust-lang/crates.io-index" 493 | checksum = "0b0c02e1ba0bdb14e965058ca34e09c020f8e507a760df1121728e0aef68d57a" 494 | dependencies = [ 495 | "bitflags 1.3.2", 496 | "gpu-descriptor-types", 497 | "hashbrown", 498 | ] 499 | 500 | [[package]] 501 | name = "gpu-descriptor-types" 502 | version = "0.1.1" 503 | source = "registry+https://github.com/rust-lang/crates.io-index" 504 | checksum = "363e3677e55ad168fef68cf9de3a4a310b53124c5e784c53a1d70e92d23f2126" 505 | dependencies = [ 506 | "bitflags 1.3.2", 507 | ] 508 | 509 | [[package]] 510 | name = "hashbrown" 511 | version = "0.12.3" 512 | source = "registry+https://github.com/rust-lang/crates.io-index" 513 | checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 514 | dependencies = [ 515 | "ahash", 516 | ] 517 | 518 | [[package]] 519 | name = "hassle-rs" 520 | version = "0.10.0" 521 | source = "registry+https://github.com/rust-lang/crates.io-index" 522 | checksum = "1397650ee315e8891a0df210707f0fc61771b0cc518c3023896064c5407cb3b0" 523 | dependencies = [ 524 | "bitflags 1.3.2", 525 | "com-rs", 526 | "libc", 527 | "libloading 0.7.4", 528 | "thiserror", 529 | "widestring", 530 | "winapi", 531 | ] 532 | 533 | [[package]] 534 | name = "hermit-abi" 535 | version = "0.2.6" 536 | source = "registry+https://github.com/rust-lang/crates.io-index" 537 | checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" 538 | dependencies = [ 539 | "libc", 540 | ] 541 | 542 | [[package]] 543 | name = "hexf-parse" 544 | version = "0.2.1" 545 | source = "registry+https://github.com/rust-lang/crates.io-index" 546 | checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" 547 | 548 | [[package]] 549 | name = "http" 550 | version = "0.2.9" 551 | source = "registry+https://github.com/rust-lang/crates.io-index" 552 | checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" 553 | dependencies = [ 554 | "bytes", 555 | "fnv", 556 | "itoa", 557 | ] 558 | 559 | [[package]] 560 | name = "http-body" 561 | version = "0.4.5" 562 | source = "registry+https://github.com/rust-lang/crates.io-index" 563 | checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" 564 | dependencies = [ 565 | "bytes", 566 | "http", 567 | "pin-project-lite", 568 | ] 569 | 570 | [[package]] 571 | name = "http-range-header" 572 | version = "0.3.0" 573 | source = "registry+https://github.com/rust-lang/crates.io-index" 574 | checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" 575 | 576 | [[package]] 577 | name = "httparse" 578 | version = "1.8.0" 579 | source = "registry+https://github.com/rust-lang/crates.io-index" 580 | checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" 581 | 582 | [[package]] 583 | name = "httpdate" 584 | version = "1.0.2" 585 | source = "registry+https://github.com/rust-lang/crates.io-index" 586 | checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" 587 | 588 | [[package]] 589 | name = "hyper" 590 | version = "0.14.26" 591 | source = "registry+https://github.com/rust-lang/crates.io-index" 592 | checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" 593 | dependencies = [ 594 | "bytes", 595 | "futures-channel", 596 | "futures-core", 597 | "futures-util", 598 | "http", 599 | "http-body", 600 | "httparse", 601 | "httpdate", 602 | "itoa", 603 | "pin-project-lite", 604 | "socket2", 605 | "tokio", 606 | "tower-service", 607 | "tracing", 608 | "want", 609 | ] 610 | 611 | [[package]] 612 | name = "image" 613 | version = "0.24.6" 614 | source = "registry+https://github.com/rust-lang/crates.io-index" 615 | checksum = "527909aa81e20ac3a44803521443a765550f09b5130c2c2fa1ea59c2f8f50a3a" 616 | dependencies = [ 617 | "bytemuck", 618 | "byteorder", 619 | "color_quant", 620 | "jpeg-decoder", 621 | "num-rational", 622 | "num-traits", 623 | "png", 624 | ] 625 | 626 | [[package]] 627 | name = "indexmap" 628 | version = "1.9.3" 629 | source = "registry+https://github.com/rust-lang/crates.io-index" 630 | checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" 631 | dependencies = [ 632 | "autocfg", 633 | "hashbrown", 634 | ] 635 | 636 | [[package]] 637 | name = "instant" 638 | version = "0.1.12" 639 | source = "registry+https://github.com/rust-lang/crates.io-index" 640 | checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" 641 | dependencies = [ 642 | "cfg-if", 643 | "js-sys", 644 | "wasm-bindgen", 645 | "web-sys", 646 | ] 647 | 648 | [[package]] 649 | name = "itoa" 650 | version = "1.0.6" 651 | source = "registry+https://github.com/rust-lang/crates.io-index" 652 | checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" 653 | 654 | [[package]] 655 | name = "jpeg-decoder" 656 | version = "0.3.0" 657 | source = "registry+https://github.com/rust-lang/crates.io-index" 658 | checksum = "bc0000e42512c92e31c2252315bda326620a4e034105e900c98ec492fa077b3e" 659 | 660 | [[package]] 661 | name = "js-sys" 662 | version = "0.3.61" 663 | source = "registry+https://github.com/rust-lang/crates.io-index" 664 | checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" 665 | dependencies = [ 666 | "wasm-bindgen", 667 | ] 668 | 669 | [[package]] 670 | name = "khronos-egl" 671 | version = "4.1.0" 672 | source = "registry+https://github.com/rust-lang/crates.io-index" 673 | checksum = "8c2352bd1d0bceb871cb9d40f24360c8133c11d7486b68b5381c1dd1a32015e3" 674 | dependencies = [ 675 | "libc", 676 | "libloading 0.7.4", 677 | "pkg-config", 678 | ] 679 | 680 | [[package]] 681 | name = "libc" 682 | version = "0.2.142" 683 | source = "registry+https://github.com/rust-lang/crates.io-index" 684 | checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317" 685 | 686 | [[package]] 687 | name = "libloading" 688 | version = "0.7.4" 689 | source = "registry+https://github.com/rust-lang/crates.io-index" 690 | checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" 691 | dependencies = [ 692 | "cfg-if", 693 | "winapi", 694 | ] 695 | 696 | [[package]] 697 | name = "libloading" 698 | version = "0.8.0" 699 | source = "registry+https://github.com/rust-lang/crates.io-index" 700 | checksum = "d580318f95776505201b28cf98eb1fa5e4be3b689633ba6a3e6cd880ff22d8cb" 701 | dependencies = [ 702 | "cfg-if", 703 | "windows-sys 0.48.0", 704 | ] 705 | 706 | [[package]] 707 | name = "lock_api" 708 | version = "0.4.9" 709 | source = "registry+https://github.com/rust-lang/crates.io-index" 710 | checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" 711 | dependencies = [ 712 | "autocfg", 713 | "scopeguard", 714 | ] 715 | 716 | [[package]] 717 | name = "log" 718 | version = "0.4.17" 719 | source = "registry+https://github.com/rust-lang/crates.io-index" 720 | checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" 721 | dependencies = [ 722 | "cfg-if", 723 | ] 724 | 725 | [[package]] 726 | name = "malloc_buf" 727 | version = "0.0.6" 728 | source = "registry+https://github.com/rust-lang/crates.io-index" 729 | checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" 730 | dependencies = [ 731 | "libc", 732 | ] 733 | 734 | [[package]] 735 | name = "matchit" 736 | version = "0.7.0" 737 | source = "registry+https://github.com/rust-lang/crates.io-index" 738 | checksum = "b87248edafb776e59e6ee64a79086f65890d3510f2c656c000bf2a7e8a0aea40" 739 | 740 | [[package]] 741 | name = "memchr" 742 | version = "2.5.0" 743 | source = "registry+https://github.com/rust-lang/crates.io-index" 744 | checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" 745 | 746 | [[package]] 747 | name = "metal" 748 | version = "0.24.0" 749 | source = "registry+https://github.com/rust-lang/crates.io-index" 750 | checksum = "de11355d1f6781482d027a3b4d4de7825dcedb197bf573e0596d00008402d060" 751 | dependencies = [ 752 | "bitflags 1.3.2", 753 | "block", 754 | "core-graphics-types", 755 | "foreign-types", 756 | "log", 757 | "objc", 758 | ] 759 | 760 | [[package]] 761 | name = "mime" 762 | version = "0.3.17" 763 | source = "registry+https://github.com/rust-lang/crates.io-index" 764 | checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 765 | 766 | [[package]] 767 | name = "mime_guess" 768 | version = "2.0.4" 769 | source = "registry+https://github.com/rust-lang/crates.io-index" 770 | checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" 771 | dependencies = [ 772 | "mime", 773 | "unicase", 774 | ] 775 | 776 | [[package]] 777 | name = "miniz_oxide" 778 | version = "0.6.2" 779 | source = "registry+https://github.com/rust-lang/crates.io-index" 780 | checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" 781 | dependencies = [ 782 | "adler", 783 | ] 784 | 785 | [[package]] 786 | name = "miniz_oxide" 787 | version = "0.7.1" 788 | source = "registry+https://github.com/rust-lang/crates.io-index" 789 | checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" 790 | dependencies = [ 791 | "adler", 792 | "simd-adler32", 793 | ] 794 | 795 | [[package]] 796 | name = "mio" 797 | version = "0.8.6" 798 | source = "registry+https://github.com/rust-lang/crates.io-index" 799 | checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" 800 | dependencies = [ 801 | "libc", 802 | "log", 803 | "wasi", 804 | "windows-sys 0.45.0", 805 | ] 806 | 807 | [[package]] 808 | name = "naga" 809 | version = "0.12.0" 810 | source = "registry+https://github.com/rust-lang/crates.io-index" 811 | checksum = "f00ce114f2867153c079d4489629dbd27aa4b5387a8ba5341bd3f6dfe870688f" 812 | dependencies = [ 813 | "bit-set", 814 | "bitflags 1.3.2", 815 | "codespan-reporting", 816 | "hexf-parse", 817 | "indexmap", 818 | "log", 819 | "num-traits", 820 | "rustc-hash", 821 | "spirv", 822 | "termcolor", 823 | "thiserror", 824 | "unicode-xid", 825 | ] 826 | 827 | [[package]] 828 | name = "num-integer" 829 | version = "0.1.45" 830 | source = "registry+https://github.com/rust-lang/crates.io-index" 831 | checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" 832 | dependencies = [ 833 | "autocfg", 834 | "num-traits", 835 | ] 836 | 837 | [[package]] 838 | name = "num-rational" 839 | version = "0.4.1" 840 | source = "registry+https://github.com/rust-lang/crates.io-index" 841 | checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" 842 | dependencies = [ 843 | "autocfg", 844 | "num-integer", 845 | "num-traits", 846 | ] 847 | 848 | [[package]] 849 | name = "num-traits" 850 | version = "0.2.15" 851 | source = "registry+https://github.com/rust-lang/crates.io-index" 852 | checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" 853 | dependencies = [ 854 | "autocfg", 855 | ] 856 | 857 | [[package]] 858 | name = "num_cpus" 859 | version = "1.15.0" 860 | source = "registry+https://github.com/rust-lang/crates.io-index" 861 | checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" 862 | dependencies = [ 863 | "hermit-abi", 864 | "libc", 865 | ] 866 | 867 | [[package]] 868 | name = "objc" 869 | version = "0.2.7" 870 | source = "registry+https://github.com/rust-lang/crates.io-index" 871 | checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" 872 | dependencies = [ 873 | "malloc_buf", 874 | "objc_exception", 875 | ] 876 | 877 | [[package]] 878 | name = "objc_exception" 879 | version = "0.1.2" 880 | source = "registry+https://github.com/rust-lang/crates.io-index" 881 | checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" 882 | dependencies = [ 883 | "cc", 884 | ] 885 | 886 | [[package]] 887 | name = "object" 888 | version = "0.30.3" 889 | source = "registry+https://github.com/rust-lang/crates.io-index" 890 | checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" 891 | dependencies = [ 892 | "memchr", 893 | ] 894 | 895 | [[package]] 896 | name = "once_cell" 897 | version = "1.17.1" 898 | source = "registry+https://github.com/rust-lang/crates.io-index" 899 | checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" 900 | 901 | [[package]] 902 | name = "parking_lot" 903 | version = "0.12.1" 904 | source = "registry+https://github.com/rust-lang/crates.io-index" 905 | checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" 906 | dependencies = [ 907 | "lock_api", 908 | "parking_lot_core", 909 | ] 910 | 911 | [[package]] 912 | name = "parking_lot_core" 913 | version = "0.9.7" 914 | source = "registry+https://github.com/rust-lang/crates.io-index" 915 | checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" 916 | dependencies = [ 917 | "cfg-if", 918 | "libc", 919 | "redox_syscall", 920 | "smallvec", 921 | "windows-sys 0.45.0", 922 | ] 923 | 924 | [[package]] 925 | name = "percent-encoding" 926 | version = "2.2.0" 927 | source = "registry+https://github.com/rust-lang/crates.io-index" 928 | checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" 929 | 930 | [[package]] 931 | name = "pin-project" 932 | version = "1.0.12" 933 | source = "registry+https://github.com/rust-lang/crates.io-index" 934 | checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" 935 | dependencies = [ 936 | "pin-project-internal", 937 | ] 938 | 939 | [[package]] 940 | name = "pin-project-internal" 941 | version = "1.0.12" 942 | source = "registry+https://github.com/rust-lang/crates.io-index" 943 | checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" 944 | dependencies = [ 945 | "proc-macro2", 946 | "quote", 947 | "syn 1.0.109", 948 | ] 949 | 950 | [[package]] 951 | name = "pin-project-lite" 952 | version = "0.2.9" 953 | source = "registry+https://github.com/rust-lang/crates.io-index" 954 | checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" 955 | 956 | [[package]] 957 | name = "pin-utils" 958 | version = "0.1.0" 959 | source = "registry+https://github.com/rust-lang/crates.io-index" 960 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 961 | 962 | [[package]] 963 | name = "pkg-config" 964 | version = "0.3.26" 965 | source = "registry+https://github.com/rust-lang/crates.io-index" 966 | checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" 967 | 968 | [[package]] 969 | name = "png" 970 | version = "0.17.8" 971 | source = "registry+https://github.com/rust-lang/crates.io-index" 972 | checksum = "aaeebc51f9e7d2c150d3f3bfeb667f2aa985db5ef1e3d212847bdedb488beeaa" 973 | dependencies = [ 974 | "bitflags 1.3.2", 975 | "crc32fast", 976 | "fdeflate", 977 | "flate2", 978 | "miniz_oxide 0.7.1", 979 | ] 980 | 981 | [[package]] 982 | name = "proc-macro2" 983 | version = "1.0.56" 984 | source = "registry+https://github.com/rust-lang/crates.io-index" 985 | checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" 986 | dependencies = [ 987 | "unicode-ident", 988 | ] 989 | 990 | [[package]] 991 | name = "profiling" 992 | version = "1.0.8" 993 | source = "registry+https://github.com/rust-lang/crates.io-index" 994 | checksum = "332cd62e95873ea4f41f3dfd6bbbfc5b52aec892d7e8d534197c4720a0bbbab2" 995 | 996 | [[package]] 997 | name = "quote" 998 | version = "1.0.26" 999 | source = "registry+https://github.com/rust-lang/crates.io-index" 1000 | checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" 1001 | dependencies = [ 1002 | "proc-macro2", 1003 | ] 1004 | 1005 | [[package]] 1006 | name = "range-alloc" 1007 | version = "0.1.3" 1008 | source = "registry+https://github.com/rust-lang/crates.io-index" 1009 | checksum = "9c8a99fddc9f0ba0a85884b8d14e3592853e787d581ca1816c91349b10e4eeab" 1010 | 1011 | [[package]] 1012 | name = "raw-window-handle" 1013 | version = "0.5.2" 1014 | source = "registry+https://github.com/rust-lang/crates.io-index" 1015 | checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" 1016 | 1017 | [[package]] 1018 | name = "redox_syscall" 1019 | version = "0.2.16" 1020 | source = "registry+https://github.com/rust-lang/crates.io-index" 1021 | checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" 1022 | dependencies = [ 1023 | "bitflags 1.3.2", 1024 | ] 1025 | 1026 | [[package]] 1027 | name = "renderdoc-sys" 1028 | version = "1.0.0" 1029 | source = "registry+https://github.com/rust-lang/crates.io-index" 1030 | checksum = "216080ab382b992234dda86873c18d4c48358f5cfcb70fd693d7f6f2131b628b" 1031 | 1032 | [[package]] 1033 | name = "rustc-demangle" 1034 | version = "0.1.23" 1035 | source = "registry+https://github.com/rust-lang/crates.io-index" 1036 | checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" 1037 | 1038 | [[package]] 1039 | name = "rustc-hash" 1040 | version = "1.1.0" 1041 | source = "registry+https://github.com/rust-lang/crates.io-index" 1042 | checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" 1043 | 1044 | [[package]] 1045 | name = "rustversion" 1046 | version = "1.0.12" 1047 | source = "registry+https://github.com/rust-lang/crates.io-index" 1048 | checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" 1049 | 1050 | [[package]] 1051 | name = "ryu" 1052 | version = "1.0.13" 1053 | source = "registry+https://github.com/rust-lang/crates.io-index" 1054 | checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" 1055 | 1056 | [[package]] 1057 | name = "scopeguard" 1058 | version = "1.1.0" 1059 | source = "registry+https://github.com/rust-lang/crates.io-index" 1060 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 1061 | 1062 | [[package]] 1063 | name = "serde" 1064 | version = "1.0.160" 1065 | source = "registry+https://github.com/rust-lang/crates.io-index" 1066 | checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c" 1067 | 1068 | [[package]] 1069 | name = "serde_json" 1070 | version = "1.0.96" 1071 | source = "registry+https://github.com/rust-lang/crates.io-index" 1072 | checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" 1073 | dependencies = [ 1074 | "itoa", 1075 | "ryu", 1076 | "serde", 1077 | ] 1078 | 1079 | [[package]] 1080 | name = "serde_path_to_error" 1081 | version = "0.1.11" 1082 | source = "registry+https://github.com/rust-lang/crates.io-index" 1083 | checksum = "f7f05c1d5476066defcdfacce1f52fc3cae3af1d3089727100c02ae92e5abbe0" 1084 | dependencies = [ 1085 | "serde", 1086 | ] 1087 | 1088 | [[package]] 1089 | name = "serde_urlencoded" 1090 | version = "0.7.1" 1091 | source = "registry+https://github.com/rust-lang/crates.io-index" 1092 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 1093 | dependencies = [ 1094 | "form_urlencoded", 1095 | "itoa", 1096 | "ryu", 1097 | "serde", 1098 | ] 1099 | 1100 | [[package]] 1101 | name = "simd-adler32" 1102 | version = "0.3.5" 1103 | source = "registry+https://github.com/rust-lang/crates.io-index" 1104 | checksum = "238abfbb77c1915110ad968465608b68e869e0772622c9656714e73e5a1a522f" 1105 | 1106 | [[package]] 1107 | name = "slotmap" 1108 | version = "1.0.6" 1109 | source = "registry+https://github.com/rust-lang/crates.io-index" 1110 | checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342" 1111 | dependencies = [ 1112 | "version_check", 1113 | ] 1114 | 1115 | [[package]] 1116 | name = "smallvec" 1117 | version = "1.10.0" 1118 | source = "registry+https://github.com/rust-lang/crates.io-index" 1119 | checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" 1120 | 1121 | [[package]] 1122 | name = "socket2" 1123 | version = "0.4.9" 1124 | source = "registry+https://github.com/rust-lang/crates.io-index" 1125 | checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" 1126 | dependencies = [ 1127 | "libc", 1128 | "winapi", 1129 | ] 1130 | 1131 | [[package]] 1132 | name = "spirv" 1133 | version = "0.2.0+1.5.4" 1134 | source = "registry+https://github.com/rust-lang/crates.io-index" 1135 | checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830" 1136 | dependencies = [ 1137 | "bitflags 1.3.2", 1138 | "num-traits", 1139 | ] 1140 | 1141 | [[package]] 1142 | name = "static_assertions" 1143 | version = "1.1.0" 1144 | source = "registry+https://github.com/rust-lang/crates.io-index" 1145 | checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" 1146 | 1147 | [[package]] 1148 | name = "syn" 1149 | version = "1.0.109" 1150 | source = "registry+https://github.com/rust-lang/crates.io-index" 1151 | checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 1152 | dependencies = [ 1153 | "proc-macro2", 1154 | "quote", 1155 | "unicode-ident", 1156 | ] 1157 | 1158 | [[package]] 1159 | name = "syn" 1160 | version = "2.0.15" 1161 | source = "registry+https://github.com/rust-lang/crates.io-index" 1162 | checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" 1163 | dependencies = [ 1164 | "proc-macro2", 1165 | "quote", 1166 | "unicode-ident", 1167 | ] 1168 | 1169 | [[package]] 1170 | name = "sync_wrapper" 1171 | version = "0.1.2" 1172 | source = "registry+https://github.com/rust-lang/crates.io-index" 1173 | checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" 1174 | 1175 | [[package]] 1176 | name = "termcolor" 1177 | version = "1.2.0" 1178 | source = "registry+https://github.com/rust-lang/crates.io-index" 1179 | checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" 1180 | dependencies = [ 1181 | "winapi-util", 1182 | ] 1183 | 1184 | [[package]] 1185 | name = "thiserror" 1186 | version = "1.0.40" 1187 | source = "registry+https://github.com/rust-lang/crates.io-index" 1188 | checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" 1189 | dependencies = [ 1190 | "thiserror-impl", 1191 | ] 1192 | 1193 | [[package]] 1194 | name = "thiserror-impl" 1195 | version = "1.0.40" 1196 | source = "registry+https://github.com/rust-lang/crates.io-index" 1197 | checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" 1198 | dependencies = [ 1199 | "proc-macro2", 1200 | "quote", 1201 | "syn 2.0.15", 1202 | ] 1203 | 1204 | [[package]] 1205 | name = "tokio" 1206 | version = "1.27.0" 1207 | source = "registry+https://github.com/rust-lang/crates.io-index" 1208 | checksum = "d0de47a4eecbe11f498978a9b29d792f0d2692d1dd003650c24c76510e3bc001" 1209 | dependencies = [ 1210 | "autocfg", 1211 | "bytes", 1212 | "libc", 1213 | "mio", 1214 | "num_cpus", 1215 | "pin-project-lite", 1216 | "socket2", 1217 | "tokio-macros", 1218 | "windows-sys 0.45.0", 1219 | ] 1220 | 1221 | [[package]] 1222 | name = "tokio-macros" 1223 | version = "2.0.0" 1224 | source = "registry+https://github.com/rust-lang/crates.io-index" 1225 | checksum = "61a573bdc87985e9d6ddeed1b3d864e8a302c847e40d647746df2f1de209d1ce" 1226 | dependencies = [ 1227 | "proc-macro2", 1228 | "quote", 1229 | "syn 2.0.15", 1230 | ] 1231 | 1232 | [[package]] 1233 | name = "tokio-util" 1234 | version = "0.7.7" 1235 | source = "registry+https://github.com/rust-lang/crates.io-index" 1236 | checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" 1237 | dependencies = [ 1238 | "bytes", 1239 | "futures-core", 1240 | "futures-sink", 1241 | "pin-project-lite", 1242 | "tokio", 1243 | ] 1244 | 1245 | [[package]] 1246 | name = "tower" 1247 | version = "0.4.13" 1248 | source = "registry+https://github.com/rust-lang/crates.io-index" 1249 | checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" 1250 | dependencies = [ 1251 | "futures-core", 1252 | "futures-util", 1253 | "pin-project", 1254 | "pin-project-lite", 1255 | "tokio", 1256 | "tower-layer", 1257 | "tower-service", 1258 | "tracing", 1259 | ] 1260 | 1261 | [[package]] 1262 | name = "tower-http" 1263 | version = "0.3.5" 1264 | source = "registry+https://github.com/rust-lang/crates.io-index" 1265 | checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858" 1266 | dependencies = [ 1267 | "bitflags 1.3.2", 1268 | "bytes", 1269 | "futures-core", 1270 | "futures-util", 1271 | "http", 1272 | "http-body", 1273 | "http-range-header", 1274 | "httpdate", 1275 | "mime", 1276 | "mime_guess", 1277 | "percent-encoding", 1278 | "pin-project-lite", 1279 | "tokio", 1280 | "tokio-util", 1281 | "tower-layer", 1282 | "tower-service", 1283 | ] 1284 | 1285 | [[package]] 1286 | name = "tower-layer" 1287 | version = "0.3.2" 1288 | source = "registry+https://github.com/rust-lang/crates.io-index" 1289 | checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" 1290 | 1291 | [[package]] 1292 | name = "tower-service" 1293 | version = "0.3.2" 1294 | source = "registry+https://github.com/rust-lang/crates.io-index" 1295 | checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" 1296 | 1297 | [[package]] 1298 | name = "tracing" 1299 | version = "0.1.37" 1300 | source = "registry+https://github.com/rust-lang/crates.io-index" 1301 | checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" 1302 | dependencies = [ 1303 | "cfg-if", 1304 | "log", 1305 | "pin-project-lite", 1306 | "tracing-core", 1307 | ] 1308 | 1309 | [[package]] 1310 | name = "tracing-core" 1311 | version = "0.1.30" 1312 | source = "registry+https://github.com/rust-lang/crates.io-index" 1313 | checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" 1314 | dependencies = [ 1315 | "once_cell", 1316 | ] 1317 | 1318 | [[package]] 1319 | name = "try-lock" 1320 | version = "0.2.4" 1321 | source = "registry+https://github.com/rust-lang/crates.io-index" 1322 | checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" 1323 | 1324 | [[package]] 1325 | name = "unicase" 1326 | version = "2.6.0" 1327 | source = "registry+https://github.com/rust-lang/crates.io-index" 1328 | checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" 1329 | dependencies = [ 1330 | "version_check", 1331 | ] 1332 | 1333 | [[package]] 1334 | name = "unicode-ident" 1335 | version = "1.0.8" 1336 | source = "registry+https://github.com/rust-lang/crates.io-index" 1337 | checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" 1338 | 1339 | [[package]] 1340 | name = "unicode-width" 1341 | version = "0.1.10" 1342 | source = "registry+https://github.com/rust-lang/crates.io-index" 1343 | checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" 1344 | 1345 | [[package]] 1346 | name = "unicode-xid" 1347 | version = "0.2.4" 1348 | source = "registry+https://github.com/rust-lang/crates.io-index" 1349 | checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" 1350 | 1351 | [[package]] 1352 | name = "version_check" 1353 | version = "0.9.4" 1354 | source = "registry+https://github.com/rust-lang/crates.io-index" 1355 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 1356 | 1357 | [[package]] 1358 | name = "want" 1359 | version = "0.3.0" 1360 | source = "registry+https://github.com/rust-lang/crates.io-index" 1361 | checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" 1362 | dependencies = [ 1363 | "log", 1364 | "try-lock", 1365 | ] 1366 | 1367 | [[package]] 1368 | name = "wasi" 1369 | version = "0.11.0+wasi-snapshot-preview1" 1370 | source = "registry+https://github.com/rust-lang/crates.io-index" 1371 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1372 | 1373 | [[package]] 1374 | name = "wasm-bindgen" 1375 | version = "0.2.84" 1376 | source = "registry+https://github.com/rust-lang/crates.io-index" 1377 | checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" 1378 | dependencies = [ 1379 | "cfg-if", 1380 | "wasm-bindgen-macro", 1381 | ] 1382 | 1383 | [[package]] 1384 | name = "wasm-bindgen-backend" 1385 | version = "0.2.84" 1386 | source = "registry+https://github.com/rust-lang/crates.io-index" 1387 | checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" 1388 | dependencies = [ 1389 | "bumpalo", 1390 | "log", 1391 | "once_cell", 1392 | "proc-macro2", 1393 | "quote", 1394 | "syn 1.0.109", 1395 | "wasm-bindgen-shared", 1396 | ] 1397 | 1398 | [[package]] 1399 | name = "wasm-bindgen-futures" 1400 | version = "0.4.34" 1401 | source = "registry+https://github.com/rust-lang/crates.io-index" 1402 | checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" 1403 | dependencies = [ 1404 | "cfg-if", 1405 | "js-sys", 1406 | "wasm-bindgen", 1407 | "web-sys", 1408 | ] 1409 | 1410 | [[package]] 1411 | name = "wasm-bindgen-macro" 1412 | version = "0.2.84" 1413 | source = "registry+https://github.com/rust-lang/crates.io-index" 1414 | checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" 1415 | dependencies = [ 1416 | "quote", 1417 | "wasm-bindgen-macro-support", 1418 | ] 1419 | 1420 | [[package]] 1421 | name = "wasm-bindgen-macro-support" 1422 | version = "0.2.84" 1423 | source = "registry+https://github.com/rust-lang/crates.io-index" 1424 | checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" 1425 | dependencies = [ 1426 | "proc-macro2", 1427 | "quote", 1428 | "syn 1.0.109", 1429 | "wasm-bindgen-backend", 1430 | "wasm-bindgen-shared", 1431 | ] 1432 | 1433 | [[package]] 1434 | name = "wasm-bindgen-shared" 1435 | version = "0.2.84" 1436 | source = "registry+https://github.com/rust-lang/crates.io-index" 1437 | checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" 1438 | 1439 | [[package]] 1440 | name = "web-sys" 1441 | version = "0.3.61" 1442 | source = "registry+https://github.com/rust-lang/crates.io-index" 1443 | checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" 1444 | dependencies = [ 1445 | "js-sys", 1446 | "wasm-bindgen", 1447 | ] 1448 | 1449 | [[package]] 1450 | name = "wgpu" 1451 | version = "0.16.0" 1452 | source = "registry+https://github.com/rust-lang/crates.io-index" 1453 | checksum = "13edd72c7b08615b7179dd7e778ee3f0bdc870ef2de9019844ff2cceeee80b11" 1454 | dependencies = [ 1455 | "arrayvec", 1456 | "cfg-if", 1457 | "js-sys", 1458 | "log", 1459 | "naga", 1460 | "parking_lot", 1461 | "profiling", 1462 | "raw-window-handle", 1463 | "smallvec", 1464 | "static_assertions", 1465 | "wasm-bindgen", 1466 | "wasm-bindgen-futures", 1467 | "web-sys", 1468 | "wgpu-core", 1469 | "wgpu-hal", 1470 | "wgpu-types", 1471 | ] 1472 | 1473 | [[package]] 1474 | name = "wgpu-core" 1475 | version = "0.16.0" 1476 | source = "registry+https://github.com/rust-lang/crates.io-index" 1477 | checksum = "625bea30a0ba50d88025f95c80211d1a85c86901423647fb74f397f614abbd9a" 1478 | dependencies = [ 1479 | "arrayvec", 1480 | "bit-vec", 1481 | "bitflags 2.1.0", 1482 | "codespan-reporting", 1483 | "log", 1484 | "naga", 1485 | "parking_lot", 1486 | "profiling", 1487 | "raw-window-handle", 1488 | "rustc-hash", 1489 | "smallvec", 1490 | "thiserror", 1491 | "web-sys", 1492 | "wgpu-hal", 1493 | "wgpu-types", 1494 | ] 1495 | 1496 | [[package]] 1497 | name = "wgpu-hal" 1498 | version = "0.16.0" 1499 | source = "registry+https://github.com/rust-lang/crates.io-index" 1500 | checksum = "41af2ea7d87bd41ad0a37146252d5f7c26490209f47f544b2ee3b3ff34c7732e" 1501 | dependencies = [ 1502 | "android_system_properties", 1503 | "arrayvec", 1504 | "ash", 1505 | "bit-set", 1506 | "bitflags 2.1.0", 1507 | "block", 1508 | "core-graphics-types", 1509 | "d3d12", 1510 | "foreign-types", 1511 | "glow", 1512 | "gpu-alloc", 1513 | "gpu-allocator", 1514 | "gpu-descriptor", 1515 | "hassle-rs", 1516 | "js-sys", 1517 | "khronos-egl", 1518 | "libc", 1519 | "libloading 0.8.0", 1520 | "log", 1521 | "metal", 1522 | "naga", 1523 | "objc", 1524 | "parking_lot", 1525 | "profiling", 1526 | "range-alloc", 1527 | "raw-window-handle", 1528 | "renderdoc-sys", 1529 | "rustc-hash", 1530 | "smallvec", 1531 | "thiserror", 1532 | "wasm-bindgen", 1533 | "web-sys", 1534 | "wgpu-types", 1535 | "winapi", 1536 | ] 1537 | 1538 | [[package]] 1539 | name = "wgpu-types" 1540 | version = "0.16.0" 1541 | source = "registry+https://github.com/rust-lang/crates.io-index" 1542 | checksum = "5bd33a976130f03dcdcd39b3810c0c3fc05daf86f0aaf867db14bfb7c4a9a32b" 1543 | dependencies = [ 1544 | "bitflags 2.1.0", 1545 | "js-sys", 1546 | "web-sys", 1547 | ] 1548 | 1549 | [[package]] 1550 | name = "widestring" 1551 | version = "1.0.2" 1552 | source = "registry+https://github.com/rust-lang/crates.io-index" 1553 | checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" 1554 | 1555 | [[package]] 1556 | name = "winapi" 1557 | version = "0.3.9" 1558 | source = "registry+https://github.com/rust-lang/crates.io-index" 1559 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1560 | dependencies = [ 1561 | "winapi-i686-pc-windows-gnu", 1562 | "winapi-x86_64-pc-windows-gnu", 1563 | ] 1564 | 1565 | [[package]] 1566 | name = "winapi-i686-pc-windows-gnu" 1567 | version = "0.4.0" 1568 | source = "registry+https://github.com/rust-lang/crates.io-index" 1569 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1570 | 1571 | [[package]] 1572 | name = "winapi-util" 1573 | version = "0.1.5" 1574 | source = "registry+https://github.com/rust-lang/crates.io-index" 1575 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 1576 | dependencies = [ 1577 | "winapi", 1578 | ] 1579 | 1580 | [[package]] 1581 | name = "winapi-x86_64-pc-windows-gnu" 1582 | version = "0.4.0" 1583 | source = "registry+https://github.com/rust-lang/crates.io-index" 1584 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1585 | 1586 | [[package]] 1587 | name = "windows" 1588 | version = "0.44.0" 1589 | source = "registry+https://github.com/rust-lang/crates.io-index" 1590 | checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b" 1591 | dependencies = [ 1592 | "windows-targets 0.42.2", 1593 | ] 1594 | 1595 | [[package]] 1596 | name = "windows-sys" 1597 | version = "0.45.0" 1598 | source = "registry+https://github.com/rust-lang/crates.io-index" 1599 | checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" 1600 | dependencies = [ 1601 | "windows-targets 0.42.2", 1602 | ] 1603 | 1604 | [[package]] 1605 | name = "windows-sys" 1606 | version = "0.48.0" 1607 | source = "registry+https://github.com/rust-lang/crates.io-index" 1608 | checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 1609 | dependencies = [ 1610 | "windows-targets 0.48.0", 1611 | ] 1612 | 1613 | [[package]] 1614 | name = "windows-targets" 1615 | version = "0.42.2" 1616 | source = "registry+https://github.com/rust-lang/crates.io-index" 1617 | checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" 1618 | dependencies = [ 1619 | "windows_aarch64_gnullvm 0.42.2", 1620 | "windows_aarch64_msvc 0.42.2", 1621 | "windows_i686_gnu 0.42.2", 1622 | "windows_i686_msvc 0.42.2", 1623 | "windows_x86_64_gnu 0.42.2", 1624 | "windows_x86_64_gnullvm 0.42.2", 1625 | "windows_x86_64_msvc 0.42.2", 1626 | ] 1627 | 1628 | [[package]] 1629 | name = "windows-targets" 1630 | version = "0.48.0" 1631 | source = "registry+https://github.com/rust-lang/crates.io-index" 1632 | checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" 1633 | dependencies = [ 1634 | "windows_aarch64_gnullvm 0.48.0", 1635 | "windows_aarch64_msvc 0.48.0", 1636 | "windows_i686_gnu 0.48.0", 1637 | "windows_i686_msvc 0.48.0", 1638 | "windows_x86_64_gnu 0.48.0", 1639 | "windows_x86_64_gnullvm 0.48.0", 1640 | "windows_x86_64_msvc 0.48.0", 1641 | ] 1642 | 1643 | [[package]] 1644 | name = "windows_aarch64_gnullvm" 1645 | version = "0.42.2" 1646 | source = "registry+https://github.com/rust-lang/crates.io-index" 1647 | checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" 1648 | 1649 | [[package]] 1650 | name = "windows_aarch64_gnullvm" 1651 | version = "0.48.0" 1652 | source = "registry+https://github.com/rust-lang/crates.io-index" 1653 | checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" 1654 | 1655 | [[package]] 1656 | name = "windows_aarch64_msvc" 1657 | version = "0.42.2" 1658 | source = "registry+https://github.com/rust-lang/crates.io-index" 1659 | checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" 1660 | 1661 | [[package]] 1662 | name = "windows_aarch64_msvc" 1663 | version = "0.48.0" 1664 | source = "registry+https://github.com/rust-lang/crates.io-index" 1665 | checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" 1666 | 1667 | [[package]] 1668 | name = "windows_i686_gnu" 1669 | version = "0.42.2" 1670 | source = "registry+https://github.com/rust-lang/crates.io-index" 1671 | checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" 1672 | 1673 | [[package]] 1674 | name = "windows_i686_gnu" 1675 | version = "0.48.0" 1676 | source = "registry+https://github.com/rust-lang/crates.io-index" 1677 | checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" 1678 | 1679 | [[package]] 1680 | name = "windows_i686_msvc" 1681 | version = "0.42.2" 1682 | source = "registry+https://github.com/rust-lang/crates.io-index" 1683 | checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" 1684 | 1685 | [[package]] 1686 | name = "windows_i686_msvc" 1687 | version = "0.48.0" 1688 | source = "registry+https://github.com/rust-lang/crates.io-index" 1689 | checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" 1690 | 1691 | [[package]] 1692 | name = "windows_x86_64_gnu" 1693 | version = "0.42.2" 1694 | source = "registry+https://github.com/rust-lang/crates.io-index" 1695 | checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" 1696 | 1697 | [[package]] 1698 | name = "windows_x86_64_gnu" 1699 | version = "0.48.0" 1700 | source = "registry+https://github.com/rust-lang/crates.io-index" 1701 | checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" 1702 | 1703 | [[package]] 1704 | name = "windows_x86_64_gnullvm" 1705 | version = "0.42.2" 1706 | source = "registry+https://github.com/rust-lang/crates.io-index" 1707 | checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" 1708 | 1709 | [[package]] 1710 | name = "windows_x86_64_gnullvm" 1711 | version = "0.48.0" 1712 | source = "registry+https://github.com/rust-lang/crates.io-index" 1713 | checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" 1714 | 1715 | [[package]] 1716 | name = "windows_x86_64_msvc" 1717 | version = "0.42.2" 1718 | source = "registry+https://github.com/rust-lang/crates.io-index" 1719 | checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" 1720 | 1721 | [[package]] 1722 | name = "windows_x86_64_msvc" 1723 | version = "0.48.0" 1724 | source = "registry+https://github.com/rust-lang/crates.io-index" 1725 | checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" 1726 | --------------------------------------------------------------------------------