Instance Property

encodedLength

The number of bytes required to store the encoded resources of an argument buffer.

Required.

Declaration

var encodedLength: Int { get }

Discussion

After creating a MTLArgumentEncoder object, use this value to create the MTLBuffer object that represents an argument buffer.

Listing 1

Creating an argument buffer

id <MTLArgumentEncoder> encoder = [_function newArgumentEncoderWithBufferIndex:0];
id <MTLBuffer> buffer = [_device newBufferWithLength:encoder.encodedLength options:_options];
[encoder setArgumentBuffer:buffer offset:0];

See Also

Creating an Argument Buffer

func setArgumentBuffer(MTLBuffer?, offset: Int)

Specifies the argument buffer that resources are encoded into.

Required.

func setArgumentBuffer(MTLBuffer?, startOffset: Int, arrayElement: Int)

Specifies the argument buffer that resources are encoded into.

Required.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software