My game runs at a solid 60 FPS in portrait mode, but in landscape mode it sometimes struggles to even hit 30.
To make sure this wasn’t a problem with my game specifically, I:
- Created a fresh project from the URP template in Unity 2019.3.11f1.
- I the sample scene, I deleted all the models (leaving only the camera and the light).
- Added a script to the main camera which sets Application.targetFrameRate to 60 and QualitySettings.vSyncCount to 0.
This project also gets a solid 60 FPS in portrait, but drops to 30 in landscape mode (whether by auto-rotation or setting landscape mode as the default orientation in the player settings).
On my OnePlus 3T with the profiler attached, this is what I see with the URP project mentioned above in portrait mode:
And this is what I see in landscape mode (during the same run of the game; I just rotated my phone 90 degrees and waited a few seconds to make sure performance wasn’t being affected by the rotation animation itself):
Notice that in one of the spikes I have selected, Gfx.WaitForPresentOnGfxThread is taking over 6x as long in landscape mode as in portrait. Even when it’s not spiking, that function alone is taking 2-3x as long as in portrait mode.
Has anybody else experienced this? This seems like very strange behavior, but given that it’s happening in the URP template project, it seems like it’s engine-level.