Add DepthState::reverse helper method (#2483)

This commit is contained in:
José Miguel Sánchez García 2024-03-02 15:30:42 +01:00 committed by GitHub
parent 1d2dbd27a2
commit eac4faea71
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -216,6 +216,15 @@ impl DepthState {
} }
} }
/// Returns a `DepthState` with a `Greater` depth test and depth writes enabled.
#[inline]
pub fn reverse() -> Self {
Self {
compare_op: CompareOp::Greater,
write_enable: true,
}
}
pub(crate) fn validate(self, device: &Device) -> Result<(), Box<ValidationError>> { pub(crate) fn validate(self, device: &Device) -> Result<(), Box<ValidationError>> {
let Self { let Self {
write_enable: _, write_enable: _,