Struct vulkano::pipeline::graphics::rasterization::RasterizationState
source · [−]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 device API version must be at least 1.3, or 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 device API version must be at least 1.3, or 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 device API version must be at least 1.3, or 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
sourceimpl RasterizationState
impl RasterizationState
sourcepub fn new() -> Self
pub fn new() -> Self
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.
sourcepub fn polygon_mode(self, polygon_mode: PolygonMode) -> Self
pub fn polygon_mode(self, polygon_mode: PolygonMode) -> Self
Sets the polygon mode.
sourcepub fn cull_mode_dynamic(self) -> Self
pub fn cull_mode_dynamic(self) -> Self
Sets the cull mode to dynamic.
sourcepub fn front_face(self, front_face: FrontFace) -> Self
pub fn front_face(self, front_face: FrontFace) -> Self
Sets the front face.
sourcepub fn front_face_dynamic(self) -> Self
pub fn front_face_dynamic(self) -> Self
Sets the front face to dynamic.
Trait Implementations
sourceimpl Clone for RasterizationState
impl Clone for RasterizationState
sourcefn clone(&self) -> RasterizationState
fn clone(&self) -> RasterizationState
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for RasterizationState
impl Debug for RasterizationState
sourceimpl Default for RasterizationState
impl Default for RasterizationState
sourcefn default() -> Self
fn default() -> Self
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more