mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-16 02:45:13 -04:00
world renderer: work on meshing queue every frame
This should fix chunks only being prepared when changing the frustum and "wrongly" failing tests
This commit is contained in:
parent
d4f065b356
commit
5713f2dcaf
@ -203,6 +203,9 @@ class WorldRenderer(
|
||||
lock.unlock()
|
||||
}
|
||||
|
||||
override fun prePrepareDraw() {
|
||||
meshingQueue.work()
|
||||
}
|
||||
|
||||
override fun postPrepareDraw() {
|
||||
if (clearVisibleNextFrame) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Minosoft
|
||||
* Copyright (C) 2020-2022 Moritz Zwerger
|
||||
* Copyright (C) 2020-2023 Moritz Zwerger
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
@ -21,7 +21,7 @@ import de.bixilon.minosoft.gui.rendering.world.WorldRenderer
|
||||
|
||||
class MeshPrepareTaskManager(
|
||||
private val renderer: WorldRenderer,
|
||||
val max: Int = maxOf(DefaultThreadPool.threadCount - 2, 1),
|
||||
val max: Int = minOf(maxOf(Runtime.getRuntime().availableProcessors() - 1, 1), DefaultThreadPool.threadCount - 1),
|
||||
) {
|
||||
private val tasks: MutableSet<MeshPrepareTask> = mutableSetOf() // current running section preparing tasks
|
||||
private val lock = SimpleLock()
|
||||
|
Loading…
x
Reference in New Issue
Block a user