macos: `anti_aliasing` example crashes when MSAA is set to 8 samples
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
## Bevy version
main, since #14273
## Relevant system information
SystemInfo { os: "MacOS 14.5 ", kernel: "23.5.0", cpu: "Apple M1 Max", core_count: "10", memory: "64.0 GiB" }
AdapterInfo { name: "Apple M1 Max", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }
## What you did
1. `cargo run --example anti_aliasting`
2. Select MSAA
3. Select 8 samples
## What went wrong
App crashes
```
2024-10-09T15:29:05.575172Z ERROR wgpu_core::device::global: Device::create_texture error: Sample count 8 is not supported by format Rgba16Float on this device. The WebGPU spec guarantees [1, 4] samples are supported by this format. With the TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES feature your device supports [1, 2, 4].
2024-10-09T15:29:05.575243Z ERROR wgpu::backend::wgpu_core: Handling wgpu errors as fatal by default
thread 'Compute Task Pool (0)' panicked at /Users/me/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.20.1/src/backend/wgpu_core.rs:2996:5:
wgpu error: Validation Error
Caused by:
In Device::create_texture
note: label = `main_texture_sampled`
Sample count 8 is not supported by format Rgba16Float on this device. The WebGPU spec guarantees [1, 4] samples are supported by this format. With the TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES feature your device supports [1, 2, 4].
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Encountered a panic in system `bevy_render::view::prepare_view_targets`!
```
## Additional information
Before this PR, the app would not crash, and would emit a helpful warning.
```
2024-10-09T15:28:24.305025Z WARN bevy_render::view::window: MSAA 8x is not supported on this device. Falling back to MSAA 4x.
```
Contributor guide
Research direction
Reproduce the failure with the anti_aliasing example on macOS by selecting MSAA and 8 samples. Start from the prepare_view_targets panic and the main_texture_sampled validation error, then compare the current behavior with the warning shown in the issue. Done means unsupported 8x MSAA no longer crashes and the application reports or falls back from the unsupported sample count.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- computer-graphics, game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100