Class VulkanTransientMemory
java.lang.Object
com.mojang.renderpearl.backend.vulkan.VulkanTransientMemory
- All Implemented Interfaces:
TransientMemory, Destroyable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final recordprivate classprivate static final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate static final longprivate static final intprivate @Nullable org.lwjgl.vulkan.VkCommandBufferprivate final VulkanDeviceprivate final VulkanCommandEncoderprivate final intprivate final intprivate final TransientBlockAllocator<VulkanTransientMemory.VulkanAllocation> private final TransientBlockAllocator<VulkanTransientMemory.TransferPair> private static final longprivate static final longprivate final int[]private 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) allocateGpuMappedVulkanBlock(long size) allocateStaging(long size, long alignment, int usage, long minimumAllocation, long elementSize) allocateVulkanBlock(long size, boolean staging) voidvoiddestroy()voidprivate voidprivate 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 voidupload(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
-
expectedCpuMemoryHeap
private final int expectedCpuMemoryHeap -
expectedGpuMemoryHeap
private final int expectedGpuMemoryHeap -
memoryTypeToHeapMap
private final int[] memoryTypeToHeapMap -
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
-
allocateVulkanBlock
-
queueFreeVulkanBlock
-
freeVulkanBlock
-
allocateGpuMappedVulkanBlock
-
freeGpuMappedVulkanBlock
-
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)
-