mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-11-21 22:38:41 -06:00
don't count discarded ops
This commit is contained in:
parent
34fa47acbe
commit
df8640718d
|
@ -170,8 +170,8 @@ fn process_completed_tasks(
|
|||
mut meshes: NonSendSync<UniqueViewMut<ChunkMeshStorage>>,
|
||||
renderer: NonSendSync<UniqueView<Renderer>>
|
||||
) {
|
||||
for _ in 0..MAX_CHUNK_OPS {
|
||||
if let Some(res) = task_manager.receive() {
|
||||
let mut ops: usize = 0;
|
||||
while let Some(res) = task_manager.receive() {
|
||||
match res {
|
||||
ChunkTaskResponse::LoadedChunk { position, chunk_data } => {
|
||||
//check if chunk exists
|
||||
|
@ -193,6 +193,9 @@ fn process_completed_tasks(
|
|||
|
||||
//update chunk state
|
||||
chunk.current_state = CurrentChunkState::Loaded;
|
||||
|
||||
//increase ops counter
|
||||
ops += 1;
|
||||
},
|
||||
ChunkTaskResponse::GeneratedMesh { position, vertices, indexes } => {
|
||||
//check if chunk exists
|
||||
|
@ -223,8 +226,13 @@ fn process_completed_tasks(
|
|||
|
||||
//update chunk state
|
||||
chunk.current_state = CurrentChunkState::Rendered;
|
||||
}
|
||||
}
|
||||
|
||||
//increase ops counter
|
||||
ops += 1;
|
||||
}
|
||||
}
|
||||
if ops >= MAX_CHUNK_OPS {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue