Enumeration

MTLPrimitiveType

The geometric primitive type for drawing commands.

Declaration

typedef enum MTLPrimitiveType : NSUInteger {
    ...
} MTLPrimitiveType;

Topics

Constants

MTLPrimitiveTypePoint

Rasterize a point at each vertex. The vertex shader must provide [[point_size]], or the point size is undefined.

MTLPrimitiveTypeLine

Rasterize a line between each separate pair of vertices, resulting in a series of unconnected lines. If there are an odd number of vertices, the last vertex is ignored.

MTLPrimitiveTypeLineStrip

Rasterize a line between each pair of adjacent vertices, resulting in a series of connected lines (also called a polyline).

MTLPrimitiveTypeTriangle

For every separate set of three vertices, rasterize a triangle. If the number of vertices is not a multiple of three, either one or two vertices is ignored.

MTLPrimitiveTypeTriangleStrip

For every three adjacent vertices, rasterize a triangle.

See Also

Drawing Geometric Primitives and Tessellated Patches

- drawPrimitives:vertexStart:vertexCount:instanceCount:baseInstance:

Encodes a command to render a number of instances of primitives using vertex data in contiguous array elements, starting from the base instance.

Required.

- drawPrimitives:vertexStart:vertexCount:instanceCount:

Encodes a command to render a number of instances of primitives using vertex data in contiguous array elements.

Required.

- drawPrimitives:vertexStart:vertexCount:

Encodes a command to render one instance of primitives using vertex data in contiguous array elements.

Required.

- drawIndexedPrimitives:indexCount:indexType:indexBuffer:indexBufferOffset:instanceCount:baseVertex:baseInstance:

Encodes a command to render a number of instances of primitives using an index list specified in a buffer, starting from the base vertex of the base instance.

Required.

- drawIndexedPrimitives:indexCount:indexType:indexBuffer:indexBufferOffset:instanceCount:

Encodes a command to render a number of instances of primitives using an index list specified in a buffer.

Required.

- drawIndexedPrimitives:indexCount:indexType:indexBuffer:indexBufferOffset:

Encodes a command to render one instance of primitives using an index list specified in a buffer.

Required.

- drawPatches:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:instanceCount:baseInstance:

Encodes a command to render a number of instances of tessellated patches.

Required.

- drawIndexedPatches:patchStart:patchCount:patchIndexBuffer:patchIndexBufferOffset:controlPointIndexBuffer:controlPointIndexBufferOffset:instanceCount:baseInstance:

Encodes a command to render a number of instances of tessellated patches, using a control point index buffer.

Required.

MTLIndexType

The index type for an index buffer that references vertices of geometric primitives.

MTLQuadTessellationFactorsHalf

The per-patch tessellation factors for a quad patch.

MTLTriangleTessellationFactorsHalf

The per-patch tessellation factors for a triangle patch.