What is PlayerEndOfFrame?

Hi,

Trying to fine tune my app for the mobile device i’m building for. I get a good solid 60fps most of my game, however, there is one area where it goes to about 30fps. I’m trying to find the culprit here.

Well I have noticed that I am renderering about 106K triangles at this point as well as 91 draw calls, so this would certainly be at the top end of rendering per frame on my samsung S6. But what I notice is that I get almost 15ms per frame on PlayerEndOfFrame. I thought the blue bit (see in the image below) was my scripts doing around 15ms, until I found out it was PlayerEndOfFrame. The BehaviourUpdate only does around 1.82ms per frame (Which is really the scripts). Also I assume the Camera.Render is the SOFTWARE side of rendering and not the hardware side of rendering because when I add a GPU profiler, it says the GPU is only doing like 2ms! But Camera.Render takes 10.63ms. This PlayerEndOfFrame is taking 50% of my processing power. Why does also Camera.render take 10ms when the GPU hardware only needs 1ms?

I guess these things are quite project specific and will be diffirent depending on your scene setup.

It’s a long shot but maybe you have some code being run in a script PostUpdate? or in a coroutine after yield new WaitForEndOfFrame(); ?

Maybe Unity is doing some processing of the scene like culling and thats why stuff happens on the CPU when rendering the camera.

Hope you find a solution.

Cheers

I came across this post looking for some more info on what this is. I am using 5.5.1 and working with Gear VR.

From what I’ve read and found in my game it’s just the CPU waiting for the GPU because rendering took too long. I can get this to come up consistently when looking at areas with a lot of geometry or transparency but this can also occur rarely in the same scene when staring at the floor to frustum cull everything.

I tried to use the Frame Debugger to see what was rendering more precisely but that required multi-threaded rendering to be enabled in the build settings. I did that and ran it on device and the problem was no longer an issue. Of course this isn’t a simple checkbox to fix my issues in the long-term and your experience will likely differ but it helps mitigate it now so I can focus on iterating before optimising.