Struct vulkano::pipeline::GraphicsPipelineBuilder
[−]
[src]
pub struct GraphicsPipelineBuilder<'a, Vdef, Vsp, Vi, Vo, Vl, Tcs, Tci, Tco, Tcl, Tes, Tei, Teo, Tel, Gs, Gi, Go, Gl, Fs, Fi, Fo, Fl, Rp> { /* fields omitted */ }
Prototype for a GraphicsPipeline
.
Methods
impl<'a, Vdef, Vsp, Vi, Vo, Vl, Tcs, Tci, Tco, Tcl, Tes, Tei, Teo, Tel, Gs, Gi, Go, Gl, Fs, Fi, Fo, Fl, Rp> GraphicsPipelineBuilder<'a, Vdef, Vsp, Vi, Vo, Vl, Tcs, Tci, Tco, Tcl, Tes, Tei, Teo, Tel, Gs, Gi, Go, Gl, Fs, Fi, Fo, Fl, Rp> where
Vdef: VertexDefinition<Vi>,
Vl: PipelineLayoutDescNames + Clone + 'static + Send + Sync,
Fl: PipelineLayoutDescNames + Clone + 'static + Send + Sync,
Tcl: PipelineLayoutDescNames + Clone + 'static + Send + Sync,
Tel: PipelineLayoutDescNames + Clone + 'static + Send + Sync,
Gl: PipelineLayoutDescNames + Clone + 'static + Send + Sync,
Tci: ShaderInterfaceDefMatch<Vo>,
Tei: ShaderInterfaceDefMatch<Tco>,
Gi: ShaderInterfaceDefMatch<Teo> + ShaderInterfaceDefMatch<Vo>,
Vo: ShaderInterfaceDef,
Tco: ShaderInterfaceDef,
Teo: ShaderInterfaceDef,
Go: ShaderInterfaceDef,
Fi: ShaderInterfaceDefMatch<Go> + ShaderInterfaceDefMatch<Teo> + ShaderInterfaceDefMatch<Vo>,
Fo: ShaderInterfaceDef,
Rp: RenderPassAbstract + RenderPassSubpassInterface<Fo>,
[src]
Vdef: VertexDefinition<Vi>,
Vl: PipelineLayoutDescNames + Clone + 'static + Send + Sync,
Fl: PipelineLayoutDescNames + Clone + 'static + Send + Sync,
Tcl: PipelineLayoutDescNames + Clone + 'static + Send + Sync,
Tel: PipelineLayoutDescNames + Clone + 'static + Send + Sync,
Gl: PipelineLayoutDescNames + Clone + 'static + Send + Sync,
Tci: ShaderInterfaceDefMatch<Vo>,
Tei: ShaderInterfaceDefMatch<Tco>,
Gi: ShaderInterfaceDefMatch<Teo> + ShaderInterfaceDefMatch<Vo>,
Vo: ShaderInterfaceDef,
Tco: ShaderInterfaceDef,
Teo: ShaderInterfaceDef,
Go: ShaderInterfaceDef,
Fi: ShaderInterfaceDefMatch<Go> + ShaderInterfaceDefMatch<Teo> + ShaderInterfaceDefMatch<Vo>,
Fo: ShaderInterfaceDef,
Rp: RenderPassAbstract + RenderPassSubpassInterface<Fo>,
fn build(
self,
device: Arc<Device>
) -> Result<GraphicsPipeline<Vdef, Box<PipelineLayoutAbstract + Send + Sync>, Rp>, GraphicsPipelineCreationError>
self,
device: Arc<Device>
) -> Result<GraphicsPipeline<Vdef, Box<PipelineLayoutAbstract + Send + Sync>, Rp>, GraphicsPipelineCreationError>
Builds the graphics pipeline.
impl<'a, Vdef, Vsp, Vi, Vo, Vl, Tcs, Tci, Tco, Tcl, Tes, Tei, Teo, Tel, Gs, Gi, Go, Gl, Fs, Fi, Fo, Fl, Rp> GraphicsPipelineBuilder<'a, Vdef, Vsp, Vi, Vo, Vl, Tcs, Tci, Tco, Tcl, Tes, Tei, Teo, Tel, Gs, Gi, Go, Gl, Fs, Fi, Fo, Fl, Rp>
[src]
fn vertex_input<T>(
self,
vertex_input: T
) -> GraphicsPipelineBuilder<'a, T, Vsp, Vi, Vo, Vl, Tcs, Tci, Tco, Tcl, Tes, Tei, Teo, Tel, Gs, Gi, Go, Gl, Fs, Fi, Fo, Fl, Rp>
self,
vertex_input: T
) -> GraphicsPipelineBuilder<'a, T, Vsp, Vi, Vo, Vl, Tcs, Tci, Tco, Tcl, Tes, Tei, Teo, Tel, Gs, Gi, Go, Gl, Fs, Fi, Fo, Fl, Rp>
Sets the vertex input.
fn vertex_input_single_buffer<V>(
self
) -> GraphicsPipelineBuilder<'a, SingleBufferDefinition<V>, Vsp, Vi, Vo, Vl, Tcs, Tci, Tco, Tcl, Tes, Tei, Teo, Tel, Gs, Gi, Go, Gl, Fs, Fi, Fo, Fl, Rp>
self
) -> GraphicsPipelineBuilder<'a, SingleBufferDefinition<V>, Vsp, Vi, Vo, Vl, Tcs, Tci, Tco, Tcl, Tes, Tei, Teo, Tel, Gs, Gi, Go, Gl, Fs, Fi, Fo, Fl, Rp>
Sets the vertex input to a single vertex buffer.
You will most likely need to explicitely specify the template parameter to the type of a vertex.
fn vertex_shader<Vi2, Vo2, Vl2>(
self,
shader: VertexShaderEntryPoint<'a, (), Vi2, Vo2, Vl2>,
specialization_constants: ()
) -> GraphicsPipelineBuilder<'a, Vdef, (), Vi2, Vo2, Vl2, Tcs, Tci, Tco, Tcl, Tes, Tei, Teo, Tel, Gs, Gi, Go, Gl, Fs, Fi, Fo, Fl, Rp>
self,
shader: VertexShaderEntryPoint<'a, (), Vi2, Vo2, Vl2>,
specialization_constants: ()
) -> GraphicsPipelineBuilder<'a, Vdef, (), Vi2, Vo2, Vl2, Tcs, Tci, Tco, Tcl, Tes, Tei, Teo, Tel, Gs, Gi, Go, Gl, Fs, Fi, Fo, Fl, Rp>
Sets the vertex shader to use.
fn primitive_restart(self, enabled: bool) -> Self
Sets whether primitive restart if enabled.
fn primitive_topology(self, topology: PrimitiveTopology) -> Self
Sets the topology of the primitives that are expected by the pipeline.
fn point_list(self) -> Self
Sets the topology of the primitives to a list of points.
Note: This is equivalent to
self.primitive_topology(PrimitiveTopology::PointList)
.
fn line_list(self) -> Self
Sets the topology of the primitives to a list of lines.
Note: This is equivalent to
self.primitive_topology(PrimitiveTopology::LineList)
.
fn line_strip(self) -> Self
Sets the topology of the primitives to a line strip.
Note: This is equivalent to
self.primitive_topology(PrimitiveTopology::LineStrip)
.
fn triangle_list(self) -> Self
Sets the topology of the primitives to a list of triangles. Note that this is the default.
Note: This is equivalent to
self.primitive_topology(PrimitiveTopology::TriangleList)
.
fn triangle_strip(self) -> Self
Sets the topology of the primitives to a triangle strip.
Note: This is equivalent to
self.primitive_topology(PrimitiveTopology::TriangleStrip)
.
fn triangle_fan(self) -> Self
Sets the topology of the primitives to a fan of triangles.
Note: This is equivalent to
self.primitive_topology(PrimitiveTopology::TriangleFan)
.
fn line_list_with_adjacency(self) -> Self
Sets the topology of the primitives to a list of lines with adjacency information.
Note: This is equivalent to
self.primitive_topology(PrimitiveTopology::LineListWithAdjacency)
.
fn line_strip_with_adjacency(self) -> Self
Sets the topology of the primitives to a line strip with adjacency information.
Note: This is equivalent to
self.primitive_topology(PrimitiveTopology::LineStripWithAdjacency)
.
fn triangle_list_with_adjacency(self) -> Self
Sets the topology of the primitives to a list of triangles with adjacency information.
Note: This is equivalent to
self.primitive_topology(PrimitiveTopology::TriangleListWithAdjacency)
.
fn triangle_strip_with_adjacency(self) -> Self
Sets the topology of the primitives to a triangle strip with adjacency information`
Note: This is equivalent to
self.primitive_topology(PrimitiveTopology::TriangleStripWithAdjacency)
.
fn patch_list(self, vertices_per_patch: u32) -> Self
Sets the topology of the primitives to a list of patches. Can only be used and must be used with a tessellation shader.
Note: This is equivalent to
self.primitive_topology(PrimitiveTopology::PatchList { vertices_per_patch })
.
fn tessellation_shaders<Tci2, Tco2, Tcl2, Tei2, Teo2, Tel2>(
self,
tessellation_control_shader: TessControlShaderEntryPoint<'a, (), Tci2, Tco2, Tcl2>,
tessellation_control_shader_spec_constants: (),
tessellation_evaluation_shader: TessEvaluationShaderEntryPoint<'a, (), Tei2, Teo2, Tel2>,
tessellation_evaluation_shader_spec_constants: ()
) -> GraphicsPipelineBuilder<'a, Vdef, Vsp, Vi, Vo, Vl, (), Tci2, Tco2, Tcl2, (), Tei2, Teo2, Tel2, Gs, Gi, Go, Gl, Fs, Fi, Fo, Fl, Rp>
self,
tessellation_control_shader: TessControlShaderEntryPoint<'a, (), Tci2, Tco2, Tcl2>,
tessellation_control_shader_spec_constants: (),
tessellation_evaluation_shader: TessEvaluationShaderEntryPoint<'a, (), Tei2, Teo2, Tel2>,
tessellation_evaluation_shader_spec_constants: ()
) -> GraphicsPipelineBuilder<'a, Vdef, Vsp, Vi, Vo, Vl, (), Tci2, Tco2, Tcl2, (), Tei2, Teo2, Tel2, Gs, Gi, Go, Gl, Fs, Fi, Fo, Fl, Rp>
Sets the tessellation shaders to use.
fn tessellation_shaders_disabled(self) -> Self
Sets the tessellation shaders stage as disabled. This is the default.
fn geometry_shader<Gi2, Go2, Gl2>(
self,
shader: GeometryShaderEntryPoint<'a, (), Gi2, Go2, Gl2>,
specialization_constants: ()
) -> GraphicsPipelineBuilder<'a, Vdef, Vsp, Vi, Vo, Vl, Tcs, Tci, Tco, Tcl, Tes, Tei, Teo, Tel, (), Gi2, Go2, Gl2, Fs, Fi, Fo, Fl, Rp>
self,
shader: GeometryShaderEntryPoint<'a, (), Gi2, Go2, Gl2>,
specialization_constants: ()
) -> GraphicsPipelineBuilder<'a, Vdef, Vsp, Vi, Vo, Vl, Tcs, Tci, Tco, Tcl, Tes, Tei, Teo, Tel, (), Gi2, Go2, Gl2, Fs, Fi, Fo, Fl, Rp>
Sets the geometry shader to use.
fn geometry_shader_disabled(self) -> Self
Sets the geometry shader stage as disabled. This is the default.
fn viewports<I>(self, viewports: I) -> Self where
I: IntoIterator<Item = Viewport>,
I: IntoIterator<Item = Viewport>,
Sets the viewports to some value, and the scissor boxes to boxes that always cover the whole viewport.
fn viewports_scissors<I>(self, viewports: I) -> Self where
I: IntoIterator<Item = (Viewport, Scissor)>,
I: IntoIterator<Item = (Viewport, Scissor)>,
Sets the characteristics of viewports and scissor boxes in advance.
fn viewports_dynamic_scissors_fixed<I>(self, scissors: I) -> Self where
I: IntoIterator<Item = Scissor>,
I: IntoIterator<Item = Scissor>,
Sets the scissor boxes to some values, and viewports to dynamic. The viewports will need to be set before drawing.
fn viewports_dynamic_scissors_irrelevant(self, num: u32) -> Self
Sets the viewports to dynamic, and the scissor boxes to boxes that always cover the whole viewport. The viewports will need to be set before drawing.
fn viewports_fixed_scissors_dynamic<I>(self, viewports: I) -> Self where
I: IntoIterator<Item = Viewport>,
I: IntoIterator<Item = Viewport>,
Sets the viewports to some values, and scissor boxes to dynamic. The scissor boxes will need to be set before drawing.
fn viewports_scissors_dynamic(self, num: u32) -> Self
Sets the viewports and scissor boxes to dynamic. They will both need to be set before drawing.
fn depth_clamp(self, clamp: bool) -> Self
If true, then the depth value of the vertices will be clamped to the range [0.0 ; 1.0]
.
If false, fragments whose depth is outside of this range will be discarded before the
fragment shader even runs.
fn front_face_counter_clockwise(self) -> Self
Sets the front-facing faces to couner-clockwise faces. This is the default.
Triangles whose vertices are oriented counter-clockwise on the screen will be considered as facing their front. Otherwise they will be considered as facing their back.
fn front_face_clockwise(self) -> Self
Sets the front-facing faces to clockwise faces.
Triangles whose vertices are oriented clockwise on the screen will be considered as facing their front. Otherwise they will be considered as facing their back.
fn cull_mode_disabled(self) -> Self
Sets backface culling as disabled. This is the default.
fn cull_mode_front(self) -> Self
Sets backface culling to front faces. The front faces (as chosen with the front_face_*
methods) will be discarded by the GPU when drawing.
fn cull_mode_back(self) -> Self
Sets backface culling to back faces. Faces that are not facing the front (as chosen with
the front_face_*
methods) will be discarded by the GPU when drawing.
fn cull_mode_front_and_back(self) -> Self
Sets backface culling to both front and back faces. All the faces will be discarded.
Note: This option exists for the sake of completeness. It has no known practical usage.
fn polygon_mode_fill(self) -> Self
Sets the polygon mode to "fill". This is the default.
fn polygon_mode_line(self) -> Self
Sets the polygon mode to "line". Triangles will each be turned into three lines.
fn polygon_mode_point(self) -> Self
Sets the polygon mode to "point". Triangles and lines will each be turned into three points.
fn line_width(self, value: f32) -> Self
Sets the width of the lines, if the GPU needs to draw lines. The default is 1.0
.
fn line_width_dynamic(self) -> Self
Sets the width of the lines as dynamic, which means that you will need to set this value when drawing.
fn fragment_shader<Fi2, Fo2, Fl2>(
self,
shader: FragmentShaderEntryPoint<'a, (), Fi2, Fo2, Fl2>,
specialization_constants: ()
) -> GraphicsPipelineBuilder<'a, Vdef, Vsp, Vi, Vo, Vl, Tcs, Tci, Tco, Tcl, Tes, Tei, Teo, Tel, Gs, Gi, Go, Gl, (), Fi2, Fo2, Fl2, Rp>
self,
shader: FragmentShaderEntryPoint<'a, (), Fi2, Fo2, Fl2>,
specialization_constants: ()
) -> GraphicsPipelineBuilder<'a, Vdef, Vsp, Vi, Vo, Vl, Tcs, Tci, Tco, Tcl, Tes, Tei, Teo, Tel, Gs, Gi, Go, Gl, (), Fi2, Fo2, Fl2, Rp>
Sets the fragment shader to use.
The fragment shader is run once for each pixel that is covered by each primitive.
fn depth_stencil(self, depth_stencil: DepthStencil) -> Self
Sets the depth/stencil configuration. This function may be removed in the future.
fn depth_stencil_disabled(self) -> Self
Sets the depth/stencil tests as disabled.
Note: This is a shortcut for all the other
depth_*
anddepth_stencil_*
methods of the builder.
fn depth_stencil_simple_depth(self) -> Self
Sets the depth/stencil tests as a simple depth test and no stencil test.
Note: This is a shortcut for setting the depth test to
Less
, the depth write Intotrue
and disable the stencil test.
fn depth_write(self, write: bool) -> Self
Sets whether the depth buffer will be written.
fn blend_collective(self, blend: AttachmentBlend) -> Self
fn blend_individual<I>(self, blend: I) -> Self where
I: IntoIterator<Item = AttachmentBlend>,
I: IntoIterator<Item = AttachmentBlend>,
fn blend_pass_through(self) -> Self
Each fragment shader output will have its value directly written to the framebuffer attachment. This is the default.
fn blend_alpha_blending(self) -> Self
fn blend_logic_op(self, logic_op: LogicOp) -> Self
fn blend_logic_op_disabled(self) -> Self
Sets the logic operation as disabled. This is the default.
fn blend_constants(self, constants: [f32; 4]) -> Self
Sets the blend constant. The default is [0.0, 0.0, 0.0, 0.0]
.
The blend constant is used for some blending calculations. It is irrelevant otherwise.
fn blend_constants_dynamic(self) -> Self
Sets the blend constant value as dynamic. Its value will need to be set before drawing.
The blend constant is used for some blending calculations. It is irrelevant otherwise.
fn render_pass<Rp2>(
self,
subpass: Subpass<Rp2>
) -> GraphicsPipelineBuilder<'a, Vdef, Vsp, Vi, Vo, Vl, Tcs, Tci, Tco, Tcl, Tes, Tei, Teo, Tel, Gs, Gi, Go, Gl, Fs, Fi, Fo, Fl, Rp2>
self,
subpass: Subpass<Rp2>
) -> GraphicsPipelineBuilder<'a, Vdef, Vsp, Vi, Vo, Vl, Tcs, Tci, Tco, Tcl, Tes, Tei, Teo, Tel, Gs, Gi, Go, Gl, Fs, Fi, Fo, Fl, Rp2>
Sets the render pass subpass to use.