bevyengine / bevyengine/bevy

WGPU Panic when there's a transmission material in scene and camera is switched

Open
#12,445 1 comment 0 reactions 0 assignees View on GitHub
A-Rendering C-Bug I-Crash
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## Bevy version
0.13

## Relevant system information
`cargo 1.77.0-nightly (1ae631085 2024-01-17)`

`AdapterInfo { name: "Apple M1 Pro", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }`

## What you did

I Spawned a Cube mesh and gave it the following StandardMaterial:

```rust
materials.add(StandardMaterial {
base_color: Color::Rgba { red: 0.455, green: 1.0, blue: 0.905, alpha: 1.0 },
specular_transmission: 0.95,
diffuse_transmission: 0.0,
thickness: 1.8,
ior: 1.0,
perceptual_roughness: 0.05,
reflectance: 0.5,
..default()
});
```

Then, I clicked my keybind for opening the bevy_editor_pls once, all good, then I clicked the keybind again, which takes me out of the inspector view, and then once again, and then I get a panic.

I did this a couple of times and can confirm, it always happens the second time.

### Note: This only seems to happen when I move around with the camera and do

## What went wrong

This is the error message in the console:

```
ERROR log: Handling wgpu errors as fatal by default
thread '' panicked at /.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.19.1/src/backend/wgpu_core.rs:3009:5:
wgpu error: Validation Error

Caused by:
In CommandEncoder::copy_texture_to_texture
Copy error
Source format (Rgba8UnormSrgb) and destination format (Rgba16Float) are not copy-compatible (they may only differ in srgb-ness)

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Encountered a panic in exclusive system `bevy_render::renderer::render_system`!
thread 'Compute Task Pool (1)' panicked at /.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_render-0.13.0/src/pipelined_rendering.rs:49:67:
called `Result::unwrap()` on an `Err` value: RecvError
thread 'main' panicked at /.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.11/src/platform_impl/macos/app_state.rs:387:33:
called `Result::unwrap()` on an `Err` value: PoisonError { .. }
```

## Additional information

I'm attempting to replicate this in a small repo I can upload. I'll add a comment if I get it. But meanwhile I thought I could report on this!
Video Demo, the end of the video is when it panicked.

https://github.com/bevyengine/bevy/assets/72827992/b8ec5cf7-c070-4f6c-ae53-a5b8f3380c72

Thanks to the bevy devs for your hard work!

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.