Remove unnecessary reupload of entire brickmap buffers
This commit is contained in:
parent
4eaf55a61c
commit
ed46752c92
|
@ -108,20 +108,6 @@ impl BrickmapManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update_buffer(&self, context: &render::Context) {
|
|
||||||
let queue = &context.queue;
|
|
||||||
queue.write_buffer(
|
|
||||||
&self.brickmap_buffer,
|
|
||||||
0,
|
|
||||||
bytemuck::cast_slice(&self.brickmap_cache),
|
|
||||||
);
|
|
||||||
queue.write_buffer(
|
|
||||||
&self.brickgrid_buffer,
|
|
||||||
0,
|
|
||||||
bytemuck::cast_slice(&self.brickgrid),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn get_brickgrid_buffer(&self) -> &wgpu::Buffer {
|
pub fn get_brickgrid_buffer(&self) -> &wgpu::Buffer {
|
||||||
&self.brickgrid_buffer
|
&self.brickgrid_buffer
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,6 @@ impl VoxelRenderer {
|
||||||
|
|
||||||
log::info!("Creating brickmap manager...");
|
log::info!("Creating brickmap manager...");
|
||||||
let brickmap_manager = super::brickmap::BrickmapManager::new(context);
|
let brickmap_manager = super::brickmap::BrickmapManager::new(context);
|
||||||
brickmap_manager.update_buffer(context);
|
|
||||||
|
|
||||||
log::info!("Creating compute pipeline...");
|
log::info!("Creating compute pipeline...");
|
||||||
let cs_descriptor = wgpu::include_wgsl!("../../assets/shaders/voxel_volume.wgsl");
|
let cs_descriptor = wgpu::include_wgsl!("../../assets/shaders/voxel_volume.wgsl");
|
||||||
|
|
Loading…
Reference in New Issue