Skip to main content

GeometryShader

Struct GeometryShader 

Source
pub struct GeometryShader { /* private fields */ }
Expand description

A geometry program ready to run.

Implementations§

Source§

impl GeometryShader

Source

pub fn new(program: Program) -> Result<Self, String>

Prepare program, a geometry program, to run.

Source

pub fn program(&self) -> &Program

The geometry program the shader runs.

Source

pub fn facts(&self) -> GeometryFacts

What the program states: the primitive it reads, what it emits, the most vertices an invocation emits and its number of instances.

Source

pub fn inputs(&self) -> impl Iterator<Item = &str>

The names of the input varyings: the registers of a Vertex given to the program, in order.

Source

pub fn outputs(&self) -> impl Iterator<Item = &str>

The names of the output varyings: the registers of the vertices of a Strip, in order.

Source

pub fn run( &self, constants: &Constants, sampler: &mut dyn Sampler, vertices: &[&Vertex], primitive: u32, instance: u32, ) -> Result<Vec<Strip>, String>

Run the program for the primitive of the draw numbered primitive whose vertices are vertices (as many as the program’s input primitive has, in the order Topology::primitives gives), as instance instance, and return the strips it emitted. constants holds the rows of the constant buffers by (register, space); image and buffer access go to sampler by bind slot.

Source

pub fn draw( &self, constants: &Constants, sampler: &mut dyn Sampler, vertices: &[Vertex], topology: Topology, ) -> Result<Vec<Strip>, String>

Draw vertices (the output of a vertex program) as topology: assemble the primitives, and run the program for each of them and each of its instances. The strips are in the order of the primitives, the instances of a primitive in order, then the strips an instance cut. The topology must be the kind of primitive the program reads.

Source

pub fn draw_indexed( &self, constants: &Constants, sampler: &mut dyn Sampler, vertices: &[Vertex], indices: &[u32], restart: Option<u32>, topology: Topology, ) -> Result<Vec<Strip>, String>

GeometryShader::draw of an indexed draw: the vertices at indices, in order. When the draw has a restart index (restart, the value that cuts a strip: 0xFFFF or 0xFFFFFFFF in D3D), an index list that holds it is refused: the primitives around a cut are not assembled.

Trait Implementations§

Source§

impl Debug for GeometryShader

Source§

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

Formats the value using the given formatter. Read more

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.