Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
franklinblanco opened this issue Mar 12, 2024 · 1 comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior C-Crash A sudden unexpected crash

Comments

@franklinblanco
Copy link
Contributor

franklinblanco commented Mar 12, 2024

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:

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 '<unnamed>' panicked at <REDACTED>/.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 <REDACTED>/.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  <REDACTED>/.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.

wgpu_panic.mov

Thanks to the bevy devs for your hard work!

@franklinblanco franklinblanco added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Mar 12, 2024
@franklinblanco
Copy link
Contributor Author

franklinblanco commented Mar 12, 2024

Since I haven't been able to replicate the Bug anywhere else, I'll attach a video of what happens when I remove the material.

transmissive_material_removed.mov

@james7132 james7132 added A-Rendering Drawing game state to the screen C-Crash A sudden unexpected crash and removed S-Needs-Triage This issue needs to be labelled labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior C-Crash A sudden unexpected crash
Projects
None yet
Development

No branches or pull requests

2 participants