aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/makamys')
-rw-r--r--src/main/java/makamys/lodmod/renderer/GPUMemoryManager.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/makamys/lodmod/renderer/GPUMemoryManager.java b/src/main/java/makamys/lodmod/renderer/GPUMemoryManager.java
index 7693b4a..d8c0c27 100644
--- a/src/main/java/makamys/lodmod/renderer/GPUMemoryManager.java
+++ b/src/main/java/makamys/lodmod/renderer/GPUMemoryManager.java
@@ -38,10 +38,11 @@ public class GPUMemoryManager {
long t0 = System.nanoTime();
int moved = 0;
+ int checksLeft = sentMeshes.size();
Mesh startMesh = null;
- while(moved < 5 && !sentMeshes.isEmpty()) {
+ while(moved < 5 && checksLeft-- > 0 && !sentMeshes.isEmpty()) {
if(nextMesh >= sentMeshes.size()) {
nextMesh = 0;
}