Unable to switch URP /SRP batcher on/off through script. No performance difference on Android?

Hi all,
Using 2019.4.12f1. URP7.5.1/URP7.3.1

GraphicsSettings.useScriptableRenderPipelineBatching = !GraphicsSettings.useScriptableRenderPipelineBatching;

The above line of code does not toggle the batcher on and off.
The only way you can enable/disable batching is through the asset editor UI

It makes testing performance on device a bit cumbersome. I had to build 2 versions one off and another on.
However I noticed that on my Android there’s no noticeable fps/performance difference. Both are set to require OpenGL ES3.1 and I’ve also tried OES 3.2 just to be sure.
Are there any other requirements which I should be aware of in order to get it working?
I’ve tested on my Note 10+ and no difference in frame rates, between having it on and off.Also tested on an Adreno 308 device (Samsung Galaxy J6+)

I’m trying to find out if SRP batching would be faster than instancing. (Instancing is disabled on the Adreno 3XX)
The target device would probably be the Adreno 3XX

Thanks

SRP batcher doesn’t work on Adreno 3xx as well.

Thanks for that.
Is there a list of GPUs that it won’t work? And GPUs where instancing won’t work/disabled? I’m sure it will help other devs tremendously.

And what about the scripting bug? where you can’t enable/disable SRP batching via script? Is that going to be fixed anytime soon?

SRP batcher requires OpenGL ES 3.1 to work. Adreno 3xx has only OpenGL ES 3.0.

No idea :slight_smile:
Did you report a bug?

Not really but the SRPBenchmark from Unity’s github don’t work as advertised… F9 to toggle between on/off don’t work on 2019.4.12f1. Should I report it?

Yes, please :slight_smile:

Testing an android build on a Nexus7 (Adreno OpenGLS 3.0) the SRPBatcherProfiler still reports SRP Batching as on.
If SRP Batching is not supported is it not turned off automatically?
Since turning off in code does not work (using GraphicsSettings.useScriptableRenderPipelineBatching = false; )I can not add a switch in start-up code.
Is there a problem with the batcher turned on when it is not supported? Build is very low FPS on Nexus 7.

I would like to second this issue, by inspecting the value of GraphicsSettings.useScriptableRenderPipelineBatching on canvas text, I can see a frame where the value is changed.
But then it is automatically changed to previous value (value from UniversalRenderPipelineAsset)

Unity 2019.4.18f1
URP 7.5.3
ScriptableBuildPipeline 1.14.1

I just hit this same issue, the script is still broken as of even version 2021.1.14, you set it false and a frame later it’s been reset to true again.

1 Like

same, broken still in 2020.3.18f1. How come this hasn’t been addressed in a year and a half?

Nobody filed a bug report, as far as I know.

Heh, just came across this thread trying to figure out whats going on. Same issue as others. Tried SRPBatcherProfiler and then tried setting it myself but no success.

Trying to set this dynamically so I can test in VR on the Quest 2. So…bug report then?

EDIT: Bug Report submitted!

1 Like

In the meantime, my quick fix for this issue is using a simple QualityManager script.

I created clone of my RenderPipelineAsset with Advanced > SRPBatcher turned off. Then changed the RenderPipelineAsset like this:

GraphicsSettings.renderPipelineAsset = nonSrpBatchingRenderPipelineAsset;

instead of

GraphicsSettings.useScriptableRenderPipelineBatching = !GraphicsSettings.useScriptableRenderPipelineBatching;

Just be careful not to add your RenderPipelineAsset on an assetbundle because it will make all 3D objects purple once the bundle is unloaded. Learned that the hard way.

Turns out, you have to now feed the exact Pipeline Asset to your SRP Batcher to turn it off/on now. Therefore, you have to tap into your actual activated pipeline.

The following is a URP example. You may need to make changes if using HDRP.

// URP Example.
// Must use the URP rendering namespace.
using UnityEngine.Rendering.Universal;


// Feed your URP PIpeline asset here.
// Same one in your Quality settings.
[SerializeField]
        private UniversalRenderPipelineAsset urpPipeline;

// Insert the following code where appropriate to toggle the SRP on/off
urpPipeline.useSRPBatcher = !urpPipeline.useSRPBatcher;
3 Likes