logo
pub struct DepthState {
    pub enable_dynamic: bool,
    pub write_enable: StateMode<bool>,
    pub compare_op: StateMode<CompareOp>,
}
Expand description

The state in a graphics pipeline describing how the depth test should behave when enabled.

Fields

enable_dynamic: bool

Sets whether depth testing should be enabled and disabled dynamically. If set to false, depth testing is always enabled.

If set to true, the device API version must be at least 1.3, or the extended_dynamic_state feature must be enabled on the device.

write_enable: StateMode<bool>

Sets whether the value in the depth buffer will be updated when the depth test succeeds.

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.

compare_op: StateMode<CompareOp>

Comparison operation to use between the depth value of each incoming fragment and the depth value currently in the depth buffer.

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.

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

Creates a DepthState with no dynamic state, depth writes disabled and compare_op set to always pass.

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

Returns the argument unchanged.

Calls U::from(self).

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

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.