Class

MTLArgument

Information about an argument of a graphics or compute function.

Declaration

@interface MTLArgument : NSObject

Overview

A MTLArgument object describes a single argument to a Metal function. Your app uses the MTLArgument properties to read details about a function argument as it was defined in the Metal Shading Language. You can determine the argument’s data type, access restrictions, and its associated resource type. For buffer, texture, and threadgroup memory arguments, additional properties can be read to determine more details about the argument.

Your app does not create a MTLArgument object directly. Creating a MTLRenderPipelineState or MTLComputePipelineState object can generate a reflection object (MTLRenderPipelineReflection or MTLComputePipelineReflection) that contains MTLArgument objects.

Topics

Describing the Argument

name

The name of the argument.

active

A Boolean that indicates whether the compiled function uses the argument.

index

The index in the argument table that corresponds to the function argument.

type

The argument’s resource type.

access

The argument's read and/or write access.

Describing a Buffer Argument

bufferAlignment

The required byte alignment in memory for the buffer data.

bufferDataSize

The size, in bytes, of the buffer data.

bufferDataType

The data type of the buffer data.

bufferStructType

A description of the structure data of a buffer argument.

bufferPointerType

A description of the pointer to a buffer argument.

Describing a Texture Argument

textureDataType

The data type of a texture argument.

textureType

The texture type of a texture argument.

isDepthTexture

A Boolean value that indicates whether the texture is a depth texture.

Describing an Array Argument

arrayLength

The number of elements, if the argument is an array.

Describing a Threadgroup Memory Argument

threadgroupMemoryAlignment

The required byte alignment in memory for the threadgroup data.

threadgroupMemoryDataSize

The size, in bytes, of the threadgroup data.

Releasing the Reflection Object

MTLAutoreleasedArgument

A convenience type alias for an autoreleased MTLArgument object.

Relationships

Inherits From

See Also

Function Argument Information

MTLPipelineOption

The compilation options that determine which argument information to provide.

MTLComputePipelineReflection

Information about the arguments of a compute function.

MTLRenderPipelineReflection

Information about the arguments of a graphics function.

MTLType

A description of a data type.

MTLStructType

A description of a structure.

MTLArrayType

A description of an array.

MTLPointerType

A description of a pointer.

MTLTextureReferenceType

A description of a texture.

MTLDataType

Data types for function arguments.

MTLArgumentType

The resource type associated with an argument of a function.

MTLArgumentAccess

Function access restrictions to argument data in the shading language code.

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