From eac4faea71d2acf0c18f1f31b1b26bf64ae6249a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Miguel=20S=C3=A1nchez=20Garc=C3=ADa?= Date: Sat, 2 Mar 2024 15:30:42 +0100 Subject: [PATCH] Add `DepthState::reverse` helper method (#2483) --- vulkano/src/pipeline/graphics/depth_stencil.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vulkano/src/pipeline/graphics/depth_stencil.rs b/vulkano/src/pipeline/graphics/depth_stencil.rs index 059434ac..d4bb88af 100644 --- a/vulkano/src/pipeline/graphics/depth_stencil.rs +++ b/vulkano/src/pipeline/graphics/depth_stencil.rs @@ -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> { let Self { write_enable: _,