mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Remove some bottlenecks.
This commit is contained in:
parent
0b14ca2f3a
commit
59aacc3fd8
@ -1778,7 +1778,7 @@ impl Client {
|
||||
if self.state.terrain().get_key(*key).is_none() {
|
||||
if !skip_mode && !self.pending_chunks.contains_key(key) {
|
||||
const TOTAL_PENDING_CHUNKS_LIMIT: usize = 1024;
|
||||
const CURRENT_TICK_PENDING_CHUNKS_LIMIT: usize = 8;
|
||||
const CURRENT_TICK_PENDING_CHUNKS_LIMIT: usize = 8 * 4;
|
||||
if self.pending_chunks.len() < TOTAL_PENDING_CHUNKS_LIMIT
|
||||
&& current_tick_send_chunk_requests
|
||||
< CURRENT_TICK_PENDING_CHUNKS_LIMIT
|
||||
|
@ -47,11 +47,11 @@ impl<'a> System<'a> for Sys {
|
||||
chunk_sender,
|
||||
): Self::SystemData,
|
||||
) {
|
||||
// Only operate twice per second
|
||||
/* // Only operate twice per second
|
||||
//TODO: move out of this system and now even spawn this.
|
||||
if tick.0.rem_euclid(15) != 0 {
|
||||
return;
|
||||
}
|
||||
} */
|
||||
|
||||
struct Metadata {
|
||||
recipients: Vec<Entity>,
|
||||
|
@ -210,7 +210,7 @@ fn calc_light<V: RectRasterableVol<Vox = Block> + ReadVol + Debug>(
|
||||
drop(light_map); */
|
||||
|
||||
move |wpos| {
|
||||
1.0
|
||||
if is_sunlight { 1.0 } else { 0.0 }
|
||||
/* let pos = wpos - min_bounds.min;
|
||||
let l = light_map2
|
||||
.get(lm_idx2(pos.x, pos.y, pos.z))
|
||||
|
@ -970,7 +970,7 @@ impl<V: RectRasterableVol> Terrain<V> {
|
||||
})?))
|
||||
})
|
||||
{
|
||||
if self.mesh_todos_active.load(Ordering::Relaxed) > meshing_cores {
|
||||
if self.mesh_todos_active.load(Ordering::Relaxed) > meshing_cores * 8 {
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1056,7 +1056,7 @@ impl<V: RectRasterableVol> Terrain<V> {
|
||||
// store it. Vary the rate at which we pull items out to correlate with the
|
||||
// framerate, preventing tail latency.
|
||||
span!(guard, "Get/upload meshed chunk");
|
||||
const CHUNKS_PER_SECOND: f32 = 240.0;
|
||||
const CHUNKS_PER_SECOND: f32 = 240.0 * 8.0;
|
||||
let recv_count =
|
||||
scene_data.state.get_delta_time() * CHUNKS_PER_SECOND + self.mesh_recv_overflow;
|
||||
self.mesh_recv_overflow = recv_count.fract();
|
||||
|
Loading…
Reference in New Issue
Block a user