Search Unity

  1. New Unity Live Help updates. Check them out here!

    Dismiss Notice

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:
    132
    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:
    59
    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:
    132
    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. spk

    spk

    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:
    132
    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.
     
    spk 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 Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,480
    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:
    132
    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.
unityunity