logo
#[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

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

Performs the conversion.

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 !=.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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.