pub enum CompareFunction {
Never,
Less,
Equal,
LessEqual,
Greater,
NotEqual,
GreaterEqual,
Always,
}Expand description
The comparison performed between two values, used both for depth tests and for comparison samplers.
Replaces the bare &'static str that
GpuSamplerDescriptor.compare could not express: a bool there forced
the renderer to hardcode a single comparison, while
SamplerDescriptor::compare carries the comparison itself as
Option<CompareFunction> — None for a plain filtering sampler.
Variants§
Never
Never passes: the test always fails.
Less
Passes when the incoming value is strictly less than the reference.
Equal
Passes when the two values are equal.
LessEqual
Passes when the incoming value is less than or equal to the reference.
Greater
Passes when the incoming value is strictly greater than the reference.
NotEqual
Passes when the two values differ.
GreaterEqual
Passes when the incoming value is greater than or equal to the reference.
Always
Always passes: the test never fails.
Useful for an always-visible overlay drawn after the opaque pass, where the depth buffer must be bound but must not reject anything.