Package icyllis.arc3d.engine
Class UploadBufferManager
java.lang.Object
icyllis.arc3d.engine.UploadBufferManager
Allocates staging buffers to update GPU-only buffer and image sub resources.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
flush
(List<@SharedPtr Resource> outResourceRefs) Finalizes all buffers and transfers ownership of them to given list.static long
getLargeBufferSize
(long minBytes) Return an appropriate size for dedicated upload buffer to improve resource reuse.long
getUploadPointer
(long requiredBytes, long requiredAlignment, BufferViewInfo outInfo) Allocate a staging buffer for uploading, return mapped pointer.
-
Field Details
-
SMALL_BUFFER_SIZE
public static final long SMALL_BUFFER_SIZE- See Also:
-
-
Constructor Details
-
UploadBufferManager
-
-
Method Details
-
getLargeBufferSize
public static long getLargeBufferSize(long minBytes) Return an appropriate size for dedicated upload buffer to improve resource reuse. Values invalid input: '<'= 4 MB will pop up to the next power of 2. Values invalid input: '<'= 64 MB will go up half the floor power of 2. Values > 64 MB will go up to the next multiple of 16 MB. -
getUploadPointer
Allocate a staging buffer for uploading, return mapped pointer.- Parameters:
outInfo
- buffer bind info- Returns:
- write-only address, or NULL
-
flush
Finalizes all buffers and transfers ownership of them to given list.- Parameters:
outResourceRefs
- receive ownership of resources
-