Package apple.metal.protocol
Interface MTLResource
-
- All Known Subinterfaces:
MTLAccelerationStructure,MTLBuffer,MTLIndirectCommandBuffer,MTLIntersectionFunctionTable,MTLTexture,MTLVisibleFunctionTable
public interface MTLResource[@protocol] MTLResource Common APIs available for MTLBuffer and MTLTexture instances
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longallocatedSize()[@property] allocatedSize [@abstrace] The size in bytes occupied by this resourcelongcpuCacheMode()[@property] cpuCacheMode The cache mode used for the CPU mapping for this resourceMTLDevicedevice()[@property] device The device this resource was created against.longhazardTrackingMode()[@property] hazardTrackingMode Whether or not the resource is hazard tracked.MTLHeapheap()[@property] heap The heap from which this resouce was created.longheapOffset()[@property] heapOffset The offset inside the heap at which this resource was created.booleanisAliasable()isAliasable Returns whether future heap sub-allocations may alias against this resource's memory.java.lang.Stringlabel()[@property] label A string to help identify this object.voidmakeAliasable()makeAliasable Allow future heap sub-allocations to alias against this resource's memory.longresourceOptions()[@property] resourceOptions A packed tuple of the storageMode, cpuCacheMode and hazardTrackingMode properties.voidsetLabel(java.lang.String value)[@property] label A string to help identify this object.longsetPurgeableState(long state)setPurgeableState 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.longstorageMode()[@property] storageMode The resource storage mode used for the CPU mapping for this resource
-
-
-
Method Detail
-
cpuCacheMode
long cpuCacheMode()
[@property] cpuCacheMode The cache mode used for the CPU mapping for this resource
-
device
MTLDevice device()
[@property] device The device this resource was created against. This resource can only be used with this device.
-
heap
MTLHeap heap()
[@property] heap The heap from which this resouce was created. Nil when this resource is not backed by a heap.
-
isAliasable
boolean isAliasable()
isAliasable Returns whether future heap sub-allocations may alias against this resource's memory.- Returns:
- YES if
makeAliasable was previously successfully called on this resource. NO otherwise. If resource is sub-allocated from other resource created on the heap, isAliasable returns aliasing state of that base resource. Also returns NO when storage mode is memoryless.
-
label
java.lang.String label()
[@property] label A string to help identify this object.
-
makeAliasable
void makeAliasable()
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.
-
setLabel
void setLabel(java.lang.String value)
[@property] label A string to help identify this object.
-
setPurgeableState
long setPurgeableState(long state)
setPurgeableState 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.
-
storageMode
long storageMode()
[@property] storageMode The resource storage mode used for the CPU mapping for this resource
-
allocatedSize
long allocatedSize()
[@property] allocatedSize [@abstrace] The size in bytes occupied by this resource
-
hazardTrackingMode
long hazardTrackingMode()
[@property] 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.
-
heapOffset
long heapOffset()
[@property] heapOffset The offset inside the heap at which this resource was created. Zero when this resource was not created on a heap with MTLHeapTypePlacement.
-
resourceOptions
long resourceOptions()
[@property] resourceOptions A packed tuple of the storageMode, cpuCacheMode and hazardTrackingMode properties.
-
-