pub enum Topology {
PointList,
LineList,
LineStrip,
TriangleList,
TriangleStrip,
LineListAdjacency,
LineStripAdjacency,
TriangleListAdjacency,
TriangleStripAdjacency,
}Expand description
How a draw’s vertices make primitives (D3D’s primitive topologies a geometry shader can follow).
Variants§
PointList
Each vertex is a point.
LineList
Every two vertices make a line.
LineStrip
Each vertex after the first makes a line with the one before it.
TriangleList
Every three vertices make a triangle.
TriangleStrip
Each vertex after the second makes a triangle with the two before it (odd triangles swap their last two vertices).
LineListAdjacency
Every four vertices make a line with its two neighbours.
LineStripAdjacency
A strip of lines with an adjacent vertex at each end.
TriangleListAdjacency
Every six vertices make a triangle with its three neighbours.
TriangleStripAdjacency
A strip of triangles with adjacency, numbered as D3D11 numbers them.
Implementations§
Source§impl Topology
impl Topology
Sourcepub fn input(self) -> GsInput
pub fn input(self) -> GsInput
The primitive a geometry program reads to be drawn with this topology.
Sourcepub fn primitives(self, vertices: usize) -> Vec<Vec<usize>>
pub fn primitives(self, vertices: usize) -> Vec<Vec<usize>>
The primitives of a draw of vertices vertices, each as the indices of its vertices in the order the geometry
program reads them (GsInput::vertices of them). Vertices that complete no primitive are ignored.
- A strip’s primitive
iis[i, i + 1, ...], a triangle strip’s odd primitive[i, i + 2, i + 1](its last two swapped). - A line with adjacency is
[before, start, end, after]. - A triangle with adjacency is
[a, adjacent to a-b, b, adjacent to b-c, c, adjacent to c-a]. - A triangle strip with adjacency is the vertices
0, 2, 4, ...of a triangle strip, and between them the vertices that are adjacent to its edges (an odd vertex2i + 1the first’s0-2edge): forn = (vertices - 4) / 2primitives, primitivei(even) is[2i, 2i - 2 (1 for i = 0), 2i + 2, 2i + 6, 2i + 4, 2i + 3]and primitivei(odd)[2i, 2i + 3, 2i + 4, 2i + 6, 2i + 2, 2i - 2], the vertex2i + 6that the last primitive does not have replaced by2i + 5.
Trait Implementations§
impl Copy for Topology
impl Eq for Topology
impl StructuralPartialEq for Topology
Auto Trait Implementations§
impl Forget for Topology
impl Freeze for Topology
impl RefUnwindSafe for Topology
impl Send for Topology
impl Sync for Topology
impl Unpin for Topology
impl UnsafeUnpin for Topology
impl UnwindSafe for Topology
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.