mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-11-22 06:48:43 -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>>,
|
mut meshes: NonSendSync<UniqueViewMut<ChunkMeshStorage>>,
|
||||||
renderer: NonSendSync<UniqueView<Renderer>>
|
renderer: NonSendSync<UniqueView<Renderer>>
|
||||||
) {
|
) {
|
||||||
for _ in 0..MAX_CHUNK_OPS {
|
let mut ops: usize = 0;
|
||||||
if let Some(res) = task_manager.receive() {
|
while let Some(res) = task_manager.receive() {
|
||||||
match res {
|
match res {
|
||||||
ChunkTaskResponse::LoadedChunk { position, chunk_data } => {
|
ChunkTaskResponse::LoadedChunk { position, chunk_data } => {
|
||||||
//check if chunk exists
|
//check if chunk exists
|
||||||
|
@ -193,6 +193,9 @@ fn process_completed_tasks(
|
||||||
|
|
||||||
//update chunk state
|
//update chunk state
|
||||||
chunk.current_state = CurrentChunkState::Loaded;
|
chunk.current_state = CurrentChunkState::Loaded;
|
||||||
|
|
||||||
|
//increase ops counter
|
||||||
|
ops += 1;
|
||||||
},
|
},
|
||||||
ChunkTaskResponse::GeneratedMesh { position, vertices, indexes } => {
|
ChunkTaskResponse::GeneratedMesh { position, vertices, indexes } => {
|
||||||
//check if chunk exists
|
//check if chunk exists
|
||||||
|
@ -223,8 +226,13 @@ fn process_completed_tasks(
|
||||||
|
|
||||||
//update chunk state
|
//update chunk state
|
||||||
chunk.current_state = CurrentChunkState::Rendered;
|
chunk.current_state = CurrentChunkState::Rendered;
|
||||||
}
|
|
||||||
}
|
//increase ops counter
|
||||||
|
ops += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ops >= MAX_CHUNK_OPS {
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue