Daydream RenderTexture.SetActive spike

Hello, I’d like to ask a question and answer it to share what I’ve found out.

So, while testing a VR app on Daydream, I’ve noticed that after returning to menu and going back to the app or after resuming the app after it was paused something very bad happened to the app’s performance.

Profiler shows continous render spikes at RenderTexture.SetActive that can take up to 300ms. What is happening?

So, the problem was: In my scene there were 2 cameras - left and right. Left camera contained a world space canvas. Moving the canvas out from the camera fixed the problem. The real reason was changing canvas’ position and rotation each frame.