(&mut self, device: &wgpu::Device, queue: &wgpu::Queue, frame: Prepare2D<'_>)
| 374 | size: (sprite_instance_capacity * std::mem::size_of::<SpriteInstanceGpu>()) as u64, |
| 375 | usage: wgpu::BufferUsages::VERTEX |
| 376 | | wgpu::BufferUsages::COPY_DST |
| 377 | | wgpu::BufferUsages::COPY_SRC, |
| 378 | mapped_at_creation: false, |
| 379 | }); |
| 380 | |
| 381 | let point_light_instance_capacity = 64usize; |
| 382 | let point_light_instance_buffer = device.create_buffer(&wgpu::BufferDescriptor { |
| 383 | label: Some("perro_point_light_2d_instances"), |
| 384 | size: (point_light_instance_capacity * std::mem::size_of::<Light2DGpu>()) as u64, |
| 385 | usage: wgpu::BufferUsages::VERTEX |
| 386 | | wgpu::BufferUsages::COPY_DST |
| 387 | | wgpu::BufferUsages::COPY_SRC, |
| 388 | mapped_at_creation: false, |
| 389 | }); |
| 390 | let shadow_caster_capacity = 1usize; |
| 391 | let shadow_caster_buffer = device.create_buffer(&wgpu::BufferDescriptor { |
| 392 | label: Some("perro_shadow_caster_2d_instances"), |
| 393 | size: (shadow_caster_capacity * std::mem::size_of::<ShadowCaster2DGpu>()) as u64, |
| 394 | usage: wgpu::BufferUsages::STORAGE |
| 395 | | wgpu::BufferUsages::COPY_DST |
| 396 | | wgpu::BufferUsages::COPY_SRC, |
| 397 | mapped_at_creation: false, |
| 398 | }); |
| 399 | let shadow_caster_bind_group = device.create_bind_group(&wgpu::BindGroupDescriptor { |
| 400 | label: Some("perro_shadow_caster_2d_bg"), |
| 401 | layout: &shadow_caster_bgl, |
| 402 | entries: &[wgpu::BindGroupEntry { |
| 403 | binding: 0, |
| 404 | resource: shadow_caster_buffer.as_entire_binding(), |
| 405 | }], |
| 406 | }); |
| 407 | |
| 408 | Self { |
| 409 | camera_bgl, |
| 410 | texture_bgl, |
| 411 | rect_pipeline, |
| 412 | sprite_pipeline, |
| 413 | point_light_pipeline, |
| 414 | shadow_caster_bgl, |
| 415 | shadow_caster_buffer, |
| 416 | shadow_caster_capacity, |
| 417 | shadow_caster_bind_group, |
| 418 | rect_vertex_buffer, |
| 419 | rect_instance_buffer, |
| 420 | rect_instance_capacity, |
| 421 | sprite_vertex_buffer, |
| 422 | sprite_instance_buffer, |
| 423 | sprite_instance_capacity, |
| 424 | point_light_instance_buffer, |
| 425 | point_light_instance_capacity, |
| 426 | camera_buffer, |
| 427 | camera_bind_group, |
| 428 | sprite_instances: Vec::new(), |
| 429 | sprite_staged: Vec::new(), |
| 430 | sprite_staged_sort_scratch: Vec::new(), |
| 431 | sprite_batch_candidates: Vec::new(), |
| 432 | point_light_instances: Vec::new(), |
| 433 | shadow_caster_instances: Vec::new(), |
nothing calls this directly
no test coverage detected