Large plane / object causing drop in performance, especially on mobile #11213
Labels
A-Rendering
Drawing game state to the screen
C-Bug
An unexpected or incorrect behavior
C-Performance
A change motivated by improving speed, memory usage or compile times
P-Regression
Functionality that used to work but no longer does. Add a test for this!
Bevy version
0.12 / 0.12.1
Relevant system information
Rust 1.73 and 1.76.0-nightly, build on Ubuntu 22.04, run on Android 9, 12, 14.
Issue exists on:
AdaptAdapterInfo { name: "ANGLE (Qualcomm, Adreno (TM) 618, OpenGL ES 3.2)", vendor: 20803, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: [Gl | Vulkan] }
AdapterInfo { name: "Mali-G710", vendor: 5045, device: 2824994820, device_type: IntegratedGpu, driver: "Mali-G710", driver_info: "v1.r43p0-01eac0.ff5c643eda65d3f5ba9886fdffb12673", backend: Vulkan }
AdapterInfo { name: "Mali-T720", vendor: 5045, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: [Gl | Vulkan] }
Works better, but still exists on:
AdapterInfo { name: "Intel(R) HD Graphics", vendor: 32902, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: [Gl | Vulkan] }
AdapterInfo { name: "NVIDIA GeForce GTX 1650 with Max-Q Design", vendor: 4318, device: 8081, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "545.23.08", backend: [Gl | Vulkan]}
What you did
Created a simple scene with a large(-ish) Mesh - Plane or big Box with size 128, to serve as ground, camera looking at objects placed on it.
many_foxes
oranimated_fox
will cause issue as well.What went wrong
Got terrible performance on mobile devices. i.e:
Samsung Galaxy A71, Qualcomm, Adreno 618:
2 fps on
wasm
builds, 11 fps onaarch64-linux-android
apk.Google Pixel 7a, Mali-G710:
11 fps on
wasm
builds, 30 fps onaarch64-linux-android
apk.Laptop with Nvidia / Intel HD was also affected, but to a smaller degree:
100 fps with plain, 300+ fps without it.
This is with a single DirectionalLight with
shadows_enabled: false
.Workaround
Problem fixed by hiding Plane using
visibility: Visibility::Hidden
.now getting 100+ fps on android, 300+ on laptop.
Also mitigated somewhat by leaving Plane visible, but setting
StandardMaterial { unlit: true }
.Gets me 40 fps on android.
Additional information
I couldn't understand why I'm getting such poor performance until accidentally set the camera to negative Y and looked at plane from below and suddenly fps was fine..
I think it is related to issue #6542. very similar. perhaps that issue is not limited to AMD gpus.
Issue #7456 might also be related.
It might be that the problem exists on multiple GPUs, mobile or otherwise, and simply unnoticed on PC/Laptop.
To reproduce attempt to open a wasm or android build with a Plane / Box of size 128 and above and compare fps with it visible and hidden.
Thank you!!
The text was updated successfully, but these errors were encountered: