Struct DepthStencilState
#[repr(C)]pub struct DepthStencilState {
pub format: TextureFormat,
pub depth_write_enabled: Option<bool>,
pub depth_compare: Option<CompareFunction>,
pub stencil: StencilState,
pub bias: DepthBiasState,
}unstable-wgpu-29 only.Expand description
Describes the depth/stencil state in a render pipeline.
Corresponds to WebGPU GPUDepthStencilState.
Fields§
§format: TextureFormatFormat of the depth/stencil buffer, must be special depth format. Must match the format
of the depth/stencil attachment in CommandEncoder::begin_render_pass.
depth_write_enabled: Option<bool>Whether to write updated depth values to the depth attachment.
If format is a depth or depth/stencil format, then this must be Some.
Otherwise, specifying None is preferred, but Some(false) is also
accepted.
depth_compare: Option<CompareFunction>Comparison function used to compare depth values in the depth test.
If depth_write_enabled is Some(true) or if depth_fail_op for either
stencil face is not Keep, then this must be Some. Otherwise, specifying
None is preferred, but Some(CompareFunction::Always) is also accepted.
stencil: StencilStateStencil state.
bias: DepthBiasStateDepth bias state.
Implementations§
§impl DepthStencilState
impl DepthStencilState
pub fn stencil(
format: TextureFormat,
stencil: StencilState,
) -> DepthStencilState
Available on crate feature wgpu-29 only.
pub fn stencil( format: TextureFormat, stencil: StencilState, ) -> DepthStencilState
wgpu-29 only.Construct DepthStencilState for a stencil operation with no depth operation.
Panics if format does not have a stencil aspect.
pub fn is_depth_enabled(&self) -> bool
Available on crate feature wgpu-29 only.
pub fn is_depth_enabled(&self) -> bool
wgpu-29 only.Returns true if the depth testing is enabled.
pub fn is_depth_read_only(&self) -> bool
Available on crate feature wgpu-29 only.
pub fn is_depth_read_only(&self) -> bool
wgpu-29 only.Returns true if the state doesn’t mutate the depth buffer.
pub fn is_stencil_read_only(&self, cull_mode: Option<Face>) -> bool
Available on crate feature wgpu-29 only.
pub fn is_stencil_read_only(&self, cull_mode: Option<Face>) -> bool
wgpu-29 only.Returns true if the state doesn’t mutate the stencil.
pub fn is_read_only(&self, cull_mode: Option<Face>) -> bool
Available on crate feature wgpu-29 only.
pub fn is_read_only(&self, cull_mode: Option<Face>) -> bool
wgpu-29 only.Returns true if the state doesn’t mutate either depth or stencil of the target.
Trait Implementations§
§impl Clone for DepthStencilState
impl Clone for DepthStencilState
§fn clone(&self) -> DepthStencilState
fn clone(&self) -> DepthStencilState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for DepthStencilState
impl Debug for DepthStencilState
§impl Hash for DepthStencilState
impl Hash for DepthStencilState
§impl PartialEq for DepthStencilState
impl PartialEq for DepthStencilState
§fn eq(&self, other: &DepthStencilState) -> bool
fn eq(&self, other: &DepthStencilState) -> bool
self and other values to be equal, and is used by ==.impl Eq for DepthStencilState
impl StructuralPartialEq for DepthStencilState
Auto Trait Implementations§
impl Freeze for DepthStencilState
impl RefUnwindSafe for DepthStencilState
impl Send for DepthStencilState
impl Sync for DepthStencilState
impl Unpin for DepthStencilState
impl UnsafeUnpin for DepthStencilState
impl UnwindSafe for DepthStencilState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.