Allocates a new zero-filled buffer of a given length.
Required.
SDKs
- iOS 8.0+
- macOS 10.11+
- Mac Catalyst 13.0+
- tvOS 9.0+
Framework
- Metal
Declaration
- (id<MTLBuffer>)newBufferWithLength:(NSUInteger)length options:(MTLResource Options)options;
Parameters
length
The size of the new buffer, in bytes.
options
Specifies the behavior of the new buffer.
Return Value
A new MTLBuffer
object with a new zero-filled memory allocation.
Discussion
MTLBuffer
objects created with this method can be CPU and/or GPU accessible and they can be specified with a MTLResource
, MTLResource
, or MTLResource
storage mode.