Class UploadBufferManager

java.lang.Object
icyllis.arc3d.engine.UploadBufferManager

public class UploadBufferManager extends Object
Allocates staging buffers to update GPU-only buffer and image sub resources.
  • Field Details

  • Constructor Details

    • UploadBufferManager

      public UploadBufferManager(ResourceProvider resourceProvider)
  • 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

      public long getUploadPointer(long requiredBytes, long requiredAlignment, BufferViewInfo outInfo)
      Allocate a staging buffer for uploading, return mapped pointer.
      Parameters:
      outInfo - buffer bind info
      Returns:
      write-only address, or NULL
    • flush

      public void flush(List<@SharedPtr Resource> outResourceRefs)
      Finalizes all buffers and transfers ownership of them to given list.
      Parameters:
      outResourceRefs - receive ownership of resources