Search Unity

SRP Batching and Oculus Quest

Discussion in 'Universal Render Pipeline' started by snayss, Jan 15, 2020.

  1. snayss

    snayss

    Joined:
    Jan 15, 2020
    Posts:
    3
    Hello,

    I am working on integrating the URP (version 7.17) into a game for the Oculus Quest / Rift in Unity (2019.3.0f5).

    When testing with the Rift, my build platform is set to PC/Mac/Linux, and I am able to verify that the SRP Batching code path is active. I see that its CPU Rendering time is > 0.0 and that there are RenderLoopNewBatcher.Draw calls in the frame debugger.

    However, when the build platform is set to Android and I build for the Quest, I see that the SRP Batching code path is no longer active.

    I noticed that in the Android XR Settings, the Stereo Rendering Mode can only be set to Single Pass, whereas the documentation clearly states that the SRP Batcher only works with the Single Pass Instancing mode.

    After reading some other forum posts, it seems like SRP Batching is compatible with the Quest, but there was not much information to troubleshoot. Please let me know if there are any Android specific flags that I need to enable SRP Batching, or anything I should try to further debug this issue.

    Thanks for your help --
     
    hippocoder likes this.
  2. equalsequals

    equalsequals

    Joined:
    Sep 27, 2010
    Posts:
    154
    SinglePass in OpenGLES isn't the same as on PC, it's actually Multi-View, which is based on SinglePass Instanced. https://blogs.unity3d.com/2017/11/2...r-performance-with-advanced-stereo-rendering/

    I'm currently exploring this as well in our custom SRP, so I'll report any findings.
     
  3. arnaud-carre

    arnaud-carre

    Unity Technologies

    Joined:
    Jun 23, 2016
    Posts:
    97
    Hi!

    SRP Batcher supports both SinglePassStereo and Multiview . So SRP Batcher should work with Oculus Quest. How do you check that SRP Batcher is OFF with oculus quest?
    Could you fill a bug with something "SRP Batcher turned off with Oculus Quest". It could be awesome if you can attach a small repro project too.
     
  4. snayss

    snayss

    Joined:
    Jan 15, 2020
    Posts:
    3
    @arnaud-carre I check that SRP Batcher is OFF by displaying the SRP Batcher code path ms in the game, similar to the SRPBatcherProfiler.cs script. The display shows 0.0ms for the SRP Batcher code path, and >0.0ms for the Standard code path.

    I also checked in the Frame Debugger ( by attaching the quest to the Unity Editor ), and noticed that there were no longer any SRP Batches.

    Thanks for your help, I will make a repro project / bug report asap.
     
  5. equalsequals

    equalsequals

    Joined:
    Sep 27, 2010
    Posts:
    154
    We are observing the same behaviour where regardless of the state of
    GraphicsSettings.useScriptableRenderPipelineBatching
    the SRPBatcher path is not taken on the Quest. (Edit: Reported as Case 1214861)
    The project setup is as follows:
    • Unity 2019.3.0f5
    • URP 7.1.8 (verified)
    • Legacy XR Settings (SinglePass, which it is my understanding that this is Multi-View on the Quest)
    • GLES 3.1
    Similarly, using the new XR Management system instead of the Legacy results in SRPBatcher being ignored entirely, even on PC using SinglePass Instanced. (Edit: Reported as Case 1214877)
     
    Last edited: Jan 27, 2020
    Cynicat likes this.
  6. Bugfoot

    Bugfoot

    Joined:
    Jan 9, 2009
    Posts:
    533
    Also interested in this, running on Unity 2013.3.1f1 & URP 7.1.8.
    I see SRP batches when profiling the editor scene directly in the frame debugger (e.g. not in PiE mode), but Im not seeing SRP batches when running PIE.

    Our project was originally created on the Lightweight Render package, prior to the switch to URP, and it was still listing the Lightweight RenderPipeline in the installed packages, even though we had upgraded it to the URP a few weeks ago. As a test, I've manually edited the packages manifest file to replace the lightweight RP package line with the new "com.unity.render-pipelines.universal": "7.1.8", but the SPR batching still doesn't seem to work at runtime. I'll continue investigating and report any findings here.
     
  7. equalsequals

    equalsequals

    Joined:
    Sep 27, 2010
    Posts:
    154
    An update. I was able to get SRP Batcher working with 2019.3.0f6 and URP 7.1.8 using Legacy XR.

    The new XR Management system is confirmed broken in 2019.3 but is apparently fixed in 2020.1.
     
    Bugfoot likes this.
  8. unyunburst

    unyunburst

    Joined:
    Feb 7, 2017
    Posts:
    8
    Hey, got any additional info or sources on this post? Using 2019.3.0f6 and URP 7.1.8, but can't get SRP batcher to work. How is the XR Management system broken?
     
    Last edited: Mar 19, 2020
  9. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I don't know. It's news to me. In order to thread the needle in a soup of misinformation, please add your bug report number in this thread.

    It's basically gossip-bugs at this point.
     
    unyunburst likes this.
  10. equalsequals

    equalsequals

    Joined:
    Sep 27, 2010
    Posts:
    154
    In case you were referring to my post, the case is noted right above. Case 1214877 since has an Issue Tracker link as well. Basically, SRP Batcher does not work in any shape or form with 2019.3 & the new XR Management.

    @unyunburst My reproduction for SRP Batcher working was a slightly modified version of the SRP Batcher Benchmark GitHub project. My modifications were simply to add a Quest Controller button input to swap the URP Asset's SRP Batcher flag, since it gets set slammed every frame.

    Note that on Quest this project is GPU Bound, so no visible FPS change will occur when swapping between the code paths.
    If you Profile, however, you will see that it's ~3x CPU performance gain.
     
    unyunburst and ROBYER1 like this.
  11. Arcan-Studios

    Arcan-Studios

    Joined:
    Mar 12, 2015
    Posts:
    58
    i test with new unity 2019.3.12 and fixed, now srp batcher works well in oculus quest
     
    hippocoder and Gruguir like this.
  12. sundayhd5

    sundayhd5

    Joined:
    Aug 5, 2013
    Posts:
    3
    Im on 2020.3.1f1
    Urp 10.3.2,
    Srp not working on quest 2,
    working great only on PC (unity editor).
    Any help?
     
  13. Gelsongoes

    Gelsongoes

    Joined:
    Jan 13, 2020
    Posts:
    2
    Hi guys! I'm on 2020.3.2f1
    URP 10.4.0

    SRP Batcher not working on Quest 2 GLES3.0

    Working on PC Editor.

    Note: On the frame debugger I saw the number of calls is very low, but in the Stats tab is very high.

    Has anyone managed to solve this problem??
     
  14. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    I'm having the same issue. Unity 2020.3.9f1, URP 10.5.0, OpenGLES3, OpenXR for the Oculus Quest using Single Pass Instanced rendering. In the editor things are batching correctly, but on the Quest its not batching. Its causing my draw calls to be very high and to have horrible performance in my game. Does anyone know how to resolve this?
     
  15. SoumyaRipan86

    SoumyaRipan86

    Joined:
    Aug 19, 2019
    Posts:
    12
    You should try with URP 11.0.0. From release doc seems they might have fixed the SRP batching in this release. I had tested the same on Oculus Quest.
     
  16. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    That doesn't seem to be available in 2020.3?
     
  17. ckohlmeyer

    ckohlmeyer

    Joined:
    Apr 17, 2021
    Posts:
    40
    Has anyone established a working combo of Unity version and URP version?

    My current project is on 2020.3.4f1 with URP 10.4.0, and that isn't working on Quest/Quest2.

    I also tested the latest beta, 2021.2.4f1 with URP 12.1.1, and that also didn't work.

    I love what I see in editor with SRP Batcher. Would LOVE to be able to use it on Quest.
     
  18. Gruguir

    Gruguir

    Joined:
    Nov 30, 2010
    Posts:
    340
    yep Unity 2020.3(.20.3f1 atm) + URP 10.7.0 (over the 'verified' 10.6) is my actual magic combo :)
     
  19. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Are you guys managing your URP installs? I haven't done that since 2021, as Unity takes care of it for you then. This in part fixes the "magic combo" stuff I expect?
     
  20. Gruguir

    Gruguir

    Joined:
    Nov 30, 2010
    Posts:
    340
    @hippocoder I was hoping that nothing could go wrong with verified packages, but I experienced bad performances and even broken FFR on quest