I am working on a port of a big project, but can’t wrap my head around why I have such a difference in performance between OpenGL and Vulkan.
In my intro scene (Quite basic), I easily get 72 FPS on my quest 2. On vulkan it tanks to 24-36 fps and I don’t see any indication why.
I use:
Unity 2021.2
Oculus XR Plugin 3.0 preview
Vulkan, linear color space, graphics jobs, multithreaded rendering, IL2CPP, and the optimisations in the XR management for Oculus android are on (and late latching enabled)
Quest 2
With vulkan EarlyUpdate XRUpdate takes up 85%. This usually is vsync, but since it’s over 50%, there is something wrong here.
They now use different strategy for depth prepass:
I don’t know why but this change made Quest 2 native builds crawl with depth priming + MSAA enabled. If I just disable “depth texture” and “depth priming” options, I get to keep MSAA at full speed. Alternatively I can just revert the change in that PR and get full speed as well.
@rz_0lento would you be so kind to link the bug report? I can’t find it in the issue tracker under this number. Would be interesting to follow this, although my performance issues with Quest 2 and Vulkan do not seem directly related because Depth Texture and Depth Priming are disabled in my builds.
Ended up going back to 2020 lts since 2021 also introduced some shader issues for me. Might try vulkan again if I get spacewarp working with our custom shaders
Oh my god. My Vulkan performance is also finally fine after setting up the project again in 2020.3.26f1 as opposed to various versions of 2021.x. Of course it might also have been the URP version instead of the Editor version.
For reference as it might help people:
Bad performance on Oculus Quest 2 with Vulkan in:
Unity 2021.1 and 2, various minor versions
URP 12 (also various minor versions)
Oculus Plugin 1.4.x, 2.0.0-preview1, 3.0.0-preview1
Perfectly fine performance (actually a little better than OpenGLES3, finally):
Unity 2020.3.26f1
URP 10.8.0 (NOTE! I’m using Oculus’ custom version of URP 10.8. because I want to try out Application Space Warp. It works but is turned off for the moment. I’m assuming this performance regression should also not be present in Unity’s stock URP 10.8.x)
Oculus Plugin 2.0.0-preview1
I’ve struggled with this issue for days, and I solve the issue by changing renderer.
In my case, my original renderer have used deferred rendering.
When I changed it to foward rendering, the cpu time of EarlyUpdate.XRUpdate has significantly reduced.
This is my environment
Unity 2021.3.10f1
URP 12.1.7
Oculus Plugin 3.0.2