mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-12-24 04:48:21 -06:00
don't count discarded ops
This commit is contained in:
parent
816d2f6077
commit
1b85340d9c
|
@ -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