use of net.fabricmc.indigo.renderer.accessor.AccessBufferBuilder in project fabric by FabricMC.
the class ChunkRenderInfo method getInitializedBuffer.
/**
* Lazily retrieves output buffer for given layer, initializing as needed.
*/
public AccessBufferBuilder getInitializedBuffer(int layerIndex) {
// redundant for first layer, but probably not faster to check
resultFlags[layerIndex] = true;
AccessBufferBuilder result = buffers[layerIndex];
if (result == null) {
BufferBuilder builder = chunkTask.getBufferBuilders().get(layerIndex);
buffers[layerIndex] = (AccessBufferBuilder) builder;
BlockRenderLayer layer = LAYERS[layerIndex];
if (!chunkData.isBufferInitialized(layer)) {
// start buffer
chunkData.markBufferInitialized(layer);
((AccessChunkRenderer) chunkRenderer).fabric_beginBufferBuilding(builder, chunkOrigin);
}
result = (AccessBufferBuilder) builder;
}
return result;
}
Aggregations