This commit is contained in:
mcrcortex
2025-06-16 20:03:12 +10:00
parent 0e98f52580
commit 950e92d7c7
2 changed files with 30 additions and 25 deletions

View File

@@ -64,9 +64,10 @@ public class VoxyRenderSystem {
//Keep the world loaded, NOTE: this is done FIRST, to keep and ensure that even if the rest of loading takes more //Keep the world loaded, NOTE: this is done FIRST, to keep and ensure that even if the rest of loading takes more
// than timeout, we keep the world acquired // than timeout, we keep the world acquired
world.acquireRef(); world.acquireRef();
try {
//wait for opengl to be finished, this should hopefully ensure all memory allocations are free //wait for opengl to be finished, this should hopefully ensure all memory allocations are free
glFinish();glFinish(); glFinish();
glFinish();
//Trigger the shared index buffer loading //Trigger the shared index buffer loading
SharedIndexBuffer.INSTANCE.id(); SharedIndexBuffer.INSTANCE.id();
@@ -93,6 +94,10 @@ public class VoxyRenderSystem {
this.renderDistanceTracker.setRenderDistance(VoxyConfig.CONFIG.sectionRenderDistance); this.renderDistanceTracker.setRenderDistance(VoxyConfig.CONFIG.sectionRenderDistance);
this.chunkBoundRenderer = new ChunkBoundRenderer(); this.chunkBoundRenderer = new ChunkBoundRenderer();
} catch (RuntimeException e) {
world.releaseRef();//If something goes wrong, we must release the world first
throw e;
}
} }
public void setRenderDistance(int renderDistance) { public void setRenderDistance(int renderDistance) {

View File

@@ -56,7 +56,7 @@ public class RenderService<T extends AbstractSectionRenderer<J, Q>, J extends Vi
geometryCapacity = Math.min(geometryCapacity, limit); geometryCapacity = Math.min(geometryCapacity, limit);
} }
//geometryCapacity = 1<<24; //geometryCapacity = 1<<28;
//geometryCapacity = 1<<30;//1GB test //geometryCapacity = 1<<30;//1GB test
return geometryCapacity; return geometryCapacity;
} }