Struct vulkano::pipeline::graphics::rasterization::RasterizationState [−][src]
pub struct RasterizationState {
pub depth_clamp_enable: bool,
pub rasterizer_discard_enable: StateMode<bool>,
pub polygon_mode: PolygonMode,
pub cull_mode: StateMode<CullMode>,
pub front_face: StateMode<FrontFace>,
pub depth_bias: Option<DepthBiasState>,
pub line_width: StateMode<f32>,
pub line_rasterization_mode: LineRasterizationMode,
pub line_stipple: Option<StateMode<LineStipple>>,
}
Expand description
The state in a graphics pipeline describing how the rasterization stage should behave.
Fields
depth_clamp_enable: bool
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.
If enabled, the depth_clamp
feature must be
enabled on the device.
rasterizer_discard_enable: StateMode<bool>
If true, all the fragments will be discarded, and the fragment shader will not be run. This is usually used when your vertex shader has some side effects and you don’t need to run the fragment shader.
If set to Dynamic
, the
extended_dynamic_state2
feature must
be enabled on the device.
polygon_mode: PolygonMode
This setting can ask the rasterizer to downgrade triangles into lines or points, or lines into points.
If set to a value other than Fill
, the
fill_mode_non_solid
feature must be
enabled on the device.
cull_mode: StateMode<CullMode>
Specifies whether front faces or back faces should be discarded, or none, or both.
If set to Dynamic
, the
extended_dynamic_state
feature must be
enabled on the device.
front_face: StateMode<FrontFace>
Specifies which triangle orientation is considered to be the front of the triangle.
If set to Dynamic
, the
extended_dynamic_state
feature must be
enabled on the device.
depth_bias: Option<DepthBiasState>
Sets how to modify depth values in the rasterization stage.
If set to None
, depth biasing is disabled, the depth values will pass to the fragment
shader unmodified.
line_width: StateMode<f32>
Width, in pixels, of lines when drawing lines.
Setting this to a value other than 1.0 requires the
wide_lines
feature to be enabled on
the device.
line_rasterization_mode: LineRasterizationMode
The rasterization mode for lines.
If this is not set to Default
, the
ext_line_rasterization
extension and an additional feature must be enabled on the device.
line_stipple: Option<StateMode<LineStipple>>
Enables and sets the parameters for line stippling.
If this is set to Some
, the
ext_line_rasterization
extension and an additional feature must be enabled on the device.
Implementations
Creates a RasterizationState
with depth clamping, discard, depth biasing and line
stippling disabled, filled polygons, no culling, counterclockwise front face, and the
default line width and line rasterization mode.
Sets the polygon mode.
Sets the cull mode to dynamic.
Sets the front face.
Sets the front face to dynamic.
Trait Implementations
Returns RasterizationState::new()
.
Auto Trait Implementations
impl RefUnwindSafe for RasterizationState
impl Send for RasterizationState
impl Sync for RasterizationState
impl Unpin for RasterizationState
impl UnwindSafe for RasterizationState
Blanket Implementations
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.