docs/bevy/release-content/migration-guides/depth_attachment_changes.md 1.1 K · 12 lines · raw · history

1 ---
2 title: "Changes have been made to `DepthAttachment`, `ViewDepthTexture` and `ViewPrepassTextures::depth` to accommodate stencil support"
3 pull_requests: [24725]
4 ---
5
6 - The original `DepthAttachment` has been renamed to `DepthStencilViewAttachment`, which holds a new `DepthStencilViews` instead of a `TextureView`. It requires specifying views for the combined depth-stencil, depth-only, and stencil-only aspects, as well as a clear value for stencil.
7 - A new `DepthStencilAttachment` has been introduced, containing a `CachedTexture` and its corresponding `DepthStencilViewAttachment`, along with an optional depth texture and views from the previous frame.
8 - `ViewDepthTexture` has been renamed to `ViewDepthStencilTexture` which holds a `DepthStencilAttachment` instead of a `Texture`.
9 - `ViewPrepassTextures::depth` is now `Option<DepthStencilAttachment>` instead of `Option<ColorAttachment>`.
10
11 To ensure compatibility with future custom depth formats, such as combined depth-stencil and stencil-only formats,
12 choose between a single-aspect view (for resource binding in shaders) and an all-aspect view (for render attachments) based on how it will be used.