Class VulkanTransientMemory
java.lang.Object
com.mojang.blaze3d.vulkan.VulkanTransientMemory
- All Implemented Interfaces:
TransientMemory, Destroyable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classprivate static final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate static final longprivate static final intprivate @Nullable VkCommandBufferprivate final TransientBlockAllocator<Long> private final VulkanDeviceprivate final VulkanCommandEncoderprivate final TransientBlockAllocator<VulkanTransientMemory.VulkanAllocation> private final TransientBlockAllocator<it.unimi.dsi.fastutil.Pair<VulkanTransientMemory.VulkanAllocation, VulkanTransientMemory.VulkanAllocation>> private static final longprivate static final longprivate final TransientBlockAllocator<VulkanTransientMemory.VulkanAllocation> private longprivate final boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallocateCpu(long size, long alignment, long minimumAllocation, long elementSize) allocateGpu(long size, long alignment, int usage, long minimumAllocation, long elementSize) allocateGpuMapped(long size, long alignment, int usage, long minimumAllocation, long elementSize) private it.unimi.dsi.fastutil.Pair<VulkanTransientMemory.VulkanAllocation, VulkanTransientMemory.VulkanAllocation> allocateGpuMappedVulkanBlock(long size) allocateStaging(long size, long alignment, int usage, long minimumAllocation, long elementSize) allocateVulkanBlock(long size, boolean staging) voidvoiddestroy()voidprivate voidfreeGpuMappedVulkanBlock(it.unimi.dsi.fastutil.Pair<VulkanTransientMemory.VulkanAllocation, VulkanTransientMemory.VulkanAllocation> allocations) private voidmultiUpload(List<ByteBuffer> data, long alignment, int usage, boolean staging) multiUploadGpu(List<ByteBuffer> data, long alignment, int usage) multiUploadStaging(List<ByteBuffer> data, long alignment, int usage) private voidprivate voidrecordGpuMappedCopy(it.unimi.dsi.fastutil.Pair<VulkanTransientMemory.VulkanAllocation, VulkanTransientMemory.VulkanAllocation> block) upload(List<ByteBuffer> data, long alignment, int usage, long minimumAllocation, long elementSize, boolean staging) uploadGpu(List<ByteBuffer> data, long alignment, int usage, long minimumAllocation, long elementSize) uploadStaging(List<ByteBuffer> data, long alignment, int usage, long minimumAllocation, long elementSize) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface TransientMemory
allocateCpu, allocateGpu, allocateGpuMapped, allocateStaging, uploadGpu, uploadGpu, uploadGpu, uploadStaging, uploadStaging, uploadStaging
-
Field Details
-
BLOCK_SIZE
private static final long BLOCK_SIZE- See Also:
-
MAX_CPU_ALIGNMENT
private static final long MAX_CPU_ALIGNMENT- See Also:
-
MAX_GPU_ALIGNMENT
private static final long MAX_GPU_ALIGNMENT -
BUFFER_USAGE_BITS
private static final int BUFFER_USAGE_BITS- See Also:
-
device
-
encoder
-
useDeviceMemoryForMappedGpuStaging
private final boolean useDeviceMemoryForMappedGpuStaging -
cpuBlockAllocator
-
stagingBlockAllocator
-
gpuBlockAllocator
-
gpuMappedBlockAllocator
private final TransientBlockAllocator<it.unimi.dsi.fastutil.Pair<VulkanTransientMemory.VulkanAllocation, VulkanTransientMemory.VulkanAllocation>> gpuMappedBlockAllocator -
submitIndex
private long submitIndex -
anyCommandRecorded
private boolean anyCommandRecorded -
commandBuffer
-
-
Constructor Details
-
VulkanTransientMemory
VulkanTransientMemory(VulkanDevice device, VulkanCommandEncoder encoder)
-
-
Method Details
-
destroy
public void destroy()- Specified by:
destroyin interfaceDestroyable
-
beginSubmit
public void beginSubmit() -
endSubmit
public void endSubmit() -
recordGpuMappedCopy
private void recordGpuMappedCopy(it.unimi.dsi.fastutil.Pair<VulkanTransientMemory.VulkanAllocation, VulkanTransientMemory.VulkanAllocation> block) -
allocateVulkanBlock
-
queueFreeVulkanBlock
-
freeVulkanBlock
-
allocateGpuMappedVulkanBlock
private it.unimi.dsi.fastutil.Pair<VulkanTransientMemory.VulkanAllocation, VulkanTransientMemory.VulkanAllocation> allocateGpuMappedVulkanBlock(long size) -
freeGpuMappedVulkanBlock
private void freeGpuMappedVulkanBlock(it.unimi.dsi.fastutil.Pair<VulkanTransientMemory.VulkanAllocation, VulkanTransientMemory.VulkanAllocation> allocations) -
allocateCpu
- Specified by:
allocateCpuin interfaceTransientMemory
-
allocateStaging
public GpuBufferSlice.MappedView allocateStaging(long size, long alignment, int usage, long minimumAllocation, long elementSize) - Specified by:
allocateStagingin interfaceTransientMemory
-
allocateGpu
public GpuBufferSlice allocateGpu(long size, long alignment, int usage, long minimumAllocation, long elementSize) - Specified by:
allocateGpuin interfaceTransientMemory
-
allocateGpuMapped
public GpuBufferSlice.MappedView allocateGpuMapped(long size, long alignment, int usage, long minimumAllocation, long elementSize) - Specified by:
allocateGpuMappedin interfaceTransientMemory
-
uploadStaging
public GpuBufferSlice uploadStaging(List<ByteBuffer> data, long alignment, int usage, long minimumAllocation, long elementSize) - Specified by:
uploadStagingin interfaceTransientMemory
-
uploadGpu
public GpuBufferSlice uploadGpu(List<ByteBuffer> data, long alignment, int usage, long minimumAllocation, long elementSize) - Specified by:
uploadGpuin interfaceTransientMemory
-
upload
public GpuBufferSlice upload(List<ByteBuffer> data, long alignment, int usage, long minimumAllocation, long elementSize, boolean staging) -
multiUploadStaging
- Specified by:
multiUploadStagingin interfaceTransientMemory
-
multiUploadGpu
- Specified by:
multiUploadGpuin interfaceTransientMemory
-
multiUpload
public List<GpuBufferSlice> multiUpload(List<ByteBuffer> data, long alignment, int usage, boolean staging)
-