Performance issue - What's causing this?

I’ve got an issue on Android where my camera.render takes around 3-4ms but then I’m copping a 20.25ms Graphics.PresentAndSync

I’m calling Application.targetFrameRate = 60 (and I do get 60fps in game under the right conditions) but at my games main menu (that has a carousel with a canvas on each carousel item) is only able to get 30fps.

I’ve set vblank to 0 also:

Application.targetFrameRate = 60;
QualitySettings.vSyncCount = 0;

I’m somewhat familiar with Graphics.PresentAndSync in that it’s typicaly just the vsync wait time. But in this instance it doesn’t really make sense. Camera render of 3-4ms should easily hit 60fps.

Here’s a rendering snapshot:

What am I missing?

When you get 30 fps that means that you miss every second vsync. Check performance without vsync in your main maiu. Maybe during that time your game runs to slow to hit every vsync.

Thanks Quingu, but as you’ll see the rendering is only taking 3-4ms (according to the profiler) behaviour update is < 1ms. I should easily hit 60fps as I’m welllll below the 16ms required to get 60fps.

Note also that I have vsync set to none.

Time spent in “Graphics.PresentAndSync” usually means that the thread is blocked by the graphics driver to wait for the GPU to catch up.

So does that mean it’s likely draw calls or similar? (we have no lighting, no PBR, nothing fancy, not even AA)

Use deep profiling to dig down and see what is going on (open up the Graphics.PresentAndSync hierarchy).

3 Likes

Cheers, I’ve done some digging and it seems to be being caused by some large render textures that I’m displaying on some canvas RawImages - so I assume fillrate issue (??)… Anyway, I dropped them down from 1024x1024 to 512x512 and the issue has mostly gone away.

1 Like