public interface MTLHeap
| Modifier and Type | Method and Description |
|---|---|
long |
cpuCacheMode()
[@property] cpuCacheMode
|
long |
currentAllocatedSize()
[@property] currentAllocatedSize
|
MTLDevice |
device()
[@property] device
|
long |
hazardTrackingMode()
[@property] hazardTrackingMode
|
java.lang.String |
label()
[@property] label
|
long |
maxAvailableSizeWithAlignment(long alignment)
maxAvailableSizeWithAlignment:
|
MTLBuffer |
newBufferWithLengthOptions(long length,
long options)
newBufferWithLength:options:
|
MTLBuffer |
newBufferWithLengthOptionsOffset(long length,
long options,
long offset)
newBufferWithLength:options:offset:
|
MTLTexture |
newTextureWithDescriptor(MTLTextureDescriptor desc)
newTextureWithDescriptor:
|
MTLTexture |
newTextureWithDescriptorOffset(MTLTextureDescriptor descriptor,
long offset)
newTextureWithDescriptor:offset:
|
long |
resourceOptions()
[@property] resourceOptions
|
void |
setLabel(java.lang.String value)
[@property] label
|
long |
setPurgeableState(long state)
setPurgeabilityState:
|
long |
size()
[@property] size
|
long |
storageMode()
[@property] storageMode
|
long |
type()
[@property] type
|
long |
usedSize()
[@property] usedSize
|
long cpuCacheMode()
CPU cache mode for the heap. Default is MTLCPUCacheModeDefaultCache.
All resources created from this heap share the same cache mode.
MTLDevice device()
The device this heap was created against. This heap can only be used with this device.
java.lang.String label()
A string to help identify this heap.
long maxAvailableSizeWithAlignment(long alignment)
The maximum size that can be successfully allocated from the heap in bytes, taking into notice given alignment. Alignment needs to be zero, or power of two.
Provides a measure of fragmentation within the heap.
MTLBuffer newBufferWithLengthOptions(long length, long options)
Create a new buffer backed by heap memory.
The requested storage and CPU cache modes must match the storage and CPU cache modes of the heap.
MTLTexture newTextureWithDescriptor(MTLTextureDescriptor desc)
Create a new texture backed by heap memory.
The requested storage and CPU cache modes must match the storage and CPU cache modes of the heap, with the exception that the requested storage mode can be MTLStorageModeMemoryless.
void setLabel(java.lang.String value)
A string to help identify this heap.
long setPurgeableState(long state)
Set or query the purgeability state of the heap.
long size()
Heap size in bytes, specified at creation time and rounded up to device specific alignment.
long storageMode()
Current heap storage mode, default is MTLStorageModePrivate.
All resources created from this heap share the same storage mode.
long usedSize()
The size in bytes, of all resources allocated from the heap.
long currentAllocatedSize()
The size in bytes of the current heap allocation.
long hazardTrackingMode()
Whether or not the heap is hazard tracked.
When a resource on a hazard tracked heap is modified, reads and writes from any other resource on that heap will be delayed until the modification is complete. Similarly, modifying heap resources will be delayed until all in-flight reads and writes from resources suballocated on that heap have completed. For optimal performance, perform hazard tracking manually through MTLFence or MTLEvent instead. Resources on the heap may opt-out of hazard tracking individually when the heap is hazard tracked, however resources cannot opt-in to hazard tracking when the heap is not hazard tracked.
MTLBuffer newBufferWithLengthOptionsOffset(long length, long options, long offset)
Create a new buffer backed by heap memory at the specified placement offset.
This method can only be used when heapType is set to MTLHeapTypePlacement. Use "MTLDevice heapBufferSizeAndAlignWithLength:options:" to determine requiredSize and requiredAlignment. Any resources that exist in this heap at overlapping half-open range [offset, offset + requiredSize) are implicitly aliased with the new resource.
length - The requested size of the buffer, in bytes.options - The requested options of the buffer, of which the storage and CPU cache mode must match these of the heap.offset - The requested offset of the buffer inside the heap, in bytes. Behavior is undefined if "offset + requiredSize > heap.size" or "offset % requiredAlignment != 0".MTLTexture newTextureWithDescriptorOffset(MTLTextureDescriptor descriptor, long offset)
Create a new texture backed by heap memory at the specified placement offset.
This method can only be used when heapType is set to MTLHeapTypePlacement. Use "MTLDevice heapTextureSizeAndAlignWithDescriptor:" to determine requiredSize and requiredAlignment. Any resources that exist in this heap at overlapping half-open range [offset, offset + requiredSize) are implicitly aliased with the new resource.
descriptor - The requested properties of the texture, of which the storage and CPU cache mode must match those of the heap.offset - The requested offset of the texture inside the heap, in bytes. Behavior is undefined if "offset + requiredSize > heap.size" and "offset % requiredAlignment != 0".long resourceOptions()
A packed tuple of the storageMode, cpuCacheMode and hazardTrackingMode properties.
long type()
The type of the heap. The default value is MTLHeapTypeAutomatic.
This constrains the resource creation functions that are available on the heap.