bevyengine / bevyengine/bevy

Cameras with RenderTarget::Image freeze when their Image is mutably accessed

Open
#6,480 5 comments 0 reactions 0 assignees View on GitHub
A-Rendering C-Bug
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## Bevy version

0.8.1 and main branch on commit ea4aeff9ec8e204b8d4bc8cbb10c28e90fe271ff

## \[Optional\] Relevant system information

```ignore
AdapterInfo { name: "NVIDIA GeForce RTX 3080 Ti", vendor: 4318, device: 8712, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "512.15", backend: Vulkan }
```

## What you did

I modified the example [post_processing.rs](https://github.com/bevyengine/bevy/blob/ea4aeff9ec8e204b8d4bc8cbb10c28e90fe271ff/examples/shader/post_processing.rs) by adding this system:

```rust
fn break_all_render_textures_system(mut images: ResMut>) {
for _ in images.iter_mut() {}
}
```

Accessing the images with `images.get_mut` will have the same effect.

## What went wrong

I was expecting to see a spinning cube with chromatic aberration. Instead, I see a *still* cube with chromatic aberration. Bevy is only rendering the first frame and then freezing.

Expected:
![Recording 2022-11-05 at 04 30 43](https://user-images.githubusercontent.com/3348363/200115685-1db5cb1f-346a-4fed-90fb-ecd46069f2af.gif)

Actual:
![Recording 2022-11-05 at 04 29 20](https://user-images.githubusercontent.com/3348363/200115700-8060b710-8f57-4e2d-ae8e-aedc7c9c0923.gif)

## Additional information

On 0.8.1, when using this mutable access to resize the image, I needed to use a workaround from #5595 (which seems to be fixed on main right now).

It seems like a stale render texture is being used. If the Image is resized, the shown frozen image is still at the old size.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.