Class

MTLVertexDescriptor

An object that describes how vertex data is organized and mapped to a vertex function.

Declaration

class MTLVertexDescriptor : NSObject

Overview

A MTLVertexDescriptor object is used to configure how vertex data stored in memory is mapped to attributes in a vertex shader.

A pipeline state is the state of the graphics rendering pipeline, including shaders, blending, multisampling, and visibility testing. For every pipeline state, there can be only one MTLVertexDescriptor object. When you configure a MTLRenderPipelineDescriptor object to create this pipeline state, you use a MTLVertexDescriptor object to establish the vertex layout for the function associated with the pipeline. Create and configure a MTLVertexDescriptor object, then use this object to set the vertexDescriptor property of the MTLRenderPipelineDescriptor object.

Topics

Setting Default Values

func reset()

Resets the default state for the vertex descriptor.

Accessing the Vertex Buffer Layouts and Vertex Attributes

var attributes: MTLVertexAttributeDescriptorArray

An array of state data that describes how vertex attribute data is stored in memory and is mapped to arguments for a vertex shader function.

var layouts: MTLVertexBufferLayoutDescriptorArray

An array of state data that describes how data are fetched by a vertex shader function when rendering primitives.

Relationships

Inherits From

See Also

Specifying Buffer Layouts and Fetch Behavior

var vertexDescriptor: MTLVertexDescriptor?

The organization of vertex data in an attribute’s argument table.

class MTLVertexAttributeDescriptor

An object that determines how attribute data is stored in memory and how it is mapped to the arguments of a vertex function.

class MTLVertexBufferLayoutDescriptor

An object that configures how vertex data and attributes are fetched by a vertex function.