3D causes wgpu error spam in console when using GLES
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
## Bevy version
0.13.2; main (9d59e52bb0deb7ae4ea002541bd8cbf2ccb0b4eb)
## Relevant system information
```
SystemInfo { os: "Linux 39 Fedora Linux Asahi Remix", kernel: "6.8.7-402.asahi.fc39.aarch64+16k", cpu: "Icestorm-M1-Pro", core_count: "10", memory: "30.9 GiB" }
AdapterInfo { name: "Apple M1 Pro (G13S C0)", vendor: 65541, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Gl }
```
## What you did
Run any Bevy app that does 3D rendering with `StandardMaterial`. As an easy reproduction, you can try the `pbr` example, or the `3d_scene` example.
```
WGPU_BACKEND=gl cargo run --features wayland --example pbr
```
## What went wrong
The console/log is filled with messages like:
```
2024-04-27T09:02:59.687567Z ERROR wgpu_hal::gles: wgpu-hal heuristics assumed that the view dimension will be equal to `Cube` rather than `CubeArray`.
`D2` textures with `depth_or_array_layers == 1` are assumed to have view dimension `D2`
`D2` textures with `depth_or_array_layers > 1` are assumed to have view dimension `D2Array`
`D2` textures with `depth_or_array_layers == 6` are assumed to have view dimension `Cube`
`D2` textures with `depth_or_array_layers > 6 && depth_or_array_layers % 6 == 0` are assumed to have view dimension `CubeArray`
2024-04-27T09:02:59.687599Z ERROR wgpu_hal::gles: wgpu-hal heuristics assumed that the view dimension will be equal to `D2` rather than `D2Array`.
`D2` textures with `depth_or_array_layers == 1` are assumed to have view dimension `D2`
`D2` textures with `depth_or_array_layers > 1` are assumed to have view dimension `D2Array`
`D2` textures with `depth_or_array_layers == 6` are assumed to have view dimension `Cube`
`D2` textures with `depth_or_array_layers > 6 && depth_or_array_layers % 6 == 0` are assumed to have view dimension `CubeArray`
```
The app runs fine, rendering is working, everything looks correct. But these messages are very annoying. They are output every frame and drown out everything else in the console. I have to set custom log filters to hide them.
## Additional information
On Asahi Linux, Bevy seems to default to CPU Vulkan rendering, which, besides being very slow, does not produce the messages above (which come from wgpu's GLES backend). To actually use the GPU, you have to set `WGPU_BACKEND=gl`. Asahi does not yet have a GPU Vulkan driver.
(this behavior may be related to #13113 ; for some reason Bevy seems to be choosing CPU Vulkan on systems with a perfectly usable GPU GL driver)
Further, when you set the backend to GLES, Bevy does not want to run in XWayland. It fails to initialize the window. That's a separate bug. So to get Bevy to run, you need to enable `--features wayland` to run natively under Wayland, which works.
Contributor guide
Research direction
Reproduce with the `pbr` or `3d_scene` example using `WGPU_BACKEND=gl cargo run --features wayland --example pbr`, and confirm the repeated wgpu-hal GLES messages. Trace the StandardMaterial 3D rendering path and identify where the view-dimension warnings originate. Done means GLES rendering still works without flooding the console each frame.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, 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
- 35/100