Aggressively optimize multidraw command emission #32
No files matched your search
+1
-1
@@ -22,7 +22,7 @@ public class SectionRenderDataStorage {
|
||||
|
||||
public SectionRenderDataStorage(ChunkPrimitiveType primitiveType, boolean sorted) {
|
||||
this.storageStrategy = sorted ? SectionRenderDataUnsafe.Strategy.FULL : SectionRenderDataUnsafe.Strategy.COMPACT;
|
||||
this.pMeshDataArray = this.storageStrategy.allocateHeap(RenderRegion.REGION_SIZE);
|
||||
this.pMeshDataArray = this.storageStrategy.allocateHeap();
|
||||
if (this.pMeshDataArray == 0) {
|
||||
throw new OutOfMemoryError("Failed to allocate mesh data array");
|
||||
}
|
||||
|
||||
+3
-7
@@ -318,8 +318,8 @@ public class SectionRenderDataUnsafe {
|
||||
return heap + this.getHeaderSize();
|
||||
}
|
||||
|
||||
public final long allocateHeap(int count) {
|
||||
long size = this.getHeaderSize() + (count * this.getStride());
|
||||
public final long allocateHeap() {
|
||||
long size = this.getHeaderSize() + (RenderRegion.REGION_SIZE * this.getStride());
|
||||
long pointer = LWJGL.nmemAlignedAlloc(64, size);
|
||||
|
||||
if (pointer != 0) {
|
||||
@@ -333,10 +333,6 @@ public class SectionRenderDataUnsafe {
|
||||
LWJGL.nmemAlignedFree(pointer);
|
||||
}
|
||||
|
||||
public final void clear(long pointer) {
|
||||
LWJGL.memSet(pointer, 0x0, this.getStride());
|
||||
}
|
||||
|
||||
public final long heapPointer(long ptr, int index) {
|
||||
return this.getRowBasePointer(ptr) + (index * this.getStride());
|
||||
}
|
||||
@@ -362,7 +358,7 @@ public class SectionRenderDataUnsafe {
|
||||
*/
|
||||
public final void clearRow(long heap, int index) {
|
||||
this.setSliceMask(heap, index, 0);
|
||||
this.clear(this.heapPointer(heap, index));
|
||||
LWJGL.memSet(this.heapPointer(heap, index), 0x0, this.getStride());
|
||||
}
|
||||
|
||||
private static int vertexCountOf(Map<ModelQuadFacing, VertexRange> ranges, int facing) {
|
||||
|
||||
Reference in new issue
Block a user