Enum PrimitiveType

Source
pub enum PrimitiveType {
    Points,
    LinesList,
    LinesListAdjacency,
    LineStrip,
    LineStripAdjacency,
    LineLoop,
    TrianglesList,
    TrianglesListAdjacency,
    TriangleStrip,
    TriangleStripAdjacency,
    TriangleFan,
    Patches {
        vertices_per_patch: u16,
    },
}
Expand description

Variants§

§

Points

Each vertex is an individual point.

§

LinesList

Vertices are grouped by chunks of two vertices. Each chunk represents a line.

§

LinesListAdjacency

Vertices are grouped by chunks of four vertices. The second and third vertices of each chunk represents the line.

Adjacency information doesn’t do anything per-se, but is passed to the geometry shader if there is any. The first vertex represents the vertex adjacent to the second vertex. The fourth vertex represents the vertex adjacent to the third vertex.

§

LineStrip

Each vertex (except the last one) forms a line with the next vertex.

For example vertices 0 and 1 form a line, vertices 1 and 2 form a line, vertices 2 and 3 form a line, etc.

§

LineStripAdjacency

Similar to LineStrip, but with an additional vertex at the beginning and at the end that represent the vertices adjacent to the first and last ones.

Adjacency information doesn’t do anything per-se, but is passed to the geometry shader if there is any.

§

LineLoop

Each vertex forms a line with the next vertex. The last vertex form a line with the first one.

§

TrianglesList

Vertices are grouped by chunks of three vertices. Each chunk represents a triangle.

The order of the vertices is important, as it determines whether the triangle will be clockwise or counter-clockwise. See BackfaceCulling for more infos.

§

TrianglesListAdjacency

Vertices are grouped by chunks of six vertices. The first, third and fifth vertices represent a triangle.

The order of the vertices is important, as it determines whether the triangle will be clockwise or counter-clockwise. See BackfaceCulling for more infos.

Adjacency information doesn’t do anything per-se, but is passed to the geometry shader if there is any. The second vertex represents the vertex adjacent to the first and third vertices. The fourth vertex represents the vertex adjacent to the third and fifth vertices. The sixth vertex represents the vertex adjacent to the first and fifth vertices.

§

TriangleStrip

Each vertex (except the first one and the last one) forms a triangle with the previous and the next vertices.

For example vertices 0, 1, 2 form a triangle, 1, 2, 3 form a triangle, 2, 3, 4 form a triangle, 3, 4, 5 form a triangle, etc.

Each uneven triangle is reversed so that all triangles are facing the same direction.

§

TriangleStripAdjacency

Each even vertex forms a triangle with vertices n+2 and n+4.

Each uneven vertex is adjacent to the previous and next ones. Adjacency information doesn’t do anything per-se, but is passed to the geometry shader if there is any.

§

TriangleFan

Starting at the second vertex, each vertex forms a triangle with the next and the first vertices.

For example vertices 0, 1, 2 form a triangle, 0, 2, 3 form a triangle, 0, 3, 4 form a triangle, 0, 4, 5 form a triangle, etc.

§

Patches

Vertices are grouped by chunks of vertices_per_patch vertices.

This primitives type can only be used in conjunction with a tessellation shader. The tessellation shader will indicate how each patch will be divided into lines or triangles.

Fields

§vertices_per_patch: u16

Number of vertices per patch.

Implementations§

Source§

impl PrimitiveType

Source

pub fn is_supported<C>(&self, caps: &C) -> bool

Returns true if the backend supports this type of primitives.

Trait Implementations§

Source§

impl Clone for PrimitiveType

Source§

fn clone(&self) -> PrimitiveType

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PrimitiveType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl PartialEq for PrimitiveType

Source§

fn eq(&self, other: &PrimitiveType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for PrimitiveType

Source§

impl Eq for PrimitiveType

Source§

impl StructuralPartialEq for PrimitiveType

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Content for T
where T: Copy,

Source§

type Owned = T

A type that holds a sized version of the content.
Source§

fn read<F, E>(size: usize, f: F) -> Result<T, E>
where F: FnOnce(&mut T) -> Result<(), E>,

Prepares an output buffer, then turns this buffer into an Owned.
Source§

fn get_elements_size() -> usize

Returns the size of each element.
Source§

fn to_void_ptr(&self) -> *const ()

Produces a pointer to the data.
Source§

fn ref_from_ptr<'a>(ptr: *mut (), size: usize) -> Option<*mut T>

Builds a pointer to this type from a raw pointer.
Source§

fn is_size_suitable(size: usize) -> bool

Returns true if the size is suitable to store a type like this.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scalar for T
where T: Copy + PartialEq + Debug + Any,

Source§

fn is<T>() -> bool
where T: Scalar,

Tests if Self the same as the type T Read more
Source§

impl<T> SetParameter for T

Source§

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result
where T: Parameter<Self>,

Sets value as a parameter of self.
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

unsafe fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Erased for T