Instance Method


Adds the specified vertex attribute to the vertex descriptor, replacing any existing attribute with the same name.


- (void)addOrReplaceAttribute:(MDLVertexAttribute *)attribute;



The vertex attribute to add to the vertex descriptor.


If the vertex descriptor contains an attribute whose name property is the same as that of the attribute parameter, the new attribute replaces the existing attribute in the attributes array. Otherwise, this method adds the new attribute to the end of the attributes array.

See Also

Working with Vertex Attributes


The list of vertex attributes described by the vertex descriptor.

- attributeNamed:

Returns the vertex attribute with the specified name in the vertex descriptor.

- setPackedOffsets

Sets the offset for each vertex attribute to the minimum value to pack vertex data together in a single buffer.