Class

MTLArgumentDescriptor

A representation of an argument within an argument buffer.

Declaration

class MTLArgumentDescriptor : NSObject

Overview

This descriptor can represent arguments within flat structures only. It can represent arrays of allowed argument buffer data types, but it cannot represent arguments within nested structures. Argument buffers with simple, flat structures can be represented by an array of MTLArgumentDescriptor objects. You can then use this array to create a MTLArgumentEncoder object by calling the makeArgumentEncoder(arguments:) method.Argument buffers with complex, nested structures must define their structure in Metal shading language code, which can then be directly assigned to a specific buffer index of a function. You can then use this buffer index to call the makeArgumentEncoder(bufferIndex:) method and create a MTLArgumentEncoder object.

Topics

Setting the Descriptor's Properties

var dataType: MTLDataType

The data type of the argument.

var index: Int

The index ID of the argument.

var access: MTLArgumentAccess

The access permissions of the argument.

var arrayLength: Int

The length of an array argument.

var constantBlockAlignment: Int

The alignment of the constant block.

var textureType: MTLTextureType

The texture type of a texture argument.

Relationships

Inherits From

See Also

Argument Buffers

About Argument Buffers

Improve your app’s performance by grouping your resources into an argument buffer.

Basic Argument Buffers

Demonstrates how to manage groups of resources with an argument buffer.

Argument Buffers with Arrays and Resource Heaps

Demonstrates how to define an argument buffer with arrays and reduce CPU overhead by combining argument buffers with resource heaps.

Argument Buffers with GPU Encoding

Demonstrates how to encode an argument buffer with a compute pass and then access its arguments in a subsequent render pass.

Dynamic Terrain with Argument Buffers

Demonstrates how to use argument buffers to render a dynamic terrain in real time with a GPU-driven pipeline.

Indexing Argument Buffers

Assign resource indices within an argument buffer.

Tracking the Resource Residency of Argument Buffers

Optimize resource performance within an argument buffer.

protocol MTLArgumentEncoder

An object used to encode data into an argument buffer.