Struct vulkano::pipeline::graphics::rasterization::RasterizationState
source · pub struct RasterizationState {
pub depth_clamp_enable: bool,
pub rasterizer_discard_enable: bool,
pub polygon_mode: PolygonMode,
pub cull_mode: CullMode,
pub front_face: FrontFace,
pub depth_bias: Option<DepthBiasState>,
pub line_width: f32,
pub line_rasterization_mode: LineRasterizationMode,
pub line_stipple: Option<LineStipple>,
pub _ne: NonExhaustive,
}
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.
The default value is false
.
rasterizer_discard_enable: 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.
The default value is false
.
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.
The default value is PolygonMode::Fill
.
cull_mode: CullMode
Specifies whether front faces or back faces should be discarded, or none, or both.
The default value is CullMode::None
.
front_face: FrontFace
Specifies which triangle orientation is considered to be the front of the triangle.
The default value is FrontFace::CounterClockwise
.
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.
The default value is None
.
line_width: 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.
The default value is 1.0
.
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.
The default value is LineRasterizationMode::Default
.
line_stipple: Option<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.
The default value is None
.
_ne: NonExhaustive
Implementations§
source§impl RasterizationState
impl RasterizationState
sourcepub fn new() -> Self
👎Deprecated since 0.34.0: use RasterizationState::default
instead
pub fn new() -> Self
RasterizationState::default
insteadCreates 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.
sourcepub fn polygon_mode(self, polygon_mode: PolygonMode) -> Self
👎Deprecated since 0.34.0
pub fn polygon_mode(self, polygon_mode: PolygonMode) -> Self
Sets the polygon mode.
sourcepub fn cull_mode(self, cull_mode: CullMode) -> Self
👎Deprecated since 0.34.0
pub fn cull_mode(self, cull_mode: CullMode) -> Self
Sets the cull mode.
sourcepub fn front_face(self, front_face: FrontFace) -> Self
👎Deprecated since 0.34.0
pub fn front_face(self, front_face: FrontFace) -> Self
Sets the front face.
Trait Implementations§
source§impl Clone for RasterizationState
impl Clone for RasterizationState
source§fn clone(&self) -> RasterizationState
fn clone(&self) -> RasterizationState
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more