Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
drash's avatar
drash
Heroic Explorer
11 years ago

[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!

21 Replies

Replies have been turned off for this discussion