Skip to main content
Inspiring
October 27, 2014

[0.4.3] Intermittent but severe performance issue

I'm seeing an occasional performance issue that happens at least a few times every time I run through my demo with the 0.4.3 SDK, built with Unity 4.5.5f1.

It will be running smoothly at 75 FPS (200+ without Vsync via EnabledCaps), and then suddenly halve to 37FPS (or somewhere between 37 and 75) and stay that way until I toggle Vsync off and then back on again.

According to profiler (running in the Editor), the culprit is OVR_UnityGetModeChange() in the Oculus plugin. When it's called from OVRDisplay.UpdateTextures(), It either clocks in at ~0ms, or at 7-12ms on the CPU on my GTX 660. During a simple scene, this doesn't kill my GPU, but during the main game I am seeing GPU skyrocket to 20-43ms at around the same time that there starts to be a few slow calls to OVR_UnityGetModeChange(). Switching vsync off and back on again doesn't help break out of this in the Editor.

Here's a couple of screenshots. (Right-click -> open in new tab to see the whole thing since the forum's upload feature seems to be broken at the moment)

In this first picture, the top shows the performance problem, and the bottom shows normal profiler readings. That whole spiky section of the CPU graph on the top is all slow OVR_UnityGetModeChange() calls, and the spikes themselves are when the OVR_UnityGetModeChange() takes extra long (43ms etc).


And this second screenshot has the script breakdown pointing to OVR_UnityGetModeChange() as the culprit.


I didn't see the source code for OVR_UnityGetModeChange() anywhere in the base SDK, so I'm guessing the Unity plugin has some extra logic built on top of that. Is anyone able to describe what OVR_UnityGetModeChange() is actually doing, and if not calling it would cause any serious issues?

Thanks in advance!
    This topic has been closed for replies.

    21 replies

    Inspiring
    November 26, 2014
    "vferguson" wrote:
    That's how Vsync works. If you drop below 75fps it will refresh at 75fps/2 = 37.5fps. More info here: http://hardforum.com/showthread.php?t=928593

    If you want it to go as fast as possible when it dips below 75fps, you should disable Vsync.


    I've read something about it.. The problem i'm having is that if i trying to disabled the Vsync i still get 37.5 Fps that's really weird..

    Directmode+ Vsync ON = Stable 37.5 fps

    DirectMode+Vsync OFF= Stable 37.5fps

    Extended Mode + Vsync On or Off= 60+fps.

    I really don't get it..I've already tried to forced off the Vsync with the Catalyst control but no luck.. still 37.5fps.
    MIND LABYRINTH VR DREAMS MIND UNLEASHED