Skip to content

A crash occurs when removing ScreenSpaceReflections in the ssr example. #22999

@Breakdown-Dog

Description

@Breakdown-Dog

Bevy version and features

  • main branch

[Optional] Relevant system information

  • the Rust version you're using
    • rustc 1.92.0 (ded5c06cf 2025-12-08)
  • the operating system or browser used, including its version
    • Windows 11 Home, kernel: "22631"
`2026-02-17T09:12:51.340485Z  INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce RTX 4060 Laptop GPU", vendor: 4318, device: 10400, device_type: DiscreteGpu, device_pci_bus_id: "0000:01:00.0", driver: "NVIDIA", driver_info: "591.74", backend: Vulkan, subgroup_min_size: 32, subgroup_max_size: 32, transient_saves_memory: false }`

What you did

I encountered a crash in the ‘ssr’ example when I tried to disable the SSR effect.

What went wrong

2026-02-17T10:20:50.655628Z  INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce RTX 4060 Laptop GPU", vendor: 4318, device: 10400, device_type: DiscreteGpu, device_pci_bus_id: "0000:01:00.0", driver: "NVIDIA", driver_info: "591.74", backend: Vulkan, subgroup_min_size: 32, subgroup_max_size: 32, transient_saves_memory: false }
2026-02-17T10:20:51.893735Z  INFO bevy_render::batching::gpu_preprocessing: GPU preprocessing is fully supported on this device.
2026-02-17T10:20:51.902804Z  INFO bevy_winit::system: Creating new window Bevy Screen Space Reflections Example (65v0)
2026-02-17T10:20:52.291256Z  WARN bevy_pbr::render::mesh_view_bindings: Too many textures in mesh pipeline view layout, this might cause us to hit `wgpu::Limits::max_sampled_textures_per_shader_stage` in some environments.
2026-02-17T10:21:00.939648Z ERROR bevy_render::error_handler: Caught DeviceLost error: Unknown Unexpected error variant (driver implementation is at fault)

thread 'Compute Task Pool (4)' (16776) panicked at crates\bevy_render\src\view\window\mod.rs:309:17:
Couldn't get swap chain texture, operation unrecoverable: Acquiring a texture failed with a generic error. Check error callbacks for more information
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Encountered a panic in system `<Enable the debug feature to see the name>`!

thread 'Compute Task Pool (4)' (16776) panicked at D:\CodeGroup\bevy\crates\bevy_render\src\render_resource\uniform_buffer.rs:312:18:
called `Option::unwrap()` on a `None` value

thread 'Compute Task Pool (2)' (5600) panicked at D:\CodeGroup\bevy\crates\bevy_render\src\render_resource\uniform_buffer.rs:312:18:
called `Option::unwrap()` on a `None` value
Encountered a panic in system `
thread 'main' (14264) panicked at crates\bevy_render\src\render_resource\uniform_buffer.rs:312:18:
called `Option::unwrap()` on a `None` value

thread 'Compute Task Pool (3)' (15544) panicked at C:\Users\genCode\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\wgpu-28.0.0\src\backend\wgpu_core.rs:2231:18:
Error in Buffer::get_mapped_range: Validation Error

Caused by:
  Buffer with 'thickness_buffer' label is invalid


thread 'Compute Task Pool (0)' (29512) panicked at C:\Users\genCode\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\wgpu-28.0.0\src\backend\wgpu_core.rs:2231:18:
Error in Buffer::get_mapped_range: Validation Error

Caused by:
  Buffer with '' label is invalid

<Enable the debug feature to see the name>
thread 'Compute Task Pool (5)' (22152) panicked at D:\CodeGroup\bevy\crates\bevy_render\src\render_resource\uniform_buffer.rs:312:18:
called `Option::unwrap()` on a `None` value
`!

thread 'Compute Task Pool (1)' (10512) panicked at D:\CodeGroup\bevy\crates\bevy_render\src\render_resource\uniform_buffer.rs:312:18:
called `Option::unwrap()` on a `None` value
Encountered a panic in system `
thread 'Compute Task Pool (4)' (16776) panicked at D:\CodeGroup\bevy\crates\bevy_render\src\render_resource\uniform_buffer.rs:312:18:
called `Option::unwrap()` on a `None` value
<Enable the debug feature to see the name>`!
Encountered a panic in system `<Enable the debug feature to see the name>`!
Encountered a panic in system `
thread 'main' (14264) panicked at D:\CodeGroup\bevy\crates\bevy_render\src\render_resource\uniform_buffer.rs:312:18:
called `Option::unwrap()` on a `None` value
<Enable the debug feature to see the name>
thread 'Compute Task Pool (2)' (5600) panicked at D:\CodeGroup\bevy\crates\bevy_render\src\render_resource\uniform_buffer.rs:312:18:
called `Option::unwrap()` on a `None` value
`!
Encountered a panic in system `<Enable the debug feature to see the name>`!
Encountered a panic in system `<Enable the debug feature to see the name>`!
Encountered a panic in system `<Enable the debug feature to see the name>`!
Encountered a panic in system `<Enable the debug feature to see the name>`!
Encountered a panic in system `<Enable the debug feature to see the name>`!
Encountered a panic in system `<Enable the debug feature to see the name>`!
Encountered a panic in system `<Enable the debug feature to see the name>`!
error: process didn't exit successfully: `target\debug\examples\ssr.exe` (exit code: 2173)

Additional information

Relevant Code:

for camera in cameras.iter_mut() {
    if app_settings.ssr_on {
        commands.entity(camera).insert(ScreenSpaceReflections {
            min_perceptual_roughness: app_settings.min_perceptual_roughness.clone(),
            max_perceptual_roughness: app_settings.max_perceptual_roughness.clone(),
            edge_fadeout: app_settings.edge_fadeout.clone(),
            ..default()
        });
    } else {
        commands.entity(camera).remove::<ScreenSpaceReflections>();
    }
}

I wonder if this issue is specific to my machine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenC-BugAn unexpected or incorrect behaviorP-CrashA sudden unexpected crashS-Needs-InvestigationThis issue requires detective work to figure out what's going wrong

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions