logo
#[non_exhaustive]
#[repr(i32)]
pub enum PrimitiveTopology {
    PointList,
    LineList,
    LineStrip,
    TriangleList,
    TriangleStrip,
    TriangleFan,
    LineListWithAdjacency,
    LineStripWithAdjacency,
    TriangleListWithAdjacency,
    TriangleStripWithAdjacency,
    PatchList,
}
Expand description

Describes how vertices must be grouped together to form primitives.

When enabling primitive restart, “list” topologies require a feature to be enabled on the device:

Variants (Non-exhaustive)

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.

PointList

A series of separate point primitives.

LineList

A series of separate line primitives.

LineStrip

A series of consecutive line primitives, with consecutive lines sharing a vertex.

TriangleList

A series of separate triangle primitives.

TriangleStrip

A series of consecutive triangle primitives, with consecutive triangles sharing an edge (two vertices).

TriangleFan

A series of consecutive triangle primitives, with all triangles sharing a common vertex (the first).

LineListWithAdjacency

As LineList, but with adjacency, used in combination with geometry shaders. Requires the [geometry_shader`](crate::device::Features::geometry_shader) feature.

LineStripWithAdjacency

As LineStrip, but with adjacency, used in combination with geometry shaders. Requires the geometry_shader feature.

TriangleListWithAdjacency

As TriangleList, but with adjacency, used in combination with geometry shaders. Requires the geometry_shader feature.

TriangleStripWithAdjacency

As TriangleStrip, but with adjacency, used in combination with geometry shaders. Requires the geometry_shader feature.

PatchList

Separate patch primitives, used in combination with tessellation shaders. Requires the tessellation_shader feature.

Implementations

Returns the topology class of this topology.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Converts to this type from the input type.
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
The type returned in the event of a conversion error.
Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.