From fa09b2cd1984fd4ce13c6d3d036ec39fa5fa33f0 Mon Sep 17 00:00:00 2001 From: Kyle Mayes Date: Fri, 22 Sep 2023 21:00:06 -0400 Subject: [PATCH] Add note calling out pattern vs. bitwise OR usage of `|` (#208) --- tutorial/book/src/model/depth_buffering.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tutorial/book/src/model/depth_buffering.md b/tutorial/book/src/model/depth_buffering.md index 00bda53..023b340 100644 --- a/tutorial/book/src/model/depth_buffering.md +++ b/tutorial/book/src/model/depth_buffering.md @@ -350,6 +350,8 @@ transition_image_layout( The undefined layout can be used as initial layout, because there are no existing depth image contents that matter. We need to update some of the logic in `transition_image_layout` to use the right subresource aspect: +> **Note:** The first usage of the `|` operator below describes a [*pattern*](https://doc.rust-lang.org/book/ch18-03-pattern-syntax.html) that matches either of the specified `vk::Format`s in the `match` arm. Meanwhile, the second usage of the `|` operator is the [*bitwise OR operator*](https://doc.rust-lang.org/std/ops/trait.BitOr.html) which combines the bits of the `vk::ImageAspectFlags` we want to enable in this code path. + ```rust,noplaypen let aspect_mask = if new_layout == vk::ImageLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL { match format {