use of me.jellysquid.mods.sodium.client.render.chunk.CloneableBufferBuilder in project sodium-fabric by CaffeineMC.
the class ChunkRenderRebuildTask method performBuild.
@Override
public ChunkRenderUploadTask performBuild(VertexBufferCache buffers) {
ChunkMeshInfo meshInfo;
Object2ObjectMap<RenderLayer, BufferUploadData> uploads;
if (this.region == null) {
meshInfo = new ChunkMeshInfo();
meshInfo.occlusionGraph = new ChunkOcclusionData();
meshInfo.occlusionGraph.addOpenEdgeFaces(EnumSet.allOf(Direction.class));
uploads = Object2ObjectMaps.emptyMap();
} else {
meshInfo = this.generateMesh(buffers);
uploads = new Object2ObjectArrayMap<>();
for (RenderLayer layer : meshInfo.presentLayers) {
BufferBuilder builder = buffers.get(layer);
builder.end();
uploads.put(layer, ((CloneableBufferBuilder) builder).copyData());
}
}
return new Result(this.render, meshInfo, uploads);
}
Aggregations