aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2022-06-07 01:18:08 +0200
committermakamys <makamys@outlook.com>2022-06-07 01:24:28 +0200
commit8269e36a650e844668dfbafbd1478f5ee8dbde33 (patch)
tree01282abfeab959b9394c584e3929a9920a5a7da5 /src
parent3dd5e5cb5981271c1c0a7352076a57603e9d43a7 (diff)
downloadNeodymium-8269e36a650e844668dfbafbd1478f5ee8dbde33.tar.gz
Neodymium-8269e36a650e844668dfbafbd1478f5ee8dbde33.tar.bz2
Neodymium-8269e36a650e844668dfbafbd1478f5ee8dbde33.zip
Don't allocate memory if it's full
Diffstat (limited to 'src')
-rw-r--r--src/main/java/makamys/lodmod/renderer/GPUMemoryManager.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/makamys/lodmod/renderer/GPUMemoryManager.java b/src/main/java/makamys/lodmod/renderer/GPUMemoryManager.java
index a04adb2..eba0a8f 100644
--- a/src/main/java/makamys/lodmod/renderer/GPUMemoryManager.java
+++ b/src/main/java/makamys/lodmod/renderer/GPUMemoryManager.java
@@ -82,6 +82,11 @@ public class GPUMemoryManager {
if(mesh == null) {
return;
}
+
+ if(nextMeshOffset + mesh.buffer.limit() >= BUFFER_SIZE) {
+ return;
+ }
+
if(mesh.gpuStatus == GPUStatus.UNSENT) {
mesh.prepareBuffer();