pub struct DepthStencilState {
    pub flags: DepthStencilStateFlags,
    pub depth: Option<DepthState>,
    pub depth_bounds: Option<RangeInclusive<f32>>,
    pub stencil: Option<StencilState>,
    pub _ne: NonExhaustive,
}
Expand description

The state in a graphics pipeline describing how the depth, depth bounds and stencil tests should behave.

Fields§

§flags: DepthStencilStateFlags

Additional properties of the depth/stencil state.

The default value is empty.

§depth: Option<DepthState>

The state of the depth test.

If set to None, the depth test is disabled, all fragments will pass and no depth writes are performed.

The default value is None.

§depth_bounds: Option<RangeInclusive<f32>>

The minimum and maximum depth values to use for the depth bounds test. Fragments with values outside this range are discarded.

If set to None, the depth bounds test is disabled, all fragments will pass.

The default value is None.

§stencil: Option<StencilState>

The state of the stencil test.

If set to None, the stencil test is disabled, all fragments will pass and no stencil writes are performed.

The default value is None.

§_ne: NonExhaustive

Implementations§

source§

impl DepthStencilState

source

pub fn disabled() -> Self

👎Deprecated since 0.34.0: use DepthStencilState::default instead

Creates a DepthStencilState where all tests are disabled and have no effect.

source

pub fn simple_depth_test() -> Self

👎Deprecated since 0.34.0: use DepthState::simple instead

Creates a DepthStencilState with a Less depth test, depth_write set to true, and other tests disabled.

Trait Implementations§

source§

impl Clone for DepthStencilState

source§

fn clone(&self) -> DepthStencilState

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DepthStencilState

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for DepthStencilState

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.