Skip to content

Commit

Permalink
Add note calling out pattern vs. bitwise OR usage of | (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleMayes committed Sep 23, 2023
1 parent 1b5fa3b commit fa09b2c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tutorial/book/src/model/depth_buffering.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit fa09b2c

Please sign in to comment.