bevy/crates/bevy_core_pipeline/src
JMS55 70b0eacc3b
Keep track of when a texture is first cleared (#10325)
# Objective
- Custom render passes, or future passes in the engine (such as
https://github.com/bevyengine/bevy/pull/10164) need a better way to know
and indicate to the core passes whether the view color/depth/prepass
attachments have been cleared or not yet this frame, to know if they
should clear it themselves or load it.

## Solution

- For all render targets (depth textures, shadow textures, prepass
textures, main textures) use an atomic bool to track whether or not each
texture has been cleared this frame. Abstracted away in the new
ColorAttachment and DepthAttachment wrappers.

---

## Changelog
- Changed `ViewTarget::get_color_attachment()`, removed arguments.
- Changed `ViewTarget::get_unsampled_color_attachment()`, removed
arguments.
- Removed `Camera3d::clear_color`.
- Removed `Camera2d::clear_color`.
- Added `Camera::clear_color`.
- Added `ExtractedCamera::clear_color`.
- Added `ColorAttachment` and `DepthAttachment` wrappers.
- Moved `ClearColor` and `ClearColorConfig` from
`bevy::core_pipeline::clear_color` to `bevy::render::camera`.
- Core render passes now track when a texture is first bound as an
attachment in order to decide whether to clear or load it.

## Migration Guide
- Remove arguments to `ViewTarget::get_color_attachment()` and
`ViewTarget::get_unsampled_color_attachment()`.
- Configure clear color on `Camera` instead of on `Camera3d` and
`Camera2d`.
- Moved `ClearColor` and `ClearColorConfig` from
`bevy::core_pipeline::clear_color` to `bevy::render::camera`.
- `ViewDepthTexture` must now be created via the `new()` method

---------

Co-authored-by: vero <email@atlasdostal.com>
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
2023-12-31 00:37:37 +00:00
..
blit Bind group layout entries (#10224) 2023-11-28 04:00:49 +00:00
bloom Keep track of when a texture is first cleared (#10325) 2023-12-31 00:37:37 +00:00
contrast_adaptive_sharpening Update to wgpu 0.18 (#10266) 2023-12-14 02:45:47 +00:00
core_2d Keep track of when a texture is first cleared (#10325) 2023-12-31 00:37:37 +00:00
core_3d Keep track of when a texture is first cleared (#10325) 2023-12-31 00:37:37 +00:00
deferred Keep track of when a texture is first cleared (#10325) 2023-12-31 00:37:37 +00:00
fullscreen_vertex_shader Bevy Asset V2 (#8624) 2023-09-07 02:07:27 +00:00
fxaa Update to wgpu 0.18 (#10266) 2023-12-14 02:45:47 +00:00
prepass Keep track of when a texture is first cleared (#10325) 2023-12-31 00:37:37 +00:00
skybox Add clippy::manual_let_else at warn level to lints (#10684) 2023-11-28 04:15:27 +00:00
taa Keep track of when a texture is first cleared (#10325) 2023-12-31 00:37:37 +00:00
tonemapping Update to wgpu 0.18 (#10266) 2023-12-14 02:45:47 +00:00
upscaling Update to wgpu 0.18 (#10266) 2023-12-14 02:45:47 +00:00
lib.rs Keep track of when a texture is first cleared (#10325) 2023-12-31 00:37:37 +00:00
msaa_writeback.rs Keep track of when a texture is first cleared (#10325) 2023-12-31 00:37:37 +00:00