Package apple.metal.protocol
Interface MTLBuffer
-
- All Superinterfaces:
MTLResource
public interface MTLBuffer extends MTLResource
[@protocol] MTLBuffer A typeless allocation accessible by both the CPU and the GPU (MTLDevice) or by only the GPU when the storage mode is MTLResourceStorageModePrivate. Unlike in OpenGL and OpenCL, access to buffers is not synchronized. The caller may use the CPU to modify the data at any time but is also responsible for ensuring synchronization and coherency. The contents become undefined if both the CPU and GPU write to the same buffer without a synchronizing action between those writes. This is true even when the regions written do not overlap.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddDebugMarkerRange(java.lang.String marker, NSRange range)addDebugMarker:range: Adds a marker to a specific range in the buffer.org.moe.natj.general.ptr.VoidPtrcontents()contents Returns the data pointer of this buffer's shared copy.longlength()[@property] length The length of the buffer in bytes.MTLTexturenewTextureWithDescriptorOffsetBytesPerRow(MTLTextureDescriptor descriptor, long offset, long bytesPerRow)newTextureWithDescriptor:offset:bytesPerRow: Create a 2D texture or texture buffer that shares storage with this buffer.voidremoveAllDebugMarkers()removeAllDebugMarkers Removes all debug markers from a buffer.-
Methods inherited from interface apple.metal.protocol.MTLResource
allocatedSize, cpuCacheMode, device, hazardTrackingMode, heap, heapOffset, isAliasable, label, makeAliasable, resourceOptions, setLabel, setPurgeableState, storageMode
-
-
-
-
Method Detail
-
addDebugMarkerRange
void addDebugMarkerRange(java.lang.String marker, NSRange range)addDebugMarker:range: Adds a marker to a specific range in the buffer. When inspecting a buffer in the GPU debugging tools the marker will be shown.- Parameters:
marker- A label used for the marker.range- The range of bytes the marker is using.
-
contents
org.moe.natj.general.ptr.VoidPtr contents()
contents Returns the data pointer of this buffer's shared copy.
-
length
long length()
[@property] length The length of the buffer in bytes.
-
newTextureWithDescriptorOffsetBytesPerRow
MTLTexture newTextureWithDescriptorOffsetBytesPerRow(MTLTextureDescriptor descriptor, long offset, long bytesPerRow)
newTextureWithDescriptor:offset:bytesPerRow: Create a 2D texture or texture buffer that shares storage with this buffer.
-
removeAllDebugMarkers
void removeAllDebugMarkers()
removeAllDebugMarkers Removes all debug markers from a buffer.
-
-