Draw calls and Batches the same

I’m targeting mobile, and I’m desperately trying to improve framerate as much as possible. Every so often I profile after milestones just to make sure everything is on the up and up.

In the Rendering section under the Profiler, I’m seeing 91 SetPass calls (That seems excessive?) but what haunts me the most is the Batches and Draw Calls are exactly the same, which to me says no batching is occurring.

I’m using URP and the SRP Batcher, GPU instancing on materials, and marked static objects as static.

The Frame Debugger shows multiple SRP Batch entries, with any number of Draw Calls listed in the details, so I’m not sure what’s going on. Is batching happening or not? :confused:

Interesting. For me, it’s the text that reads “Batched Draw Calls: 0” and “Batches: 0” that tells me. :wink:

Do you get the same stats in the editor? If batching doesn’t work there either, you may want to run a simple batch test to determine why it’s not working. Check the manual for any possible oversights.

Sometimes, it’s as simple as assigning a material to each renderer but rather than using .sharedMaterial, assigning to .material will make a copy of the material and likely void any batching. Just one of many pitfalls.

Yea, I kind of spaced out those listings. :upside_down_face:

This is from the Editor. I’ve been reading everything I can in the Manual, but nothing is helping.

I’m not doing any .material shenanigans either.

Is there a disconnect between the frame debugger SRP Batch entries and the Rendering stats?

I’m not entirely up to speed with batching. It could be the shader. It says below your box “node use different shader keywords”. Could also be a shader variant issue.

The DrawInstanced box to me indicates this is about Graphics.DrawMeshInstanced and similar calls. I suppose you don’t use those?

As far as I remember, despite materials having this GPU Instancing checkbox, this is only enabling support for instanced rendering. The shader still needs to support this, which URP shaders don’t because they favor SRP batching.

The whole batching thing is sort of confusing because SRP uses a very different mechanism, and if I recall correctly some of the things you used to do for BiRP to enable batching are actually in conflict with SRP batching and may disable it.

Check if you can find other discussions about URP/SRP batching specifically. It’s a finicky topic for sure and I’m only recalling bits from memory.

Yea, after doing some digging, the stats don’t show SRP Batches. You gotta look at the SRP Batch entry in the Frame Debugger to see how many draw calls it batched. Now I gotta see about those batching reasons. Thanks for your help!

1 Like