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 API-Since: 8.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longallocatedSize()[@property] allocatedSize The size in bytes occupied by this resource API-Since: 11.0longcpuCacheMode()[@property] cpuCacheMode The cache mode used for the CPU mapping for this resource@NotNull MTLDevicedevice()[@property] device The device this resource was created against.longhazardTrackingMode()[@property] hazardTrackingMode Whether or not the resource is hazard tracked.@Nullable 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.@Nullable 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(@Nullable 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 API-Since: 9.0
-
-
-
Method Detail
-
cpuCacheMode
long cpuCacheMode()
[@property] cpuCacheMode The cache mode used for the CPU mapping for this resource
-
device
@NotNull @NotNull MTLDevice device()
[@property] device The device this resource was created against. This resource can only be used with this device.
-
heap
@Nullable @Nullable MTLHeap heap()
[@property] heap The heap from which this resouce was created. Nil when this resource is not backed by a heap. API-Since: 10.0
-
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. API-Since: 10.0
-
label
@Nullable @Nullable 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. API-Since: 10.0
-
setLabel
void setLabel(@Nullable @Nullable 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 API-Since: 9.0
-
allocatedSize
long allocatedSize()
[@property] allocatedSize The size in bytes occupied by this resource API-Since: 11.0
-
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. API-Since: 13.0
-
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. API-Since: 13.0
-
resourceOptions
long resourceOptions()
[@property] resourceOptions A packed tuple of the storageMode, cpuCacheMode and hazardTrackingMode properties. API-Since: 13.0
-
-