Class UberGpuBuffer<T>
java.lang.Object
com.mojang.blaze3d.vertex.UberGpuBuffer<T>
- All Implemented Interfaces:
AutoCloseable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final recordstatic classstatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate final Map<T, TlsfAllocator.Allocation> private final intprivate final intprivate final Stringprivate final List<com.mojang.datafixers.util.Pair<TlsfAllocator, UberGpuBuffer.UberGpuBufferHeap>> private final it.unimi.dsi.fastutil.objects.ObjectOpenHashSet<T> private final it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap<T, UberGpuBuffer.StagedAllocationEntry<? extends T>> private final StagingBuffer -
Constructor Summary
ConstructorsConstructorDescriptionUberGpuBuffer(String name, int bufferUsage, int heapSize, int alignSize, StagingBuffer stagingBuffer) -
Method Summary
Modifier and TypeMethodDescription<U extends T>
booleanaddAllocation(U allocationKey, UberGpuBuffer.UploadCallback<U> callback, ByteBuffer buffer) voidclose()private voidfreeAllocation(T allocationKey) getAllocation(T allocationKey) getGpuBuffer(TlsfAllocator.Allocation allocation) voidvoidremoveAllocation(T allocationKey) private static <T, U extends T>
voidrunCallbackUnchecked(T key, UberGpuBuffer.StagedAllocationEntry<U> value) booleanuploadStagedAllocations(GpuDevice gpuDevice, StagingBuffer.Uploader uploader)
-
Field Details
-
bufferUsage
private final int bufferUsage -
heapSize
private final int heapSize -
alignSize
private final int alignSize -
name
-
nodes
private final List<com.mojang.datafixers.util.Pair<TlsfAllocator, UberGpuBuffer.UberGpuBufferHeap>> nodes -
stagingBuffer
-
stagedAllocations
private final it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap<T, UberGpuBuffer.StagedAllocationEntry<? extends T>> stagedAllocations -
skippedStagedAllocations
-
allocationMap
-
-
Constructor Details
-
UberGpuBuffer
public UberGpuBuffer(String name, int bufferUsage, int heapSize, int alignSize, StagingBuffer stagingBuffer)
-
-
Method Details
-
addAllocation
public <U extends T> boolean addAllocation(U allocationKey, UberGpuBuffer.UploadCallback<U> callback, ByteBuffer buffer) -
uploadStagedAllocations
-
runCallbackUnchecked
private static <T, U extends T> void runCallbackUnchecked(T key, UberGpuBuffer.StagedAllocationEntry<U> value) -
getAllocation
-
removeAllocation
-
freeAllocation
-
getGpuBuffer
-
printStatistics
public void printStatistics() -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-