public interface MTLResource
Common APIs available for MTLBuffer and MTLTexture instances
| Modifier and Type | Method and Description |
|---|---|
long |
allocatedSize()
[@property] allocatedSize
[@abstrace] The size in bytes occupied by this resource
|
long |
cpuCacheMode()
[@property] cpuCacheMode
|
MTLDevice |
device()
[@property] device
|
long |
hazardTrackingMode()
[@property] hazardTrackingMode
|
MTLHeap |
heap()
[@property] heap
|
long |
heapOffset()
[@property] heapOffset
|
boolean |
isAliasable()
isAliasable
|
java.lang.String |
label()
[@property] label
|
void |
makeAliasable()
makeAliasable
|
long |
resourceOptions()
[@property] resourceOptions
|
void |
setLabel(java.lang.String value)
[@property] label
|
long |
setPurgeableState(long state)
setPurgeableState
|
long |
storageMode()
[@property] storageMode
|
long cpuCacheMode()
The cache mode used for the CPU mapping for this resource
MTLDevice device()
The device this resource was created against. This resource can only be used with this device.
MTLHeap heap()
The heap from which this resouce was created.
Nil when this resource is not backed by a heap.
boolean isAliasable()
Returns whether future heap sub-allocations may alias against this resource's memory.
java.lang.String label()
A string to help identify this object.
void makeAliasable()
Allow future heap sub-allocations to alias against this resource's memory.
It is illegal to call this method on a non heap-based resource. It is also illegal to call this method on texture views created from heap-based textures. The debug layer will raise an exception. Calling this method on textures sub-allocated from Buffers backed by heap memory has no effect. Once a resource is made aliasable, the decision cannot be reverted.
void setLabel(java.lang.String value)
A string to help identify this object.
long setPurgeableState(long state)
Set (or query) the purgeability state of a resource
Synchronously set the purgeability state of a resource and return what the prior (or current) state is. FIXME: If the device is keeping a cached copy of the resource, both the shared copy and cached copy are made purgeable. Any access to the resource by either the CPU or device will be undefined.
long storageMode()
The resource storage mode used for the CPU mapping for this resource
long allocatedSize()
long hazardTrackingMode()
Whether or not the resource is hazard tracked.
This value can be either MTLHazardTrackingModeUntracked or MTLHazardTrackingModeTracked. Resources created from heaps are by default untracked, whereas resources created from the device are by default tracked.
long heapOffset()
The offset inside the heap at which this resource was created.
Zero when this resource was not created on a heap with MTLHeapTypePlacement.
long resourceOptions()
A packed tuple of the storageMode, cpuCacheMode and hazardTrackingMode properties.