bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
33.71k stars 3.27k forks source link

3D causes wgpu error spam in console when using GLES #13115

Open inodentry opened 2 months ago

inodentry commented 2 months ago

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.

valaphee commented 2 months ago

Probably solved by https://github.com/bevyengine/bevy/pull/13132 not because of #13113 but more over the fact that 0.20.0 also prefers OpenGL instead of OpenGL ES

ByteNybbler commented 1 week ago

Probably solved by #13132 not because of #13113 but more over the fact that 0.20.0 also prefers OpenGL instead of OpenGL ES

I tried running the 2D shapes example on v0.14.0-rc.3 which includes wgpu 0.20, but I'm getting the same error spam, so the issue hasn't been fixed yet:

$ cargo run --example 2d_shapes
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.64s
     Running `target\debug\examples\2d_shapes.exe`
2024-06-27T02:26:26.290667Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Windows 10 Home", kernel: "19045", cpu: "Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz", core_count: "4", memory: "15.9 GiB" }
2024-06-27T02:26:26.813769Z  INFO bevy_render::renderer: AdapterInfo { name: "Intel(R) HD Graphics 4600", vendor: 32902, device: 0, device_type: IntegratedGpu, driver: "OpenGL", driver_info: "4.3.0 - Build 20.19.15.4531", backend: Gl }
2024-06-27T02:26:27.932760Z  WARN bevy_pbr::ssao: ScreenSpaceAmbientOcclusionPlugin not loaded. GPU lacks support: TextureFormat::R16Float does not support TextureUsages::STORAGE_BINDING.
2024-06-27T02:26:27.934359Z  INFO bevy_winit::system: Creating new window "App" (Entity { index: 0, generation: 1 })
2024-06-27T02:26:28.619440Z ERROR log: 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-06-27T02:26:28.619515Z ERROR log: 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`

As you can see, I'm running Windows, so this issue actually isn't specific to Linux.

I will test this again after https://github.com/bevyengine/bevy/pull/12849 is merged.