Skip to content

Commit 72b3ade

Browse files
committed
logging + shrink upsize range, resulting in ~20% memory storage efficiency
1 parent 98fc9e1 commit 72b3ade

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/main/java/me/cortex/voxy/client/core/rendering/hierachical/AsyncNodeManager.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ public void tick(GlBuffer nodeBuffer, NodeCleaner cleaner) {//TODO: dont pass no
513513
{//Update basic geometry data
514514
var store = (BasicSectionGeometryData)this.geometryData;
515515

516+
this.currentGeometrySectionCount = results.geometrySectionCount;
516517
store.setSectionCount(results.geometrySectionCount);
517518

518519
var upload = results.geometryUpload;
@@ -589,6 +590,8 @@ public void setTLNAddRemoveCallbacks(IntConsumer add, IntConsumer remove) {
589590
this.tlnRemoveCallback = remove;
590591
}
591592

593+
private int currentGeometrySectionCount = 0;
594+
592595
private int currentMaxNodeId = 0;
593596
public int getCurrentMaxNodeId() {
594597
return this.currentMaxNodeId;
@@ -756,7 +759,7 @@ public void stop() {
756759
}
757760

758761
public void addDebug(List<String> debug) {
759-
debug.add("UC/GC: " + (this.getUsedGeometryCapacity()/(1<<20))+"/"+(this.getGeometryCapacity()/(1<<20)));
762+
debug.add("UC/GC,#N: " + (this.getUsedGeometryCapacity()/(1<<20))+"/"+(this.getGeometryCapacity()/(1<<20)) + "," + (this.currentGeometrySectionCount));
760763
//debug.add("GUQ/NRC: " + this.geometryUpdateQueue.size()+"/"+this.removeBatchQueue.size());
761764
}
762765

src/main/java/me/cortex/voxy/client/core/rendering/section/geometry/BasicAsyncGeometryManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ public void removeSection(int id) {
108108
private SectionMeta createMeta(BuiltSection section) {
109109
if ((section.geometryBuffer.size%GEOMETRY_ELEMENT_SIZE)!=0) throw new IllegalStateException();
110110
int size = (int) (section.geometryBuffer.size/GEOMETRY_ELEMENT_SIZE);
111-
//clamp size upwards
112-
int upsized = (size+1023)&~1023;
111+
//clamp size upwards to ranges of 127
112+
int upsized = (size+127)&~127;
113113
//Address
114114
int addr = (int)this.allocationHeap.alloc(upsized);
115115
if (addr == -1) {

0 commit comments

Comments
 (0)