aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys/lodmod/renderer
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2021-05-30 16:46:43 +0200
committermakamys <makamys@outlook.com>2021-05-30 17:13:00 +0200
commit0f5e4212aac09eac64a48064a0f44176736a157c (patch)
tree8fc0e07fcc39109b51e8ad456df59b5fb9a9f734 /src/main/java/makamys/lodmod/renderer
parent3b57eaef6eb2c3326c151360d4cc1f54931dda8f (diff)
downloadNeodymium-0f5e4212aac09eac64a48064a0f44176736a157c.tar.gz
Neodymium-0f5e4212aac09eac64a48064a0f44176736a157c.tar.bz2
Neodymium-0f5e4212aac09eac64a48064a0f44176736a157c.zip
better GC print
Diffstat (limited to 'src/main/java/makamys/lodmod/renderer')
-rw-r--r--src/main/java/makamys/lodmod/renderer/LODRenderer.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/makamys/lodmod/renderer/LODRenderer.java b/src/main/java/makamys/lodmod/renderer/LODRenderer.java
index ce74177..fd04dcc 100644
--- a/src/main/java/makamys/lodmod/renderer/LODRenderer.java
+++ b/src/main/java/makamys/lodmod/renderer/LODRenderer.java
@@ -241,9 +241,11 @@ public class LODRenderer {
glBindVertexArray(VAO);
glBindBuffer(GL_ARRAY_BUFFER, VBO);
- int deletedNum = 0;
+ int[] deletedNum = new int[2];
int deletedRAM = 0;
+ long t0 = System.nanoTime();
+
for(int i = 0; i < 2; i++) {
piFirst[i].limit(0);
piCount[i].limit(0);
@@ -269,13 +271,15 @@ public class LODRenderer {
mesh.visible = false;
mesh.pendingGPUDelete = false;
it.remove();
- deletedNum++;
+ deletedNum[i]++;
deletedRAM += mesh.bufferSize();
}
}
}
- System.out.println("Deleted " + deletedNum + " meshes, freeing up " + (deletedRAM / 1024 / 1024) + "MB of VRAM");
+ long t1 = System.nanoTime();
+
+ System.out.println("Deleted " + deletedNum[0] + "+" + deletedNum[1] + " meshes in " + ((t1 - t0) / 1_000_000.0) + " ms, freeing up " + (deletedRAM / 1024 / 1024) + "MB of VRAM");
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindVertexArray(0);