pub struct GeometryShader { /* private fields */ }Expand description
A geometry program ready to run.
Implementations§
Source§impl GeometryShader
impl GeometryShader
Sourcepub fn new(program: Program) -> Result<Self, String>
pub fn new(program: Program) -> Result<Self, String>
Prepare program, a geometry program, to run.
Sourcepub fn facts(&self) -> GeometryFacts
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.
Sourcepub fn inputs(&self) -> impl Iterator<Item = &str>
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.
Sourcepub fn outputs(&self) -> impl Iterator<Item = &str>
pub fn outputs(&self) -> impl Iterator<Item = &str>
The names of the output varyings: the registers of the vertices of a Strip, in order.
Sourcepub fn run(
&self,
constants: &Constants,
sampler: &mut dyn Sampler,
vertices: &[&Vertex],
primitive: u32,
instance: u32,
) -> Result<Vec<Strip>, String>
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.
Sourcepub fn draw(
&self,
constants: &Constants,
sampler: &mut dyn Sampler,
vertices: &[Vertex],
topology: Topology,
) -> Result<Vec<Strip>, String>
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.
Sourcepub fn draw_indexed(
&self,
constants: &Constants,
sampler: &mut dyn Sampler,
vertices: &[Vertex],
indices: &[u32],
restart: Option<u32>,
topology: Topology,
) -> Result<Vec<Strip>, String>
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.