Enum wgpu_types::CompareFunction
source · #[repr(C)]pub enum CompareFunction {
Never,
Less,
Equal,
LessEqual,
Greater,
NotEqual,
GreaterEqual,
Always,
}
Expand description
Comparison function used for depth and stencil operations.
Corresponds to WebGPU GPUCompareFunction
.
Variants§
Never
Function never passes
Less
Function passes if new value less than existing value
Equal
Function passes if new value is equal to existing value. When using
this compare function, make sure to mark your Vertex Shader’s @builtin(position)
output as @invariant
to prevent artifacting.
LessEqual
Function passes if new value is less than or equal to existing value
Greater
Function passes if new value is greater than existing value
NotEqual
Function passes if new value is not equal to existing value. When using
this compare function, make sure to mark your Vertex Shader’s @builtin(position)
output as @invariant
to prevent artifacting.
GreaterEqual
Function passes if new value is greater than or equal to existing value
Always
Function always passes
Implementations§
source§impl CompareFunction
impl CompareFunction
sourcepub fn needs_ref_value(self) -> bool
pub fn needs_ref_value(self) -> bool
Returns true if the comparison depends on the reference value.
Trait Implementations§
source§impl Clone for CompareFunction
impl Clone for CompareFunction
source§fn clone(&self) -> CompareFunction
fn clone(&self) -> CompareFunction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CompareFunction
impl Debug for CompareFunction
source§impl<'de> Deserialize<'de> for CompareFunction
impl<'de> Deserialize<'de> for CompareFunction
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl Hash for CompareFunction
impl Hash for CompareFunction
source§impl PartialEq<CompareFunction> for CompareFunction
impl PartialEq<CompareFunction> for CompareFunction
source§fn eq(&self, other: &CompareFunction) -> bool
fn eq(&self, other: &CompareFunction) -> bool
self
and other
values to be equal, and is used
by ==
.