MCPcopy Create free account
hub / github.com/PerroEngine/Perro / prepare

Method prepare

perro_source/render_stack/perro_graphics/src/water_gpu.rs:567–807  ·  view source on GitHub ↗
(
        &mut self,
        device: &wgpu::Device,
        queue: &wgpu::Queue,
        waters_2d: &[(NodeID, Water2DState)],
        waters_3d: &[(NodeID, Water3DState)],
        ctx: WaterPrepareCo

Source from the content-addressed store, hash-verified

565 max_cells_per_water: 64,
566 max_3d_chunk_vertices: 30,
567 water_count: 0,
568 water_2d_count: 0,
569 render_3d_chunk_count: 0,
570 readback_capacity: 1,
571 readback_pending: None,
572 readback_nodes: Vec::new(),
573 readback_offsets: Vec::new(),
574 readback_samples: Vec::new(),
575 readback_queries: Vec::new(),
576 readback_body_samples: Vec::new(),
577 readback_water_sample_count: 0,
578 readback_interval_seconds: 1.0 / 30.0,
579 readback_accum_seconds: 0.0,
580 readback_water_accum: HashMap::new(),
581 readback_water_interval: HashMap::new(),
582 readback_scheduled_nodes: Vec::new(),
583 readback_copy_encoded: false,
584 staged_waters: Vec::new(),
585 staged_render_chunks: Vec::new(),
586 coastline_cells_scratch: Vec::new(),
587 coastline_cache: HashMap::new(),
588 }
589 }
590
591 pub fn set_scene_depth_view(
592 &mut self,
593 device: &wgpu::Device,
594 scene_depth_view: &wgpu::TextureView,
595 ) {
596 self.depth_bind_group = make_depth_bind_group(
597 device,
598 &self.depth_bgl,
599 scene_depth_view,
600 &self.scene_color_view,
601 "perro_water_depth_bg",
602 );
603 }
604
605 pub fn set_scene_color_size(
606 &mut self,
607 device: &wgpu::Device,
608 scene_depth_view: &wgpu::TextureView,
609 width: u32,
610 height: u32,
611 ) {
612 let size = [width.max(1), height.max(1)];
613 if self.scene_color_size == size {
614 return;
615 }
616 (self.scene_color_texture, self.scene_color_view) =
617 create_scene_color_texture(device, self.scene_color_format, size[0], size[1]);
618 self.scene_color_size = size;
619 self.set_scene_depth_view(device, scene_depth_view);
620 }
621
622 pub fn capture_scene_color(
623 &self,
624 encoder: &mut wgpu::CommandEncoder,

Callers

nothing calls this directly

Calls 15

water_lod_2dFunction · 0.85
water_cell_countFunction · 0.85
raster_coastline_2dFunction · 0.85
water_gpu_2dFunction · 0.85
water_lod_3dFunction · 0.85
raster_coastline_3dFunction · 0.85
water_gpu_3dFunction · 0.85
build_render_chunks_3dFunction · 0.85

Tested by

no test coverage detected