logo
pub struct GraphicsPipelineBuilder<'vs, 'tcs, 'tes, 'gs, 'fs, Vdef, Vss, Tcss, Tess, Gss, Fss> { /* private fields */ }
Expand description

Prototype for a GraphicsPipeline.

Implementations

Builds the graphics pipeline, using an inferred a pipeline layout.

The same as new, but allows you to provide a closure that is given a mutable reference to the inferred descriptor set definitions. This can be used to make changes to the layout before it’s created, for example to add dynamic buffers or immutable samplers.

Builds the graphics pipeline.

Does the same as build, except that build automatically builds the pipeline layout object corresponding to the union of your shaders while this function allows you to specify the pipeline layout.

Sets the vertex shader to use.

Sets the tessellation shaders to use.

Sets the geometry shader to use.

Sets the fragment shader to use.

The fragment shader is run once for each pixel that is covered by each primitive.

Sets the vertex input state.

The default value is VertexInputState::default().

Sets the input assembly state.

The default value is InputAssemblyState::default().

Sets the tessellation state. This is required if the pipeline contains tessellation shaders, and ignored otherwise.

The default value is TessellationState::default().

Sets the viewport state.

The default value is ViewportState::default().

Sets the discard rectangle state.

The default value is DiscardRectangleState::default().

Sets the rasterization state.

The default value is RasterizationState::default().

Sets the multisample state.

The default value is MultisampleState::default().

Sets the depth/stencil state.

The default value is DepthStencilState::default().

Sets the color blend state.

The default value is ColorBlendState::default().

👎 Deprecated since 0.27

Sets the tessellation shaders stage as disabled. This is the default.

👎 Deprecated since 0.27

Sets the geometry shader stage as disabled. This is the default.

👎 Deprecated since 0.27:

Use vertex_input_state instead

Sets the vertex input to a single vertex buffer.

You will most likely need to explicitly specify the template parameter to the type of a vertex.

👎 Deprecated since 0.27:

Use input_assembly_state instead

Sets whether primitive restart is enabled.

👎 Deprecated since 0.27:

Use input_assembly_state instead

Sets the topology of the primitives that are expected by the pipeline.

👎 Deprecated since 0.27:

Use input_assembly_state instead

Sets the topology of the primitives to a list of points.

Note: This is equivalent to self.primitive_topology(PrimitiveTopology::PointList).

👎 Deprecated since 0.27:

Use input_assembly_state instead

Sets the topology of the primitives to a list of lines.

Note: This is equivalent to self.primitive_topology(PrimitiveTopology::LineList).

👎 Deprecated since 0.27:

Use input_assembly_state instead

Sets the topology of the primitives to a line strip.

Note: This is equivalent to self.primitive_topology(PrimitiveTopology::LineStrip).

👎 Deprecated since 0.27:

Use input_assembly_state instead

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).

👎 Deprecated since 0.27:

Use input_assembly_state instead

Sets the topology of the primitives to a triangle strip.

Note: This is equivalent to self.primitive_topology(PrimitiveTopology::TriangleStrip).

👎 Deprecated since 0.27:

Use input_assembly_state instead

Sets the topology of the primitives to a fan of triangles.

Note: This is equivalent to self.primitive_topology(PrimitiveTopology::TriangleFan).

👎 Deprecated since 0.27:

Use input_assembly_state instead

Sets the topology of the primitives to a list of lines with adjacency information.

Note: This is equivalent to self.primitive_topology(PrimitiveTopology::LineListWithAdjacency).

👎 Deprecated since 0.27:

Use input_assembly_state instead

Sets the topology of the primitives to a line strip with adjacency information.

Note: This is equivalent to self.primitive_topology(PrimitiveTopology::LineStripWithAdjacency).

👎 Deprecated since 0.27:

Use input_assembly_state instead

Sets the topology of the primitives to a list of triangles with adjacency information.

Note: This is equivalent to self.primitive_topology(PrimitiveTopology::TriangleListWithAdjacency).

👎 Deprecated since 0.27:

Use input_assembly_state instead

Sets the topology of the primitives to a triangle strip with adjacency information`

Note: This is equivalent to self.primitive_topology(PrimitiveTopology::TriangleStripWithAdjacency).

👎 Deprecated since 0.27:

Use input_assembly_state instead

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).

👎 Deprecated since 0.27:

Use viewport_state instead

Sets the viewports to some value, and the scissor boxes to boxes that always cover the whole viewport.

👎 Deprecated since 0.27:

Use viewport_state instead

Sets the characteristics of viewports and scissor boxes in advance.

👎 Deprecated since 0.27:

Use viewport_state instead

Sets the scissor boxes to some values, and viewports to dynamic. The viewports will need to be set before drawing.

👎 Deprecated since 0.27:

Use viewport_state instead

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.

👎 Deprecated since 0.27:

Use viewport_state instead

Sets the viewports to some values, and scissor boxes to dynamic. The scissor boxes will need to be set before drawing.

👎 Deprecated since 0.27:

Use viewport_state instead

Sets the viewports and scissor boxes to dynamic. They will both need to be set before drawing.

👎 Deprecated since 0.27:

Use rasterization_state instead

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.

👎 Deprecated since 0.27:

Use rasterization_state instead

Sets the front-facing faces to counter-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.

👎 Deprecated since 0.27:

Use rasterization_state instead

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.

👎 Deprecated since 0.27:

Use rasterization_state instead

Sets backface culling as disabled. This is the default.

👎 Deprecated since 0.27:

Use rasterization_state instead

Sets backface culling to front faces. The front faces (as chosen with the front_face_* methods) will be discarded by the GPU when drawing.

👎 Deprecated since 0.27:

Use rasterization_state instead

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.

👎 Deprecated since 0.27:

Use rasterization_state instead

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.

👎 Deprecated since 0.27:

Use rasterization_state instead

Sets the polygon mode to “fill”. This is the default.

👎 Deprecated since 0.27:

Use rasterization_state instead

Sets the polygon mode to “line”. Triangles will each be turned into three lines.

👎 Deprecated since 0.27:

Use rasterization_state instead

Sets the polygon mode to “point”. Triangles and lines will each be turned into three points.

👎 Deprecated since 0.27:

Use rasterization_state instead

Sets the width of the lines, if the GPU needs to draw lines. The default is 1.0.

👎 Deprecated since 0.27:

Use rasterization_state instead

Sets the width of the lines as dynamic, which means that you will need to set this value when drawing.

👎 Deprecated since 0.27:

Use multisample_state instead

Disables sample shading. The fragment shader will only be run once per fragment (ie. per pixel) and not once by sample. The output will then be copied in all of the covered samples.

Sample shading is disabled by default.

👎 Deprecated since 0.27:

Use multisample_state instead

Enables sample shading. The fragment shader will be run once per sample at the borders of the object you’re drawing.

Enabling sampling shading requires the sample_rate_shading feature to be enabled on the device.

The min_fract parameter is the minimum fraction of samples shading. For example if its value is 0.5, then the fragment shader will run for at least half of the samples. The other half of the samples will get their values determined automatically.

Sample shading is disabled by default.

Panic
  • Panics if min_fract is not between 0.0 and 1.0.
👎 Deprecated since 0.27:

Use multisample_state instead

👎 Deprecated since 0.27:

Use multisample_state instead

👎 Deprecated since 0.27:

Use multisample_state instead

Disables alpha-to-one.

Alpha-to-one is disabled by default.

👎 Deprecated since 0.27:

Use multisample_state instead

Enables alpha-to-one. The alpha component of the first color output of the fragment shader will be replaced by the value 1.0.

Enabling alpha-to-one requires the alpha_to_one feature to be enabled on the device.

Alpha-to-one is disabled by default.

👎 Deprecated since 0.27:

Use depth_stencil_state instead

Sets the depth/stencil state.

👎 Deprecated since 0.27:

Use depth_stencil_state instead

Sets the depth/stencil tests as disabled.

Note: This is a shortcut for all the other depth_* and depth_stencil_* methods of the builder.

👎 Deprecated since 0.27:

Use depth_stencil_state instead

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 Into true and disable the stencil test.

👎 Deprecated since 0.27:

Use depth_stencil_state instead

Sets whether the depth buffer will be written.

👎 Deprecated since 0.27:

Use color_blend_state instead

👎 Deprecated since 0.27:

Use color_blend_state instead

👎 Deprecated since 0.27:

Use color_blend_state instead

Each fragment shader output will have its value directly written to the framebuffer attachment. This is the default.

👎 Deprecated since 0.27:

Use color_blend_state instead

👎 Deprecated since 0.27:

Use color_blend_state instead

👎 Deprecated since 0.27:

Use color_blend_state instead

Sets the logic operation as disabled. This is the default.

👎 Deprecated since 0.27:

Use color_blend_state instead

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.

👎 Deprecated since 0.27:

Use color_blend_state instead

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.

Sets the render pass subpass to use.

Enable caching of this pipeline via a PipelineCache object.

If this pipeline already exists in the cache it will be used, if this is a new pipeline it will be inserted into the cache. The implementation handles the PipelineCache.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Builds a pointer to this type from a raw pointer.

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

Returns the size of an individual element.

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.